Fixed desync issue for PacMan moves

This commit is contained in:
2026-06-20 14:12:18 +02:00
parent a4733b33b8
commit cb975c24b2
12 changed files with 2024 additions and 2109 deletions

View File

@@ -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;