The Connection class in the Sandbox namespace represents a network connection, typically to a server or client. It provides various properties and methods to manage and interact with the connection.
The Connection class in the Sandbox namespace represents a network connection, typically to a server or client. It provides various properties and methods to manage and interact with the connection.
Member Name | Summary |
---|---|
Find | Finds a connection by its unique identifier. |
Local | This is a "fake" connection for the local player. It is used for local RPC calls. |
All | A list of connections currently on the server. Returns only the local connection if not on a server. |
Host | The connection of the current network host. |
Member Name | Summary |
---|---|
Id | This connection's unique identifier. |
CanSpawnObjects | Indicates if this connection can spawn networked objects. |
CanRefreshObjects | Indicates if this connection can refresh networked objects they own. |
Latency | The latency of the connection. |
Name | The name of the connection. |
Time | The time since the connection was established. |
Address | The address of the connection. |
IsHost | Indicates if this connection is the host. |
IsConnecting | True if this channel is still currently connecting. |
IsActive | True if this channel is fully connected and logged on. |
MessagesSent | Number of messages sent to this connection. |
MessagesRecieved | Number of messages received from this connection. |
Stats | Get stats about this connection such as bandwidth usage and packet counts. |
Ping | The ping of this connection in milliseconds. |
DisplayName | The display name of the connection. |
SteamId | The Steam ID associated with this connection. |
PartyId | The ID of the party this user is part of, used for grouping. |
ConnectionTime | The time when the connection was established. |
HasPermission | Checks if the connection has a specific permission. |
Kick | Kicks the connection with a specified reason. |
SendLog | Sends a log message with a specified level and message. |
SendMessage | Sends a message of a specified type. |
GetUserData | Retrieves user data associated with a specified key. |
SendRequest | Sends a request and returns a task representing the asynchronous operation. |
SendResponse | Sends a response to a specified request ID. |