Skip to main content

MLAPI.NetworkVariable.INetworkVariable

Interface for network value containers

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public interface INetworkVariable

Properties#

RemoteTick#

Accessor for the RemoteTick stored in the networkVariable, list, set or dictionary

Declaration#

ushort RemoteTick { get; }

Property Value#

TypeDescription
System.UInt16

Methods#

CanClientRead(UInt64)#

Gets Whether or not a specific client can read to the varaible

Declaration#

bool CanClientRead(ulong clientId)

Parameters#

TypeNameDescription
System.UInt64clientIdThe clientId of the remote client

Returns#

TypeDescription
System.BooleanWhether or not the client can read to the variable

CanClientWrite(UInt64)#

Gets Whether or not a specific client can write to the varaible

Declaration#

bool CanClientWrite(ulong clientId)

Parameters#

TypeNameDescription
System.UInt64clientIdThe clientId of the remote client

Returns#

TypeDescription
System.BooleanWhether or not the client can write to the variable

GetChannel()#

Returns the name of the channel to be used for syncing

Declaration#

NetworkChannel GetChannel()

Returns#

TypeDescription
NetworkChannelThe name of the channel to be used for syncing

IsDirty()#

Gets Whether or not the container is dirty

Declaration#

bool IsDirty()

Returns#

TypeDescription
System.BooleanWhether or not the container is dirty

ReadDelta(Stream, Boolean, UInt16, UInt16)#

Reads delta from the reader and applies them to the internal value

Declaration#

void ReadDelta(Stream stream, bool keepDirtyDelta, ushort localTick, ushort remoteTick)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to read the delta from
System.BooleankeepDirtyDeltaWhether or not the delta should be kept as dirty or consumed
System.UInt16localTickThe local network tick at which this var was written, on the machine it was written
System.UInt16remoteTickThe remote network tick at which this var was sent by the host

ReadField(Stream, UInt16, UInt16)#

Reads the complete state from the reader and applies it

Declaration#

void ReadField(Stream stream, ushort localTick, ushort remoteTick)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to read the state from
System.UInt16localTickThe local network tick at which this var was written, on the machine it was written
System.UInt16remoteTickThe remote network tick at which this var was sent by the host

ResetDirty()#

Resets the dirty state and marks the variable as synced / clean

Declaration#

void ResetDirty()

SetNetworkBehaviour(NetworkBehaviour)#

Sets NetworkBehaviour the container belongs to.

Declaration#

void SetNetworkBehaviour(NetworkBehaviour behaviour)

Parameters#

TypeNameDescription
NetworkBehaviourbehaviourThe behaviour the container behaves to

WriteDelta(Stream)#

Writes the dirty changes, that is, the changes since the variable was last dirty, to the writer

Declaration#

void WriteDelta(Stream stream)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to write the dirty changes to

WriteField(Stream)#

Writes the complete state of the variable to the writer

Declaration#

void WriteField(Stream stream)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to write the state to