Class NetworkConnection
Base NetworkConnection class for server-to-client and client-to-server connection.
Inheritance
NetworkConnection
Assembly: doc.dll
Syntax
public abstract class NetworkConnection : object
Fields
|
Improve this Doc
View Source
authenticationData
General purpose object to hold authentication data, character selection, tokens, etc.
Declaration
public object authenticationData
Field Value
|
Improve this Doc
View Source
batches
Declaration
protected Dictionary<int, Batcher> batches
Field Value
|
Improve this Doc
View Source
connectionId
Unique identifier for this connection that is assigned by the transport layer.
Declaration
public readonly int connectionId
Field Value
|
Improve this Doc
View Source
isAuthenticated
Flag that indicates the client has been authenticated.
Declaration
public bool isAuthenticated
Field Value
|
Improve this Doc
View Source
isReady
A server connection is ready after joining the game world.
Declaration
Field Value
|
Improve this Doc
View Source
lastMessageTime
Last time a message was received for this connection. Includes system and user messages.
Declaration
public float lastMessageTime
Field Value
|
Improve this Doc
View Source
LocalConnectionId
Declaration
public const int LocalConnectionId = null
Field Value
Properties
|
Improve this Doc
View Source
address
IP address of the connection. Can be useful for game master IP bans etc.
Declaration
public abstract string address { get; }
Property Value
|
Improve this Doc
View Source
clientOwnedObjects
All NetworkIdentities owned by this connection. Can be main player, pets, etc.
Declaration
public HashSet<NetworkIdentity> clientOwnedObjects { get; }
Property Value
|
Improve this Doc
View Source
identity
This connection's main object (usually the player object).
Declaration
public NetworkIdentity identity { get; }
Property Value
|
Improve this Doc
View Source
observing
NetworkIdentities that this connection can see
Declaration
public HashSet<NetworkIdentity> observing { get; }
Property Value
|
Improve this Doc
View Source
remoteTimeStamp
last batch's remote timestamp. not interpolated. useful for NetworkTransform etc.
Declaration
public double remoteTimeStamp { get; }
Property Value
Methods
|
Improve this Doc
View Source
Disconnect()
Disconnects this connection.
Declaration
public abstract void Disconnect()
|
Improve this Doc
View Source
GetBatchForChannelId(Int32)
Declaration
protected Batcher GetBatchForChannelId(int channelId)
Parameters
Type |
Name |
Description |
Int32 |
channelId |
|
Returns
|
Improve this Doc
View Source
Send<T>(T, Int32)
Send a NetworkMessage to this connection over the given channel.
Declaration
public void Send<T>(T message, int channelId = null)
where T : struct, NetworkMessage
Parameters
Type |
Name |
Description |
T |
message |
|
Int32 |
channelId |
|
Type Parameters
|
Improve this Doc
View Source
SendToTransport(ArraySegment<Byte>, Int32)
Declaration
protected abstract void SendToTransport(ArraySegment<byte> segment, int channelId = null)
Parameters
Type |
Name |
Description |
ArraySegment<Byte> |
segment |
|
Int32 |
channelId |
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
|
Improve this Doc
View Source
ValidatePacketSize(ArraySegment<Byte>, Int32)
Declaration
protected static bool ValidatePacketSize(ArraySegment<byte> segment, int channelId)
Parameters
Type |
Name |
Description |
ArraySegment<Byte> |
segment |
|
Int32 |
channelId |
|
Returns