s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Network
Connection
chevron_left
Network
class
Connection
search
Constructors
lock
Connection
Properties
data_object
Address
data_object
CanDestroyObjects
data_object
CanRefreshObjects
data_object
CanSpawnObjects
data_object
ConnectionTime
data_object
DisplayName
data_object
FriendInfo
data_object
Id
data_object
IsActive
data_object
IsConnecting
data_object
IsHost
data_object
Latency
data_object
MessagesRecieved
data_object
MessagesSent
data_object
Name
data_object
OwnerSteamId
data_object
PartyId
data_object
Ping
data_object
Stats
data_object
SteamId
data_object
Time
Methods
functions
DistanceSquared
functions
Down
functions
GetUserData
functions
HasInventoryItem
functions
HasPermission
functions
Kick
functions
Pressed
functions
Released
functions
SendLog
functions
SendMessage
functions
SendRequest
functions
SendResponse
Static Properties
data_object
All
data_object
Host
data_object
Local
Static Methods
functions
Find
Connection
A connection, usually to a server or a client.
class
Sandbox
.
abstract
Sandbox.Engine
build
Constructors
1
Connection
(
)
data_object
Properties
21
Address
string
CanDestroyObjects
bool
Can this connection destroy networked objects they own?
CanRefreshObjects
bool
Can this connection refresh networked objects that they own?
CanSpawnObjects
bool
Can this connection spawn networked objects?
ConnectionTime
DateTimeOffset
DisplayName
string
FriendInfo
Friend
Steam friend information for this connection
Id
Guid
This connection's unique identifier.
IsActive
bool
True if this channel is fully connnected and fully logged on.
IsConnecting
bool
True if this channel is still currently connecting.
IsHost
bool
Latency
float
MessagesRecieved
int
How many messages have been received from this connection?
MessagesSent
int
How many messages have been sent to this connection?
Name
string
OwnerSteamId
SteamId
The SteamID of the account that actually owns the game in a Steam Family. If not in a Steam Family this is the same as Sandbox.Connection.SteamId
PartyId
SteamId
The Id of the party that this user is a part of. This can be used to compare to other users to group them into parties.
Ping
float
The ping of this connection (in milliseconds.)
Stats
ConnectionStats
Get stats about this connection such as bandwidth usage and how many packets are being sent and received.
SteamId
SteamId
Time
float
functions
Methods
12
DistanceSquared
(
position
)
float
Calculate the closest distance (squared) to a position based on the Pvs sources from this Sandbox.Connection.
Down
(
action
)
bool
Action is currently pressed down for this Sandbox.Connection.
GetUserData
(
key
)
string
HasInventoryItem
(
definitionId
)
bool
Check if this connection has a specific inventory item in their Steam Inventory
HasPermission
(
permission
)
bool
Get whether this connection has a specific permission.
Kick
(
reason
)
Kick this Sandbox.Connection from the server. Only the host can kick clients.
Pressed
(
action
)
bool
Action was pressed for this Sandbox.Connection within the current update context.
Released
(
action
)
bool
Action was released for this Sandbox.Connection within the current update context.
SendLog
(
level
,
message
)
Log a message to the console for this connection.
SendMessage
(
t
)
Send a message to this connection.
SendRequest
(
t
)
Task`1
Send a message to this connection, wait for a response
SendResponse
(
requestId
,
t
)
Send a response message to this connection.
data_object
Static Properties
3
All
IReadOnlyList`1
A list of connections that are currently on this server. If you're not on a server this will return only one connection (Connection.Local). Some games restrict the connection list - in which case you will get an empty list.
Host
Connection
The connection of the current network host.
Local
Connection
This is a "fake" connection for the local player. It is passed to RPCs when calling them locally etc.
functions
Static Methods
1
Find
(
id
)
Connection
Find a Sandbox.Connection for a Connection Id.
arrow_back_ios
1
arrow_forward_ios
trophy
0
Aug 2023
1 post
Zaza
one month ago
#1
What are the limitations of
Connection.Local
compared to real connections?
arrow_back_ios
1
arrow_forward_ios
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.