Fixed desync issue for PacMan moves
This commit is contained in:
@@ -46,11 +46,11 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
|
||||
DiscardCapture();
|
||||
}
|
||||
|
||||
Debug.Log($"ownerTime: {ownerTime}, remoteTime: {remoteTime}, ownerIndex: {ownerIndex} ({captureTimes[ownerIndex]}), remoteIndex: {remoteIndex} ({captureTimes[remoteIndex]})");
|
||||
//Debug.Log($"ownerTime: {ownerTime}, remoteTime: {remoteTime}, ownerIndex: {ownerIndex} ({captureTimes[ownerIndex]}), remoteIndex: {remoteIndex} ({captureTimes[remoteIndex]})");
|
||||
|
||||
if (captureTimes[remoteIndex] == remoteTime)
|
||||
{
|
||||
bool equal = IsEqual(remoteIndex);
|
||||
bool equal = IsEqual(remoteIndex, remoteTime);
|
||||
SetIndicator(equal);
|
||||
|
||||
DiscardCapture();
|
||||
@@ -63,7 +63,7 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
|
||||
IncrementIndex(ref remoteIndex);
|
||||
}
|
||||
|
||||
private bool IsEqual(int index)
|
||||
private bool IsEqual(int index, int time)
|
||||
{
|
||||
var equal = true;
|
||||
|
||||
@@ -79,7 +79,7 @@ public class NetworkManagerSyncTester : UdonSharpBehaviour
|
||||
|
||||
if (gridMover1Position != gridMover2Position)
|
||||
{
|
||||
Debug.LogWarning($"{nameof(NetworkManagerSyncTester)} Desync found:\n{gridMover1.name} {gridMover1Position} != {gridMover2.name} {gridMover2Position}");
|
||||
Debug.LogWarning($"{nameof(NetworkManagerSyncTester)} Desync found at {time} in {gridMover1.name}:\n {gridMover1Position} (local) != {gridMover2Position} (remote)");
|
||||
//networkManager1.Pause();
|
||||
//networkManager2.Pause();
|
||||
equal = false;
|
||||
|
||||
Reference in New Issue
Block a user