From 5feda5b8c2765b54dec562ca048dbf0c8a5a5614 Mon Sep 17 00:00:00 2001 From: teascade Date: Sat, 8 Aug 2020 02:10:20 +0300 Subject: [PATCH] Make Unsynced reset and reordered registers --- Assets/Scripts/Networking/GameProtocol.cs | 2 +- .../Scripts/Networking/Packets/MultiplePlayerUpdatesPckt.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Networking/GameProtocol.cs b/Assets/Scripts/Networking/GameProtocol.cs index 1dc04b0..02ade33 100644 --- a/Assets/Scripts/Networking/GameProtocol.cs +++ b/Assets/Scripts/Networking/GameProtocol.cs @@ -20,10 +20,10 @@ namespace NeonTea.Quakeball.Networking { RegisterPacket(typeof(HelloPckt)); RegisterPacket(typeof(SpawnPckt)); RegisterPacket(typeof(SelfIdentPckt)); - RegisterPacket(typeof(MultiplePlayerUpdatesPckt)); RegisterPacket(typeof(PlayerUpdatePckt)); RegisterPacket(typeof(PlayerJumpPckt)); RegisterPacket(typeof(PlayerSyncPacket)); + RegisterPacket(typeof(MultiplePlayerUpdatesPckt)); RegisterPacket(typeof(MultipleSyncsPckt)); } diff --git a/Assets/Scripts/Networking/Packets/MultiplePlayerUpdatesPckt.cs b/Assets/Scripts/Networking/Packets/MultiplePlayerUpdatesPckt.cs index 587ce56..b6d5db9 100644 --- a/Assets/Scripts/Networking/Packets/MultiplePlayerUpdatesPckt.cs +++ b/Assets/Scripts/Networking/Packets/MultiplePlayerUpdatesPckt.cs @@ -48,7 +48,9 @@ namespace NeonTea.Quakeball.Networking.Packets { if (p.Controlled == null) { continue; } - Syncs.Add(p.Controlled.CreateSyncPacket(p.Id, p.Unsynced)); + PlayerSyncPacket pckt = p.Controlled.CreateSyncPacket(p.Id, p.Unsynced); + p.Unsynced = false; + Syncs.Add(pckt); } }