Replaced fullsyncforced with reset
This commit is contained in:
+327
-279
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 42
|
||||
Data: 43
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -967,10 +967,64 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: hasFullSyncReady
|
||||
Data: lastResetEventData
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: lastResetEventData
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 54|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Byte[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 54
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: hasFullSyncReady
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: hasFullSyncReady
|
||||
@@ -994,7 +1048,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1018,7 +1072,7 @@ MonoBehaviour:
|
||||
Data: serializationRequested
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: serializationRequested
|
||||
@@ -1040,60 +1094,6 @@ MonoBehaviour:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsToSendEarly
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsToSendEarly
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 58|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.NetworkEventType[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 35
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
@@ -1117,64 +1117,22 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsToSendEarlyIndex
|
||||
Data: eventsToSendEarly
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsToSendEarlyIndex
|
||||
Data: eventsToSendEarly
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
Data: 61|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsToSendLate
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsToSendLate
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 58
|
||||
Data: Marro.PacManUdon.NetworkEventType[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 35
|
||||
@@ -1192,7 +1150,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1213,13 +1171,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsToSendLateIndex
|
||||
Data: eventsToSendEarlyIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsToSendLateIndex
|
||||
Data: eventsToSendEarlyIndex
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
@@ -1240,7 +1198,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1261,25 +1219,67 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsQueue
|
||||
Data: eventsToSendLate
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsQueue
|
||||
Data: eventsToSendLate
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 61
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 35
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: 67|System.RuntimeType, mscorlib
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Byte[][], mscorlib
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsToSendLateIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsToSendLateIndex
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 32
|
||||
Data: 11
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1315,10 +1315,64 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsQueueIndex
|
||||
Data: eventsQueue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsQueue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 70|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Byte[][], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 32
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 71|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: eventsQueueIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsQueueIndex
|
||||
@@ -1342,7 +1396,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 70|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1366,7 +1420,7 @@ MonoBehaviour:
|
||||
Data: eventsQueueIndexAtLastTransmission
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventsQueueIndexAtLastTransmission
|
||||
@@ -1390,7 +1444,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 75|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1414,7 +1468,7 @@ MonoBehaviour:
|
||||
Data: eventTransmissionHistory
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventTransmissionHistory
|
||||
@@ -1438,7 +1492,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1462,7 +1516,7 @@ MonoBehaviour:
|
||||
Data: eventTransmissionHistoryIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 78|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: eventTransmissionHistoryIndex
|
||||
@@ -1486,7 +1540,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 76|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 79|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1510,7 +1564,7 @@ MonoBehaviour:
|
||||
Data: lastEventTransmissionTime
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 80|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: lastEventTransmissionTime
|
||||
@@ -1532,60 +1586,6 @@ MonoBehaviour:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 78|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: lastEventId
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: lastEventId
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 80|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Byte, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 80
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 81|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
@@ -1609,19 +1609,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: networkedData
|
||||
Data: lastEventId
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 82|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: networkedData
|
||||
Data: lastEventId
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 83|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Byte[], mscorlib
|
||||
Data: System.Byte, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1631,60 +1631,6 @@ MonoBehaviour:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 3
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 84|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 85|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: ready
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: ready
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
@@ -1696,7 +1642,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 87|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 84|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1717,13 +1663,67 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: synced
|
||||
Data: networkedData
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 85|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: networkedData
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 54
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 54
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 3
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 86|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 87|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: ready
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 88|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: synced
|
||||
Data: ready
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
@@ -1765,19 +1765,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: <SyncedTimeTicks>k__BackingField
|
||||
Data: synced
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 90|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: <SyncedTimeTicks>k__BackingField
|
||||
Data: synced
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
Data: 28
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
Data: 28
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1813,19 +1813,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: <SyncedTime>k__BackingField
|
||||
Data: <SyncedTimeTicks>k__BackingField
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 92|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: <SyncedTime>k__BackingField
|
||||
Data: <SyncedTimeTicks>k__BackingField
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 24
|
||||
Data: 11
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 24
|
||||
Data: 11
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1861,19 +1861,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: <IsEventUpdate>k__BackingField
|
||||
Data: <SyncedTime>k__BackingField
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 94|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: <IsEventUpdate>k__BackingField
|
||||
Data: <SyncedTime>k__BackingField
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
Data: 24
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
Data: 24
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1909,13 +1909,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: isOwner
|
||||
Data: <IsEventUpdate>k__BackingField
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 96|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: isOwner
|
||||
Data: <IsEventUpdate>k__BackingField
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
@@ -1957,16 +1957,64 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: debugOutput
|
||||
Data: isOwner
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 98|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: isOwner
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 99|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: debugOutput
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 100|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: debugOutput
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 99|System.RuntimeType, mscorlib
|
||||
Data: 101|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: TMPro.TMP_InputField, Unity.TextMeshPro
|
||||
@@ -1975,7 +2023,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 99
|
||||
Data: 101
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1990,14 +2038,14 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 100|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
Data: 102|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 101|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
Data: 103|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -2021,13 +2069,13 @@ MonoBehaviour:
|
||||
Data: DebugImageToIndicateOwner
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 102|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 104|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: DebugImageToIndicateOwner
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 103|System.RuntimeType, mscorlib
|
||||
Data: 105|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Animator, UnityEngine.AnimationModule
|
||||
@@ -2036,7 +2084,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 103
|
||||
Data: 105
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -2051,14 +2099,14 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 104|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
Data: 106|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 105|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
Data: 107|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -2082,16 +2130,16 @@ MonoBehaviour:
|
||||
Data: DebugImageToIndicateSynced
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 106|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 108|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: DebugImageToIndicateSynced
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 103
|
||||
Data: 105
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 103
|
||||
Data: 105
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -2106,14 +2154,14 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 107|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
Data: 109|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 108|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
Data: 110|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -2137,16 +2185,16 @@ MonoBehaviour:
|
||||
Data: DebugImageToIndicateReady
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 109|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 111|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: DebugImageToIndicateReady
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 103
|
||||
Data: 105
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 103
|
||||
Data: 105
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -2161,14 +2209,14 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 110|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
Data: 112|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 111|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
Data: 113|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -2192,13 +2240,13 @@ MonoBehaviour:
|
||||
Data: tester
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 112|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 114|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: tester
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 113|System.RuntimeType, mscorlib
|
||||
Data: 115|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: NetworkManagerTester, Assembly-CSharp
|
||||
@@ -2222,7 +2270,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 114|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
Data: 116|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
public enum NetworkEventType
|
||||
{
|
||||
FullSyncForced = 0,
|
||||
FullSync = 1,
|
||||
InputChange = 2,
|
||||
StartGameButtonPressed = 3,
|
||||
@@ -102,6 +101,9 @@ namespace Marro.PacManUdon
|
||||
/// The total length of the header of an event, in bytes.
|
||||
/// </summary>
|
||||
private const ushort HeaderLength = 8;
|
||||
|
||||
private const ushort GuidSize = 16;
|
||||
private const ushort ResetEventSize = HeaderTimestampIndex + GuidSize;
|
||||
#endregion
|
||||
|
||||
#region Private attributes
|
||||
@@ -155,6 +157,8 @@ namespace Marro.PacManUdon
|
||||
/// </summary>
|
||||
private int retriesWithoutSuccess;
|
||||
|
||||
private byte[] lastResetEventData;
|
||||
|
||||
/// <summary>
|
||||
/// For receiver: True if there's a full sync in the queue and we are not synced, otherwise false.
|
||||
/// For transmitter: True if there's a full sync in the queue which has not yet been transmitted, otherwise false.
|
||||
@@ -302,22 +306,13 @@ namespace Marro.PacManUdon
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
if (initialized)
|
||||
{
|
||||
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Tried to call {nameof(Initialize)} when already initialized!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!BitConverter.IsLittleEndian)
|
||||
{
|
||||
Debug.LogError($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Fatal: NetworkManager only supports little endian! Network sync will not be possible.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (root == null)
|
||||
{
|
||||
root = transform.parent.gameObject;
|
||||
}
|
||||
|
||||
InitializeSubscribers();
|
||||
|
||||
@@ -341,6 +336,8 @@ namespace Marro.PacManUdon
|
||||
|
||||
networkEventSubscribers = new SyncedObject[eventTypeCount][];
|
||||
networkEventSubscribersIndices = new int[eventTypeCount];
|
||||
|
||||
lastResetEventData = new byte[ResetEventSize];
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
@@ -362,7 +359,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
ClearBuffer();
|
||||
|
||||
Synced = IsOwner; // Owner is always synced
|
||||
retriesWithoutSuccess = 0;
|
||||
|
||||
targetTicks = 0;
|
||||
@@ -375,7 +371,12 @@ namespace Marro.PacManUdon
|
||||
// Sync up
|
||||
if (!IsOwner)
|
||||
{
|
||||
RequestEvent(NetworkEventType.FullSync);
|
||||
SetSynced(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Synced = true; // Owner is always synced
|
||||
SendReset();
|
||||
}
|
||||
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized");
|
||||
@@ -459,15 +460,13 @@ namespace Marro.PacManUdon
|
||||
ClearBuffer();
|
||||
}
|
||||
|
||||
Synced = false;
|
||||
|
||||
if (!IsOwner)
|
||||
{
|
||||
RequestEvent(NetworkEventType.FullSync);
|
||||
SetSynced(false);
|
||||
}
|
||||
else
|
||||
else if (clearBuffer)
|
||||
{
|
||||
SendEventSoon(NetworkEventType.FullSyncForced);
|
||||
SendReset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,7 +516,7 @@ namespace Marro.PacManUdon
|
||||
if (eventsToSendEarlyIndex >= eventsToSendEarly.Length)
|
||||
{
|
||||
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSendEarly)} overflow!");
|
||||
HandleError(false);
|
||||
HandleError(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -528,14 +527,14 @@ namespace Marro.PacManUdon
|
||||
if (eventsToSendLateIndex >= eventsToSendLate.Length)
|
||||
{
|
||||
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(eventsToSendLate)} overflow!");
|
||||
HandleError(false);
|
||||
HandleError(true);
|
||||
return;
|
||||
}
|
||||
|
||||
eventsToSendLate[eventsToSendLateIndex++] = eventType;
|
||||
}
|
||||
|
||||
if (IsFullSync(eventType))
|
||||
if (eventType == NetworkEventType.FullSync)
|
||||
{
|
||||
hasFullSyncReady = true;
|
||||
}
|
||||
@@ -582,15 +581,13 @@ namespace Marro.PacManUdon
|
||||
|
||||
InitializeEvent(eventType, timestamp, eventId, out byte[] data, out var index);
|
||||
|
||||
var effectiveEventType = eventType == NetworkEventType.FullSyncForced ? NetworkEventType.FullSync : eventType;
|
||||
|
||||
var subscibers = GetEventSubscribers(effectiveEventType);
|
||||
var subscibers = GetEventSubscribers(eventType);
|
||||
|
||||
if (subscibers != null)
|
||||
{
|
||||
foreach (var obj in subscibers)
|
||||
{
|
||||
obj.CollectSyncedData(data, ref index, effectiveEventType);
|
||||
obj.CollectSyncedData(data, ref index, eventType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -623,6 +620,19 @@ namespace Marro.PacManUdon
|
||||
index = HeaderLength;
|
||||
}
|
||||
|
||||
private void SendReset()
|
||||
{
|
||||
var data = new byte[ResetEventSize];
|
||||
|
||||
var guid = Guid.NewGuid().ToByteArray();
|
||||
Array.Copy(guid, 0, data, HeaderTimestampIndex, GuidSize);
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Sent Reset event!");
|
||||
|
||||
QueueEventInBuffer(data);
|
||||
RequestSerializationForEvents();
|
||||
}
|
||||
|
||||
private void RequestSerializationForEvents()
|
||||
{
|
||||
RequestSerialization();
|
||||
@@ -641,17 +651,12 @@ namespace Marro.PacManUdon
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsFullSync(eventType) && hasFullSyncReady)
|
||||
if (eventType == NetworkEventType.FullSync && hasFullSyncReady)
|
||||
{
|
||||
//Debug.Log($"Rejected event request because already have full sync ready");
|
||||
return; // Don't send another full sync if we're already preparing to send one
|
||||
}
|
||||
|
||||
if (eventType == NetworkEventType.FullSyncForced)
|
||||
{
|
||||
eventType = NetworkEventType.FullSync; // Remote is not allowed to request a forced full sync
|
||||
}
|
||||
|
||||
SendEventSoon(eventType);
|
||||
}
|
||||
|
||||
@@ -762,7 +767,7 @@ namespace Marro.PacManUdon
|
||||
int eventSize = 0; // Store event size here so we can increment the index no matter how we increment the loop
|
||||
while ((index += eventSize) < length)
|
||||
{
|
||||
if (length - index < HeaderLength)
|
||||
if (length - index < HeaderLength) // Check package is at least as long as the minimum length possible. Reset package is also larger than HeaderLength.
|
||||
{
|
||||
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) {nameof(StoreIncomingData)}: Remaining data in networkedData is not long enough to form a complete event! remaining: {length - index}.");
|
||||
HandleError(false);
|
||||
@@ -770,6 +775,12 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
|
||||
eventSize = GetEventSizeFromHeader(networkedData, index);
|
||||
bool isReset = eventSize == 0;
|
||||
|
||||
if (isReset)
|
||||
{
|
||||
eventSize = ResetEventSize;
|
||||
}
|
||||
|
||||
if (length - index < eventSize)
|
||||
{
|
||||
@@ -787,11 +798,17 @@ namespace Marro.PacManUdon
|
||||
|
||||
var @event = GetArrayPart(networkedData, index, eventSize);
|
||||
|
||||
if (isReset)
|
||||
{
|
||||
TryApplyReset(@event);
|
||||
return;
|
||||
}
|
||||
|
||||
var timestamp = GetTimestampFromHeader(@event);
|
||||
var eventId = GetEventIdFromHeader(@event);
|
||||
var eventType = GetEventTypeFromHeader(@event);
|
||||
|
||||
if (eventType != NetworkEventType.FullSyncForced && (Synced || hasFullSyncReady))
|
||||
if (Synced || hasFullSyncReady)
|
||||
{
|
||||
// Check if event id is sequential
|
||||
if (eventId != GetNextEventId(lastEventId))
|
||||
@@ -821,7 +838,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
//Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)} Queued event with id {eventId}");
|
||||
}
|
||||
else if (IsFullSync(eventType)) // If we're not yet synced, we only care about full sync events.
|
||||
else if (eventType == NetworkEventType.FullSync) // If we're not yet synced, we only care about full sync events.
|
||||
{
|
||||
QueueFullSyncForReplay(@event); // Immediately process full sync
|
||||
}
|
||||
@@ -849,6 +866,47 @@ namespace Marro.PacManUdon
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Queued full sync in buffer, should execute at {nextEventTime}.");
|
||||
}
|
||||
|
||||
private void TryApplyReset(byte[] @event)
|
||||
{
|
||||
// Compare the guid to the one in the previous reset event
|
||||
if (IsDuplicateResetEvent(@event))
|
||||
{
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Rejected Reset event as it was a duplicate.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Applied Reset event!");
|
||||
|
||||
lastResetEventData = @event;
|
||||
ClearBuffer();
|
||||
SetSynced(false);
|
||||
}
|
||||
|
||||
private bool IsDuplicateResetEvent(byte[] @event)
|
||||
{
|
||||
for (int i = HeaderTimestampIndex; i < ResetEventSize; i++)
|
||||
{
|
||||
if (@event[i] != lastResetEventData[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void SetSynced(bool synced)
|
||||
{
|
||||
Synced = synced;
|
||||
|
||||
if (!Synced)
|
||||
{
|
||||
Synced = false;
|
||||
RequestEvent(NetworkEventType.FullSync);
|
||||
lastEventTransmissionTime = SyncedTimeTicks;
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyReceivedEvents()
|
||||
{
|
||||
IsEventUpdate = true;
|
||||
@@ -872,11 +930,11 @@ namespace Marro.PacManUdon
|
||||
var timestamp = GetTimestampFromHeader(@event);
|
||||
var eventType = GetEventTypeFromHeader(@event);
|
||||
|
||||
var isFullSync = IsFullSync(eventType);
|
||||
|
||||
if (!Synced || eventType == NetworkEventType.FullSyncForced)
|
||||
if (!Synced)
|
||||
{
|
||||
SyncToTimestamp(timestamp);
|
||||
hasFullSyncReady = false;
|
||||
SetSynced(true);
|
||||
}
|
||||
else if (timestamp < SyncedTimeTicks)
|
||||
{
|
||||
@@ -886,11 +944,6 @@ namespace Marro.PacManUdon
|
||||
return false;
|
||||
}
|
||||
|
||||
if (eventType == NetworkEventType.FullSyncForced)
|
||||
{
|
||||
eventType = NetworkEventType.FullSync;
|
||||
}
|
||||
|
||||
var index = (int)HeaderLength; // Skip header
|
||||
|
||||
var subscribers = GetEventSubscribers(eventType);
|
||||
@@ -920,12 +973,6 @@ namespace Marro.PacManUdon
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Synced && isFullSync)
|
||||
{
|
||||
hasFullSyncReady = false;
|
||||
Synced = true;
|
||||
}
|
||||
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes.");
|
||||
|
||||
retriesWithoutSuccess = 0; // We had success!
|
||||
@@ -1064,9 +1111,6 @@ namespace Marro.PacManUdon
|
||||
return currentEventId;
|
||||
}
|
||||
|
||||
private static bool IsFullSync(NetworkEventType eventType)
|
||||
=> eventType == NetworkEventType.FullSync || eventType == NetworkEventType.FullSyncForced;
|
||||
|
||||
private static ushort GetEventSizeFromHeader(byte[] @event, int eventIndex = 0)
|
||||
=> BitConverter.ToUInt16(@event, eventIndex + HeaderEventSizeIndex);
|
||||
|
||||
@@ -1093,7 +1137,8 @@ namespace Marro.PacManUdon
|
||||
|
||||
if (newOwnerIsLocalPlayer)
|
||||
{
|
||||
SendEventSoon(NetworkEventType.FullSyncForced);
|
||||
ClearBuffer();
|
||||
SendReset();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -1244,7 +1289,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void DoFullSync()
|
||||
{
|
||||
SendEventSoon(NetworkEventType.FullSyncForced);
|
||||
SendEventSoon(NetworkEventType.FullSync);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
|
||||
@@ -91,7 +91,7 @@ public class NetworkManagerTester : UdonSharpBehaviour
|
||||
continue;
|
||||
}
|
||||
|
||||
//Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
|
||||
Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
|
||||
|
||||
target.RequestEventReceived(eventType);
|
||||
}
|
||||
|
||||
@@ -130,8 +130,7 @@ public class TestBall : SyncedObject
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType == NetworkEventType.FullSync
|
||||
|| eventType == NetworkEventType.FullSyncForced)
|
||||
if (eventType == NetworkEventType.FullSync)
|
||||
{
|
||||
Debug.Log($"({nameof(TestBall)}) Sending sync data at progress {GetProgress()} and amountUp {amountUp}.");
|
||||
data.Append(amountUp, ref index);
|
||||
@@ -141,8 +140,7 @@ public class TestBall : SyncedObject
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType == NetworkEventType.FullSync
|
||||
|| eventType == NetworkEventType.FullSyncForced)
|
||||
if (eventType == NetworkEventType.FullSync)
|
||||
{
|
||||
amountUp = data.ReadFloat(ref index);
|
||||
SetProgress(data.ReadFloat(ref index));
|
||||
|
||||
Reference in New Issue
Block a user