mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Updated NetworkIdentity comments
This commit is contained in:
parent
f95b0c40af
commit
0c37a4d794
@ -43,64 +43,64 @@ namespace Mirror
|
|||||||
/// The flow for serialization updates managed by the NetworkIdentity is:
|
/// The flow for serialization updates managed by the NetworkIdentity is:
|
||||||
/// </description></listheader>
|
/// </description></listheader>
|
||||||
///
|
///
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// Each NetworkBehaviour has a dirty mask. This mask is available inside OnSerialize as syncVarDirtyBits
|
/// Each NetworkBehaviour has a dirty mask. This mask is available inside OnSerialize as syncVarDirtyBits
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// Each SyncVar in a NetworkBehaviour script is assigned a bit in the dirty mask.
|
/// Each SyncVar in a NetworkBehaviour script is assigned a bit in the dirty mask.
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// Changing the value of SyncVars causes the bit for that SyncVar to be set in the dirty mask
|
/// Changing the value of SyncVars causes the bit for that SyncVar to be set in the dirty mask
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// Alternatively, calling SetDirtyBit() writes directly to the dirty mask
|
/// Alternatively, calling SetDirtyBit() writes directly to the dirty mask
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// NetworkIdentity objects are checked on the server as part of it's update loop
|
/// NetworkIdentity objects are checked on the server as part of it's update loop
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// If any NetworkBehaviours on a NetworkIdentity are dirty, then an UpdateVars packet is created for that object
|
/// If any NetworkBehaviours on a NetworkIdentity are dirty, then an UpdateVars packet is created for that object
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// The UpdateVars packet is populated by calling OnSerialize on each NetworkBehaviour on the object
|
/// The UpdateVars packet is populated by calling OnSerialize on each NetworkBehaviour on the object
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// NetworkBehaviours that are NOT dirty write a zero to the packet for their dirty bits
|
/// NetworkBehaviours that are NOT dirty write a zero to the packet for their dirty bits
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// NetworkBehaviours that are dirty write their dirty mask, then the values for the SyncVars that have changed
|
/// NetworkBehaviours that are dirty write their dirty mask, then the values for the SyncVars that have changed
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// If OnSerialize returns true for a NetworkBehaviour, the dirty mask is reset for that NetworkBehaviour,
|
/// If OnSerialize returns true for a NetworkBehaviour, the dirty mask is reset for that NetworkBehaviour,
|
||||||
/// so it will not send again until its value changes.
|
/// so it will not send again until its value changes.
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// The UpdateVars packet is sent to ready clients that are observing the object
|
/// The UpdateVars packet is sent to ready clients that are observing the object
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// </list>
|
/// </list>
|
||||||
///
|
///
|
||||||
/// <list type="bullet">
|
/// <list type="bullet">
|
||||||
/// <listheader><description>
|
/// <listheader><description>
|
||||||
/// On the client:
|
/// On the client:
|
||||||
/// </description></listheader>
|
/// </description></listheader>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// an UpdateVars packet is received for an object
|
/// an UpdateVars packet is received for an object
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// The OnDeserialize function is called for each NetworkBehaviour script on the object
|
/// The OnDeserialize function is called for each NetworkBehaviour script on the object
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// Each NetworkBehaviour script on the object reads a dirty mask.
|
/// Each NetworkBehaviour script on the object reads a dirty mask.
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// If the dirty mask for a NetworkBehaviour is zero, the OnDeserialize functions returns without reading any more
|
/// If the dirty mask for a NetworkBehaviour is zero, the OnDeserialize functions returns without reading any more
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// If the dirty mask is non-zero value, then the OnDeserialize function reads the values for the SyncVars that correspond to the dirty bits that are set
|
/// If the dirty mask is non-zero value, then the OnDeserialize function reads the values for the SyncVars that correspond to the dirty bits that are set
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// If there are SyncVar hook functions, those are invoked with the value read from the stream.
|
/// If there are SyncVar hook functions, those are invoked with the value read from the stream.
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// </list>
|
/// </list>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
@ -272,18 +272,18 @@ public NetworkVisibility visibility
|
|||||||
/// The AssetId trick:
|
/// The AssetId trick:
|
||||||
/// </description></description>listheader>
|
/// </description></description>listheader>
|
||||||
/// <list type="bullet">
|
/// <list type="bullet">
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// Ideally we would have a serialized 'Guid m_AssetId' but Unity can't
|
/// Ideally we would have a serialized 'Guid m_AssetId' but Unity can't
|
||||||
/// serialize it because Guid's internal bytes are private
|
/// serialize it because Guid's internal bytes are private
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// UNET used 'NetworkHash128' originally, with byte0, ..., byte16
|
/// UNET used 'NetworkHash128' originally, with byte0, ..., byte16
|
||||||
/// which works, but it just unnecessary extra code
|
/// which works, but it just unnecessary extra code
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// <item>
|
/// <item><description>
|
||||||
/// Using just the Guid string would work, but it's 32 chars long and
|
/// Using just the Guid string would work, but it's 32 chars long and
|
||||||
/// would then be sent over the network as 64 instead of 16 bytes
|
/// would then be sent over the network as 64 instead of 16 bytes
|
||||||
/// </item>
|
/// </description></item>
|
||||||
/// </list>
|
/// </list>
|
||||||
/// The solution is to serialize the string internally here and then
|
/// The solution is to serialize the string internally here and then
|
||||||
/// use the real 'Guid' type for everything else via .assetId
|
/// use the real 'Guid' type for everything else via .assetId
|
||||||
|
Loading…
Reference in New Issue
Block a user