Mirror Networking
Mirror.NetworkConnectionToClient Class Reference
Inheritance diagram for Mirror.NetworkConnectionToClient:
Mirror.NetworkConnection Mirror.LocalConnectionToClient

Public Member Functions

 NetworkConnectionToClient (int networkConnectionId)
 
override void Disconnect ()
 Disconnects this connection. More...
 
- Public Member Functions inherited from Mirror.NetworkConnection
void Send< T > (T message, int channelId=Channels.Reliable)
 Send a NetworkMessage to this connection over the given channel. More...
 
abstract void Disconnect ()
 Disconnects this connection. More...
 
override string ToString ()
 

Public Attributes

new readonly HashSet< NetworkIdentityobserving = new HashSet<NetworkIdentity>()
 NetworkIdentities that this connection can see More...
 
new readonly HashSet< NetworkIdentityclientOwnedObjects = new HashSet<NetworkIdentity>()
 All NetworkIdentities owned by this connection. Can be main player, pets, etc. More...
 
Unbatcher unbatcher = new Unbatcher()
 
- Public Attributes inherited from Mirror.NetworkConnection
readonly int connectionId
 Unique identifier for this connection that is assigned by the transport layer. More...
 
bool isAuthenticated
 Flag that indicates the client has been authenticated. More...
 
object authenticationData
 General purpose object to hold authentication data, character selection, tokens, etc. More...
 
bool isReady
 A server connection is ready after joining the game world. More...
 
float lastMessageTime
 Last time a message was received for this connection. Includes system and user messages. More...
 

Protected Member Functions

override void SendToTransport (ArraySegment< byte > segment, int channelId=Channels.Reliable)
 
- Protected Member Functions inherited from Mirror.NetworkConnection
Batcher GetBatchForChannelId (int channelId)
 
abstract void SendToTransport (ArraySegment< byte > segment, int channelId=Channels.Reliable)
 

Properties

override string address [get]
 
- Properties inherited from Mirror.NetworkConnection
HashSet< NetworkIdentityobserving [get]
 NetworkIdentities that this connection can see More...
 
abstract string address [get]
 IP address of the connection. Can be useful for game master IP bans etc. More...
 
NetworkIdentity identity [get, set]
 This connection's main object (usually the player object). More...
 
HashSet< NetworkIdentityclientOwnedObjects [get]
 All NetworkIdentities owned by this connection. Can be main player, pets, etc. More...
 
double remoteTimeStamp [get, set]
 last batch's remote timestamp. not interpolated. useful for NetworkTransform etc. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Mirror.NetworkConnection
const int LocalConnectionId = 0
 
- Static Protected Member Functions inherited from Mirror.NetworkConnection
static bool ValidatePacketSize (ArraySegment< byte > segment, int channelId)
 
- Protected Attributes inherited from Mirror.NetworkConnection
Dictionary< int, Batcherbatches = new Dictionary<int, Batcher>()
 

Detailed Description

Definition at line 7 of file NetworkConnectionToClient.cs.

Constructor & Destructor Documentation

◆ NetworkConnectionToClient()

Mirror.NetworkConnectionToClient.NetworkConnectionToClient ( int  networkConnectionId)

Definition at line 26 of file NetworkConnectionToClient.cs.

27 : base(networkConnectionId) {}

Member Function Documentation

◆ Disconnect()

override void Mirror.NetworkConnectionToClient.Disconnect ( )
virtual

Disconnects this connection.

Implements Mirror.NetworkConnection.

Definition at line 35 of file NetworkConnectionToClient.cs.

36 {
37 // set not ready and handle clientscene disconnect in any case
38 // (might be client or host mode here)
39 isReady = false;
40 Transport.activeTransport.ServerDisconnect(connectionId);
41
42 // IMPORTANT: NetworkConnection.Disconnect() is NOT called for
43 // voluntary disconnects from the other end.
44 // -> so all 'on disconnect' cleanup code needs to be in
45 // OnTransportDisconnect, where it's called for both voluntary
46 // and involuntary disconnects!
47 }
readonly int connectionId
Unique identifier for this connection that is assigned by the transport layer.
bool isReady
A server connection is ready after joining the game world.

◆ SendToTransport()

override void Mirror.NetworkConnectionToClient.SendToTransport ( ArraySegment< byte >  segment,
int  channelId = Channels.Reliable 
)
protectedvirtual

Member Data Documentation

◆ clientOwnedObjects

new readonly HashSet<NetworkIdentity> Mirror.NetworkConnectionToClient.clientOwnedObjects = new HashSet<NetworkIdentity>()

All NetworkIdentities owned by this connection. Can be main player, pets, etc.

Definition at line 21 of file NetworkConnectionToClient.cs.

◆ observing

new readonly HashSet<NetworkIdentity> Mirror.NetworkConnectionToClient.observing = new HashSet<NetworkIdentity>()

NetworkIdentities that this connection can see

Definition at line 14 of file NetworkConnectionToClient.cs.

◆ unbatcher

Unbatcher Mirror.NetworkConnectionToClient.unbatcher = new Unbatcher()

Definition at line 24 of file NetworkConnectionToClient.cs.

Property Documentation

◆ address

override string Mirror.NetworkConnectionToClient.address
get

Definition at line 9 of file NetworkConnectionToClient.cs.