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, used for local RPCs. |
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 |
---|---|
HasPermission | Checks if the connection has a specific permission. |
Kick | Kicks the connection for a specified reason. |
SendLog | Sends a log message to the connection. |
SendMessage | Sends a message to the connection. |
GetUserData | Retrieves user data associated with a specific key. |
SendRequest | Sends a request to the connection and awaits a response. |
SendResponse | Sends a response to a request identified by a request ID. |
Id | This connection's unique identifier. |
CanSpawnObjects | Indicates if the connection can spawn networked objects. |
CanRefreshObjects | Indicates if the connection can refresh networked objects they own. |
Latency | The latency of the connection. |
Name | The name of the connection. |
Time | The time associated with the connection. |
Address | The address of the connection. |
IsHost | Indicates if the connection is the host. |
IsConnecting | True if the connection is still currently connecting. |
IsActive | True if the connection is fully connected and logged on. |
MessagesSent | The number of messages sent to this connection. |
MessagesRecieved | The number of messages received from this connection. |
Stats | Provides stats about the connection, such as bandwidth usage. |
Ping | The ping of the connection in milliseconds. |
DisplayName | The display name of the connection. |
SteamId | The Steam ID associated with the connection. |
PartyId | The ID of the party the user is part of, used for grouping. |
ConnectionTime | The time when the connection was established. |