Mirror Networking
|
Base class for networked components. More...
Classes | |
struct | NetworkBehaviourSyncVar |
Public Member Functions | |
void | SetSyncVarDirtyBit (ulong dirtyBit) |
Set as dirty so that it's synced to clients again. More... | |
bool | IsDirty () |
void | ClearAllDirtyBits () |
Clears all the dirty bits that were set by SetDirtyBits() More... | |
void | GeneratedSyncVarSetter< T > (T value, ref T field, ulong dirtyBit, Action< T, T > OnChanged) |
void | GeneratedSyncVarSetter_GameObject (GameObject value, ref GameObject field, ulong dirtyBit, Action< GameObject, GameObject > OnChanged, ref uint netIdField) |
void | GeneratedSyncVarSetter_NetworkIdentity (NetworkIdentity value, ref NetworkIdentity field, ulong dirtyBit, Action< NetworkIdentity, NetworkIdentity > OnChanged, ref uint netIdField) |
void | GeneratedSyncVarSetter_NetworkBehaviour< T > (T value, ref T field, ulong dirtyBit, Action< T, T > OnChanged, ref NetworkBehaviourSyncVar netIdField) |
void | GeneratedSyncVarDeserialize< T > (ref T field, Action< T, T > OnChanged, T value) |
void | GeneratedSyncVarDeserialize_GameObject (ref GameObject field, Action< GameObject, GameObject > OnChanged, NetworkReader reader, ref uint netIdField) |
void | GeneratedSyncVarDeserialize_NetworkIdentity (ref NetworkIdentity field, Action< NetworkIdentity, NetworkIdentity > OnChanged, NetworkReader reader, ref uint netIdField) |
void | GeneratedSyncVarDeserialize_NetworkBehaviour< T > (ref T field, Action< T, T > OnChanged, NetworkReader reader, ref NetworkBehaviourSyncVar netIdField) |
virtual bool | OnSerialize (NetworkWriter writer, bool initialState) |
Override to do custom serialization (instead of SyncVars/SyncLists). Use OnDeserialize too. More... | |
virtual void | OnDeserialize (NetworkReader reader, bool initialState) |
Override to do custom deserialization (instead of SyncVars/SyncLists). Use OnSerialize too. More... | |
bool | SerializeObjectsAll (NetworkWriter writer) |
bool | SerializeObjectsDelta (NetworkWriter writer) |
virtual void | OnStartServer () |
Like Start(), but only called on server and host. More... | |
virtual void | OnStopServer () |
Stop event, only called on server and host. More... | |
virtual void | OnStartClient () |
Like Start(), but only called on client and host. More... | |
virtual void | OnStopClient () |
Stop event, only called on client and host. More... | |
virtual void | OnStartLocalPlayer () |
Like Start(), but only called on client and host for the local player object. More... | |
virtual void | OnStopLocalPlayer () |
Stop event, but only called on client and host for the local player object. More... | |
virtual void | OnStartAuthority () |
Like Start(), but only called for objects the client has authority over. More... | |
virtual void | OnStopAuthority () |
Stop event, only called for objects the client has authority over. More... | |
Static Public Member Functions | |
static bool | SyncVarGameObjectEqual (GameObject newGameObject, uint netIdField) |
static bool | SyncVarNetworkIdentityEqual (NetworkIdentity newIdentity, uint netIdField) |
Public Attributes | |
SyncMode | syncMode = SyncMode.Observers |
sync mode for OnSerialize More... | |
float | syncInterval = 0.1f |
sync interval for OnSerialize (in seconds) More... | |
Protected Member Functions | |
bool | GetSyncVarHookGuard (ulong dirtyBit) |
void | SetSyncVarHookGuard (ulong dirtyBit, bool value) |
void | InitSyncObject (SyncObject syncObject) |
void | SendCommandInternal (string functionFullName, NetworkWriter writer, int channelId, bool requiresAuthority=true) |
void | SendRPCInternal (string functionFullName, NetworkWriter writer, int channelId, bool includeOwner) |
void | SendTargetRPCInternal (NetworkConnection conn, string functionFullName, NetworkWriter writer, int channelId) |
void | SetSyncVarGameObject (GameObject newGameObject, ref GameObject gameObjectField, ulong dirtyBit, ref uint netIdField) |
GameObject | GetSyncVarGameObject (uint netId, ref GameObject gameObjectField) |
void | SetSyncVarNetworkIdentity (NetworkIdentity newIdentity, ref NetworkIdentity identityField, ulong dirtyBit, ref uint netIdField) |
NetworkIdentity | GetSyncVarNetworkIdentity (uint netId, ref NetworkIdentity identityField) |
void | SetSyncVarNetworkBehaviour< T > (T newBehaviour, ref T behaviourField, ulong dirtyBit, ref NetworkBehaviourSyncVar syncField) |
T | GetSyncVarNetworkBehaviour< T > (NetworkBehaviourSyncVar syncNetBehaviour, ref T behaviourField) |
void | SetSyncVar< T > (T value, ref T fieldValue, ulong dirtyBit) |
virtual bool | SerializeSyncVars (NetworkWriter writer, bool initialState) |
virtual void | DeserializeSyncVars (NetworkReader reader, bool initialState) |
Static Protected Member Functions | |
static bool | SyncVarNetworkBehaviourEqual< T > (T newBehaviour, NetworkBehaviourSyncVar syncField) |
static bool | SyncVarEqual< T > (T value, ref T fieldValue) |
Protected Attributes | |
readonly List< SyncObject > | syncObjects = new List<SyncObject>() |
Properties | |
bool | isServer [get] |
True if this object is on the server and has been spawned. More... | |
bool | isClient [get] |
True if this object is on the client and has been spawned by the server. More... | |
bool | isLocalPlayer [get] |
True if this object is the the client's own local player. More... | |
bool | isServerOnly [get] |
True if this object is on the server-only, not host. More... | |
bool | isClientOnly [get] |
True if this object is on the client-only, not host. More... | |
bool | hasAuthority [get] |
True on client if that component has been assigned to the client. E.g. player, pets, henchmen. More... | |
uint | netId [get] |
The unique network Id of this object (unique at runtime). More... | |
NetworkConnection | connectionToServer [get] |
Client's network connection to the server. This is only valid for player objects on the client. More... | |
NetworkConnectionToClient | connectionToClient [get] |
Server's network connection to the client. This is only valid for player objects on the server. More... | |
NetworkIdentity | netIdentity [get, set] |
Returns the NetworkIdentity of this object More... | |
int | ComponentIndex [get, set] |
Returns the index of the component on this object More... | |
ulong | syncVarDirtyBits [get] |
Base class for networked components.
Definition at line 15 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.ClearAllDirtyBits | ( | ) |
Clears all the dirty bits that were set by SetDirtyBits()
Definition at line 137 of file NetworkBehaviour.cs.
|
protectedvirtual |
Definition at line 985 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarDeserialize< T > | ( | ref T | field, |
Action< T, T > | OnChanged, | ||
T | value | ||
) |
Definition at line 584 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarDeserialize_GameObject | ( | ref GameObject | field, |
Action< GameObject, GameObject > | OnChanged, | ||
NetworkReader | reader, | ||
ref uint | netIdField | ||
) |
Definition at line 642 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarDeserialize_NetworkBehaviour< T > | ( | ref T | field, |
Action< T, T > | OnChanged, | ||
NetworkReader | reader, | ||
ref NetworkBehaviourSyncVar | netIdField | ||
) |
T | : | NetworkBehaviour |
Definition at line 769 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarDeserialize_NetworkIdentity | ( | ref NetworkIdentity | field, |
Action< NetworkIdentity, NetworkIdentity > | OnChanged, | ||
NetworkReader | reader, | ||
ref uint | netIdField | ||
) |
Definition at line 705 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarSetter< T > | ( | T | value, |
ref T | field, | ||
ulong | dirtyBit, | ||
Action< T, T > | OnChanged | ||
) |
Definition at line 345 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarSetter_GameObject | ( | GameObject | value, |
ref GameObject | field, | ||
ulong | dirtyBit, | ||
Action< GameObject, GameObject > | OnChanged, | ||
ref uint | netIdField | ||
) |
Definition at line 372 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarSetter_NetworkBehaviour< T > | ( | T | value, |
ref T | field, | ||
ulong | dirtyBit, | ||
Action< T, T > | OnChanged, | ||
ref NetworkBehaviourSyncVar | netIdField | ||
) |
T | : | NetworkBehaviour |
Definition at line 426 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.GeneratedSyncVarSetter_NetworkIdentity | ( | NetworkIdentity | value, |
ref NetworkIdentity | field, | ||
ulong | dirtyBit, | ||
Action< NetworkIdentity, NetworkIdentity > | OnChanged, | ||
ref uint | netIdField | ||
) |
Definition at line 399 of file NetworkBehaviour.cs.
|
protected |
Definition at line 504 of file NetworkBehaviour.cs.
|
protected |
T | : | NetworkBehaviour |
Definition at line 875 of file NetworkBehaviour.cs.
|
protected |
Definition at line 812 of file NetworkBehaviour.cs.
|
protected |
Definition at line 154 of file NetworkBehaviour.cs.
bool Mirror.NetworkBehaviour.IsDirty | ( | ) |
Definition at line 124 of file NetworkBehaviour.cs.
|
virtual |
Override to do custom deserialization (instead of SyncVars/SyncLists). Use OnSerialize too.
Definition at line 956 of file NetworkBehaviour.cs.
|
virtual |
Override to do custom serialization (instead of SyncVars/SyncLists). Use OnDeserialize too.
Definition at line 946 of file NetworkBehaviour.cs.
|
virtual |
Like Start(), but only called for objects the client has authority over.
Definition at line 1077 of file NetworkBehaviour.cs.
|
virtual |
Like Start(), but only called on client and host.
Definition at line 1065 of file NetworkBehaviour.cs.
|
virtual |
Like Start(), but only called on client and host for the local player object.
Definition at line 1071 of file NetworkBehaviour.cs.
|
virtual |
Like Start(), but only called on server and host.
Definition at line 1059 of file NetworkBehaviour.cs.
|
virtual |
Stop event, only called for objects the client has authority over.
Definition at line 1080 of file NetworkBehaviour.cs.
|
virtual |
Stop event, only called on client and host.
Definition at line 1068 of file NetworkBehaviour.cs.
|
virtual |
Stop event, but only called on client and host for the local player object.
Definition at line 1074 of file NetworkBehaviour.cs.
|
virtual |
Stop event, only called on server and host.
Definition at line 1062 of file NetworkBehaviour.cs.
|
protected |
Definition at line 179 of file NetworkBehaviour.cs.
|
protected |
Definition at line 240 of file NetworkBehaviour.cs.
|
protected |
Definition at line 271 of file NetworkBehaviour.cs.
bool Mirror.NetworkBehaviour.SerializeObjectsAll | ( | NetworkWriter | writer | ) |
Definition at line 996 of file NetworkBehaviour.cs.
bool Mirror.NetworkBehaviour.SerializeObjectsDelta | ( | NetworkWriter | writer | ) |
Definition at line 1008 of file NetworkBehaviour.cs.
|
protectedvirtual |
Definition at line 971 of file NetworkBehaviour.cs.
|
protected |
Definition at line 933 of file NetworkBehaviour.cs.
void Mirror.NetworkBehaviour.SetSyncVarDirtyBit | ( | ulong | dirtyBit | ) |
Set as dirty so that it's synced to clients again.
Definition at line 118 of file NetworkBehaviour.cs.
|
protected |
Definition at line 476 of file NetworkBehaviour.cs.
|
protected |
Definition at line 106 of file NetworkBehaviour.cs.
|
protected |
T | : | NetworkBehaviour |
Definition at line 846 of file NetworkBehaviour.cs.
|
protected |
Definition at line 788 of file NetworkBehaviour.cs.
|
staticprotected |
Definition at line 923 of file NetworkBehaviour.cs.
|
static |
Definition at line 455 of file NetworkBehaviour.cs.
|
staticprotected |
T | : | NetworkBehaviour |
Definition at line 826 of file NetworkBehaviour.cs.
|
static |
Definition at line 523 of file NetworkBehaviour.cs.
float Mirror.NetworkBehaviour.syncInterval = 0.1f |
sync interval for OnSerialize (in seconds)
Definition at line 27 of file NetworkBehaviour.cs.
SyncMode Mirror.NetworkBehaviour.syncMode = SyncMode.Observers |
sync mode for OnSerialize
Definition at line 20 of file NetworkBehaviour.cs.
|
protected |
Definition at line 61 of file NetworkBehaviour.cs.
|
getset |
Returns the index of the component on this object
Definition at line 74 of file NetworkBehaviour.cs.
|
get |
Server's network connection to the client. This is only valid for player objects on the server.
Definition at line 58 of file NetworkBehaviour.cs.
|
get |
Client's network connection to the server. This is only valid for player objects on the client.
Definition at line 55 of file NetworkBehaviour.cs.
|
get |
True on client if that component has been assigned to the client. E.g. player, pets, henchmen.
Definition at line 48 of file NetworkBehaviour.cs.
|
get |
True if this object is on the client and has been spawned by the server.
Definition at line 36 of file NetworkBehaviour.cs.
|
get |
True if this object is on the client-only, not host.
Definition at line 45 of file NetworkBehaviour.cs.
|
get |
True if this object is the the client's own local player.
Definition at line 39 of file NetworkBehaviour.cs.
|
get |
True if this object is on the server and has been spawned.
Definition at line 33 of file NetworkBehaviour.cs.
|
get |
True if this object is on the server-only, not host.
Definition at line 42 of file NetworkBehaviour.cs.
|
get |
The unique network Id of this object (unique at runtime).
Definition at line 51 of file NetworkBehaviour.cs.
|
getset |
Returns the NetworkIdentity of this object
Definition at line 71 of file NetworkBehaviour.cs.
|
getprotected |
Definition at line 88 of file NetworkBehaviour.cs.