Search Results for

    Show / Hide Table of Contents

    Class NetworkConnection

    Base NetworkConnection class for server-to-client and client-to-server connection.

    Inheritance
    Object
    NetworkConnection
    NetworkConnectionToClient
    NetworkConnectionToServer
    Namespace: Mirror
    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
    Type Description
    Object
    | Improve this Doc View Source

    batches

    Declaration
    protected Dictionary<int, Batcher> batches
    Field Value
    Type Description
    Dictionary<Int32, Batcher>
    | 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
    Type Description
    Int32
    | Improve this Doc View Source

    isAuthenticated

    Flag that indicates the client has been authenticated.

    Declaration
    public bool isAuthenticated
    Field Value
    Type Description
    Boolean
    | Improve this Doc View Source

    isReady

    A server connection is ready after joining the game world.

    Declaration
    public bool isReady
    Field Value
    Type Description
    Boolean
    | 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
    Type Description
    Single
    | Improve this Doc View Source

    LocalConnectionId

    Declaration
    public const int LocalConnectionId = null
    Field Value
    Type Description
    Int32

    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
    Type Description
    String
    | 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
    Type Description
    HashSet<NetworkIdentity>
    | Improve this Doc View Source

    identity

    This connection's main object (usually the player object).

    Declaration
    public NetworkIdentity identity { get; }
    Property Value
    Type Description
    NetworkIdentity
    | Improve this Doc View Source

    observing

    NetworkIdentities that this connection can see

    Declaration
    public HashSet<NetworkIdentity> observing { get; }
    Property Value
    Type Description
    HashSet<NetworkIdentity>
    | Improve this Doc View Source

    remoteTimeStamp

    last batch's remote timestamp. not interpolated. useful for NetworkTransform etc.

    Declaration
    public double remoteTimeStamp { get; }
    Property Value
    Type Description
    Double

    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
    Type Description
    Batcher
    | 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
    Name Description
    T
    | 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
    Type Description
    String
    | 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
    Type Description
    Boolean
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX