# Sandbox.Network.GameNetworkSystem

An instance of this is created by the NetworkSystem when a server is joined, or created.
You should not try to create this manually.

- Kind: class
- Namespace: `Sandbox.Network`
- Assembly: `Sandbox.Engine`
- Modifiers: abstract

## Constructors

- [`GameNetworkSystem`](/api/Sandbox.Network.GameNetworkSystem/.ctor)

## Properties

- [`IsActive`](/api/Sandbox.Network.GameNetworkSystem/IsActive): True if we're currently connected etc
- [`IsClient`](/api/Sandbox.Network.GameNetworkSystem/IsClient): True if we're connected to a server and not the host.
- [`IsConnecting`](/api/Sandbox.Network.GameNetworkSystem/IsConnecting): True if we're currently connecting to the server
- [`IsHost`](/api/Sandbox.Network.GameNetworkSystem/IsHost): True if we can be considered the host of this session. Either we're not connected to a server, or we are and we are the host.

## Methods

- [`AcceptConnection`](/api/Sandbox.Network.GameNetworkSystem/AcceptConnection): Called on the host to decide whether to accept a [Sandbox.Connection](/api/Sandbox.Connection).
- [`AddHandler`](/api/Sandbox.Network.GameNetworkSystem/AddHandler)
- [`BecomeHostAsync`](/api/Sandbox.Network.GameNetworkSystem/BecomeHostAsync): We're already the host; load the previous host's snapshot.
- [`Broadcast`](/api/Sandbox.Network.GameNetworkSystem/Broadcast)
- [`BroadcastRaw`](/api/Sandbox.Network.GameNetworkSystem/BroadcastRaw)
- [`Connect`](/api/Sandbox.Network.GameNetworkSystem/Connect)
- [`CreateLobby`](/api/Sandbox.Network.GameNetworkSystem/CreateLobby)
- [`Disconnect`](/api/Sandbox.Network.GameNetworkSystem/Disconnect)
- [`Dispose`](/api/Sandbox.Network.GameNetworkSystem/Dispose)
- [`GetMountedVPKs`](/api/Sandbox.Network.GameNetworkSystem/GetMountedVPKs)
- [`GetSnapshot`](/api/Sandbox.Network.GameNetworkSystem/GetSnapshot)
- [`MountVPKs`](/api/Sandbox.Network.GameNetworkSystem/MountVPKs)
- [`OnBecameHost`](/api/Sandbox.Network.GameNetworkSystem/OnBecameHost): Legacy host-change callback. Override BecomeHostAsync to apply the handoff snapshot. The default BecomeHostAsync implementation calls this for existing subclasses.
- [`OnConnected`](/api/Sandbox.Network.GameNetworkSystem/OnConnected): A client has connected to the server but hasn't fully finished joining yet.
- [`OnHostChanged`](/api/Sandbox.Network.GameNetworkSystem/OnHostChanged): Legacy host-change callback. Override ResyncFromHostAsync to apply the new host's snapshot. The default ResyncFromHostAsync implementation calls this for existing subclasses.
- [`OnInitialize`](/api/Sandbox.Network.GameNetworkSystem/OnInitialize): Called when the network system should handle initialization.
- [`OnJoined`](/api/Sandbox.Network.GameNetworkSystem/OnJoined): Fully joined the server. Can be called when changing the map too. The game should usually create some object for the player to control here.
- [`OnLeave`](/api/Sandbox.Network.GameNetworkSystem/OnLeave): A client has disconnected from the server.
- [`Push`](/api/Sandbox.Network.GameNetworkSystem/Push): Allows to push some kind of scope when reading network messages. This is useful if you need to adjust Time.Now etc.
- [`QueryLobbies`](/api/Sandbox.Network.GameNetworkSystem/QueryLobbies)
- [`ResyncFromHostAsync`](/api/Sandbox.Network.GameNetworkSystem/ResyncFromHostAsync): Rebuild the game from the new host's snapshot.
- [`Send`](/api/Sandbox.Network.GameNetworkSystem/Send)
- [`SetSnapshotAsync`](/api/Sandbox.Network.GameNetworkSystem/SetSnapshotAsync)
- [`TryConnectSteamId`](/api/Sandbox.Network.GameNetworkSystem/TryConnectSteamId)
