Fixed potential issue when syncing only targeted messages
This commit is contained in:
parent
1838808860
commit
df109debf4
@ -36,7 +36,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Development|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Development|AnyCPU'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>..\..\MLAPI-Examples\Assets\MLAPI\</OutputPath>
|
<OutputPath>..\..\MLAPI-Examples\Assets\MLAPI\Lib\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
@ -744,6 +744,17 @@ namespace MLAPI.MonoBehaviours.Core
|
|||||||
InternalMessageHandler.Send(ownerClientId, "MLAPI_SYNC_VAR_UPDATE", "MLAPI_INTERNAL", stream.ToArray()); //Send only to target
|
InternalMessageHandler.Send(ownerClientId, "MLAPI_SYNC_VAR_UPDATE", "MLAPI_INTERNAL", stream.ToArray()); //Send only to target
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nonTargetDirtyCount == 0)
|
||||||
|
{
|
||||||
|
//Seems like ONLY targeted syncedVars was changed. Thus we need to remove the dirty tags and return;
|
||||||
|
for (int i = 0; i < syncedVarFields.Count; i++)
|
||||||
|
{
|
||||||
|
syncedVarFields[i].FieldValue = syncedVarFields[i].FieldInfo.GetValue(this);
|
||||||
|
syncedVarFields[i].Dirty = false;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//It's sync time. This is the NON target receivers packet.
|
//It's sync time. This is the NON target receivers packet.
|
||||||
using (MemoryStream stream = new MemoryStream())
|
using (MemoryStream stream = new MemoryStream())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user