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:
|
||||
/// </description></listheader>
|
||||
///
|
||||
/// <item>
|
||||
/// <item><description>
|
||||
/// Each NetworkBehaviour has a dirty mask. This mask is available inside OnSerialize as syncVarDirtyBits
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// Each SyncVar in a NetworkBehaviour script is assigned a bit in the dirty mask.
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// Changing the value of SyncVars causes the bit for that SyncVar to be set in the dirty mask
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// Alternatively, calling SetDirtyBit() writes directly to the dirty mask
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// NetworkIdentity objects are checked on the server as part of it's update loop
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// If any NetworkBehaviours on a NetworkIdentity are dirty, then an UpdateVars packet is created for that object
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// The UpdateVars packet is populated by calling OnSerialize on each NetworkBehaviour on the object
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// NetworkBehaviours that are NOT dirty write a zero to the packet for their dirty bits
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// NetworkBehaviours that are dirty write their dirty mask, then the values for the SyncVars that have changed
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// 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.
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// The UpdateVars packet is sent to ready clients that are observing the object
|
||||
/// </item>
|
||||
/// </description></item>
|
||||
/// </list>
|
||||
///
|
||||
/// <list type="bullet">
|
||||
/// <listheader><description>
|
||||
/// On the client:
|
||||
/// </description></listheader>
|
||||
/// <item>
|
||||
/// <item><description>
|
||||
/// an UpdateVars packet is received for an object
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// The OnDeserialize function is called for each NetworkBehaviour script on the object
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// Each NetworkBehaviour script on the object reads a dirty mask.
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// If the dirty mask for a NetworkBehaviour is zero, the OnDeserialize functions returns without reading any more
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></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
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// If there are SyncVar hook functions, those are invoked with the value read from the stream.
|
||||
/// </item>
|
||||
/// </description></item>
|
||||
/// </list>
|
||||
/// </remarks>
|
||||
[DisallowMultipleComponent]
|
||||
@ -272,18 +272,18 @@ public NetworkVisibility visibility
|
||||
/// The AssetId trick:
|
||||
/// </description></description>listheader>
|
||||
/// <list type="bullet">
|
||||
/// <item>
|
||||
/// <item><description>
|
||||
/// Ideally we would have a serialized 'Guid m_AssetId' but Unity can't
|
||||
/// serialize it because Guid's internal bytes are private
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// UNET used 'NetworkHash128' originally, with byte0, ..., byte16
|
||||
/// which works, but it just unnecessary extra code
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// </description></item>
|
||||
/// <item><description>
|
||||
/// 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
|
||||
/// </item>
|
||||
/// </description></item>
|
||||
/// </list>
|
||||
/// The solution is to serialize the string internally here and then
|
||||
/// use the real 'Guid' type for everything else via .assetId
|
||||
|
Loading…
Reference in New Issue
Block a user