Photon Bolt Engine API
1.3
The connection to a remote endpoint More...
Public Member Functions | |
| void | Disconnect () |
| Disconnect this connection More... | |
| void | Disconnect (IProtocolToken token, UdpConnectionDisconnectReason disconnectReason=UdpConnectionDisconnectReason.Disconnected) |
| Disconnect this connection with custom data More... | |
| override bool | Equals (object obj) |
| Reference comparison between two connections More... | |
| ExistsResult | ExistsOnRemote (BoltEntity entity) |
| ExistsResult | ExistsOnRemote (BoltEntity entity, bool allowMaybe) |
| void | ForceSceneSync () |
| override int | GetHashCode () |
| A hash code for this connection More... | |
| int | GetSkippedUpdates (BoltEntity en) |
| bool | ReceiveData (out byte[] data) |
| Receives the data. More... | |
| void | SendData (byte[] data) |
| Sends the data. More... | |
| void | SetCanReceiveEntities (bool v) |
| void | SetStreamBandwidth (int bytesPerSecond) |
| Set the max amount of data allowed per second More... | |
| void | StreamBytes (UdpChannelName channel, byte[] data) |
| Send a binary stream of data to this connection More... | |
| override string | ToString () |
| The string representation of this connection More... | |
Static Public Member Functions | |
| static implicit | operator bool (BoltConnection cn) |
| static implicit | operator bool (BoltObject obj) |
Public Attributes | |
| int | PacketsLost => _packetLostCounter |
| How many packets were registered as lost packets More... | |
| int | PacketsReceived => _packetsReceived |
| How many packets were received by this connection More... | |
| int | PacketsSent => _packetCounter |
| How many packets were sent to this connection More... | |
Properties | |
| IProtocolToken | AcceptToken [get, set] |
| A data token that was passed by the server when accepting the connection More... | |
| int | BitsPerSecondIn [get] |
| How many bits per second we are receiving in More... | |
| int | BitsPerSecondOut [get] |
| How many bits per second we are sending out More... | |
| PacketTypeStats | CommandsStats [get] |
| uint | ConnectionId [get] |
| For the host this will be the ID of the client, an on the client it will show the ID of the client More... | |
| UdpConnectionType | ConnectionType [get] |
| IProtocolToken | ConnectToken [get, set] |
| The ConnectToken contains the token sent by the client when connecting to a game server. When you call BoltNetwork.Connect, BoltMatchmaking.JoinSession or BoltMatchmaking.JoinRandomSession with a Token, it can be accessed via this property More... | |
| int | DejitterFrames [get] |
| The dejitter delay in number of frames More... | |
| UdpKit.UdpConnectionDisconnectReason | DisconnectReason [get] |
| IProtocolToken | DisconnectToken [get, set] |
| The DisconnectToken contains the token used when a Connection is shutdown, either by the remote client or by the game server. When calling BoltConnection.Disconnect with a Token, it can be accessed via this property. More... | |
| PacketTypeStats | EventsStats [get] |
| EntityList | HasControlOf [get] |
| bool | IsLoadingMap [get] |
| Returns true if the remote computer on the other end of this connection is loading a map currently, otherwise false More... | |
| float | PingAliased [get] |
| The round-trip time across the network, including processing delays and acks More... | |
| float | PingNetwork [get] |
| The round-trip time on the network More... | |
| UdpEndPoint | RemoteEndPoint [get] |
| Remote end point of this connection More... | |
| int | RemoteFrame [get] |
| The estimated frame of the simulation running at the other end of this connection More... | |
| EntityLookup | ScopedTo [get] |
| EntityLookup | SourceOf [get] |
| PacketTypeStats | StatesStats [get] |
| object | UserData [get, set] |
| User assignable object which lets you pair arbitrary data with the connection More... | |
The connection to a remote endpoint
Example: Accepting an incoming connection.
|
inline |
Disconnect this connection
Example: Terminating all connections.
|
inline |
Disconnect this connection with custom data
| token | A data token |
| disconnectReason | Specify the disconnect reason to shutdown this connection |
Example: Terminating all connections with a custom error message.
|
inline |
Reference comparison between two connections
| obj | The object to compare |
bool Compare(BoltConnection A, BoltConnection B) { return A.Equals(B); }
|
inline |
|
inline |
|
inline |
|
inline |
A hash code for this connection
|
inline |
|
inlinestatic |
|
inlinestaticinherited |
|
inline |
Receives the data.
true, if data was received, false otherwise.| data | Data. |
|
inline |
Sends the data.
| data | Data. |
|
inline |
|
inline |
Set the max amount of data allowed per second
| bytesPerSecond | The rate in bytes / sec |
Example: Configuring the initial stream bandwidth of new connections to 20 kb/s.
|
inline |
Send a binary stream of data to this connection
| channel | The channel to send on |
| data | The binary data |
Example: Sending the binary data of a custom icon texture to the server using a static reference to the "PlayerIcon" channel that was created inside a Channels class.
|
inline |
The string representation of this connection
Example: Logging the address of new connections using the string representation.
| int Photon.Bolt.BoltConnection.PacketsLost => _packetLostCounter |
How many packets were registered as lost packets
| int Photon.Bolt.BoltConnection.PacketsReceived => _packetsReceived |
How many packets were received by this connection
| int Photon.Bolt.BoltConnection.PacketsSent => _packetCounter |
How many packets were sent to this connection
|
getset |
A data token that was passed by the server when accepting the connection
Example: Using the AcceptToken to store connection settings.
|
get |
How many bits per second we are receiving in
Example: Showing the ping and data flow in and out.
|
get |
How many bits per second we are sending out
Example: Showing the ping and data flow in and out.
|
get |
|
get |
For the host this will be the ID of the client, an on the client it will show the ID of the client
Example: Getting a connection Id
|
get |
|
getset |
The ConnectToken contains the token sent by the client when connecting to a game server. When you call BoltNetwork.Connect, BoltMatchmaking.JoinSession or BoltMatchmaking.JoinRandomSession with a Token, it can be accessed via this property
|
get |
The dejitter delay in number of frames
Example: Showing the dejitter delay frames and ping.
|
get |
|
getset |
The DisconnectToken contains the token used when a Connection is shutdown, either by the remote client or by the game server. When calling BoltConnection.Disconnect with a Token, it can be accessed via this property.
|
get |
|
get |
|
get |
Returns true if the remote computer on the other end of this connection is loading a map currently, otherwise false
Example: Removing a preloaded player entity from the game if they disconnect while loading.
|
get |
The round-trip time across the network, including processing delays and acks
Example: Showing the difference between ping and aliased ping. Aliased ping will always be larger.
|
get |
The round-trip time on the network
Example: Displaying the network ping when in debug mode.
|
get |
Remote end point of this connection
Example: Logging the address of new connections
|
get |
The estimated frame of the simulation running at the other end of this connection
Example: Calculating the average frame difference of the client and server for all clients.
|
get |
|
get |
|
get |
|
getset |
User assignable object which lets you pair arbitrary data with the connection
Example: Using a reference to the player entity in the UserData property.