public abstract class 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.
Constructors
Showing 1 constructors
public GameNetworkSystem()
No results match this filter.
Methods
Showing 26 methods
public virtual bool AcceptConnection(Sandbox.Connection channel, string reason)
Called on the host to decide whether to accept a `Sandbox.Connection`.
Parameters
reason: The reason to display to the client.
public void Broadcast(T obj, System.Nullable`1<Sandbox.Connection.Filter> filter = null)
Parameters
filter: Default: null
public void BroadcastRaw(Sandbox.ByteStream msg, System.Nullable`1<Sandbox.Connection.Filter> filter = null)
Parameters
filter: Default: null
public static void CreateLobby()Obsolete
Obsolete: Moved to Networking.CreateLobby
public static void Disconnect()Obsolete
Obsolete: Moved to Networking.Disconnect
public virtual void Dispose()
public virtual void GetMountedVPKs(Sandbox.Connection source, Sandbox.Network.MountedVPKsResponse msg)
public virtual void GetSnapshot(Sandbox.Connection source, Sandbox.Network.SnapshotMsg msg)
public virtual System.Threading.Tasks.Task MountVPKs(Sandbox.Connection source, Sandbox.Network.MountedVPKsResponse msg)
public virtual void OnBecameHost(Sandbox.Connection previousHost)
The host left the server and you are now in charge.
public virtual void OnConnected(Sandbox.Connection client)
A client has connected to the server but hasn't fully finished joining yet.
public virtual void OnHostChanged(Sandbox.Connection previousHost, Sandbox.Connection newHost)
The current host has been changed.
public virtual void OnInitialize()
Called when the network system should handle initialization.
public virtual void OnJoined(Sandbox.Connection client)
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.
public virtual void OnLeave(Sandbox.Connection client)
A client has disconnected from the server.
public virtual System.IDisposable Push()
Allows to push some kind of scope when reading network messages. This is useful if you need to adjust Time.Now etc.
public static System.Threading.Tasks.Task`1<System.Collections.Generic.List`1<Sandbox.Network.LobbyInformation>> QueryLobbies()Obsolete
Obsolete: Moved to Networking.QueryLobbies
public void Send(System.Guid connectionId, T obj)
public virtual System.Threading.Tasks.Task SetSnapshotAsync(Sandbox.Network.SnapshotMsg data)
protected virtual void Tick()
Called every frame
public static System.Threading.Tasks.Task`1<bool> TryConnectSteamId(ulong steamId)Obsolete
Obsolete: Moved to Networking.Connect
No results match this filter.
Properties
Showing 4 properties
public static bool Sandbox.Network.GameNetworkSystem.IsActive { get; set; }Obsolete
True if we're currently connected etc
Obsolete: Moved to Networking.IsActive
public static bool Sandbox.Network.GameNetworkSystem.IsClient { get; set; }Obsolete
True if we're connected to a server and not the host.
Obsolete: Moved to Networking.IsClient
public static bool Sandbox.Network.GameNetworkSystem.IsConnecting { get; set; }Obsolete
True if we're currently connecting to the server
Obsolete: Moved to Networking.IsConnecting
public static bool Sandbox.Network.GameNetworkSystem.IsHost { get; set; }Obsolete
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.
Obsolete: Moved to Networking.IsHost
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Network |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Network.GameNetworkSystem |