Add advanced sync logging for debugging host-client sync issues
- Add LogSync() helper method in Main.cs for consistent sync logging - Log all packet send/receive events in PacketHandler and Packet classes - Add detailed building placement logging in WorldPlace.cs (all properties, final state) - Add building state update logging in BuildingStatePacket.cs - Add building state send logging in BuildingStateManager.cs All sync logs are prefixed with [SYNC] for easy filtering. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -128,8 +128,7 @@ namespace KCM.Packets.Handlers
|
||||
|
||||
IPacket packet = DeserialisePacket(messageReceived);
|
||||
|
||||
//Main.helper.Log($"Server Received packet {Packets[id].packet.GetType().Name} from {messageReceived.FromConnection.Id}");
|
||||
|
||||
Main.LogSync($"SERVER RECV: {Packets[id].packet.GetType().Name} (id={id}) from client {messageReceived.FromConnection.Id}");
|
||||
|
||||
if (KCServer.IsRunning)
|
||||
{
|
||||
@@ -169,11 +168,9 @@ namespace KCM.Packets.Handlers
|
||||
var id = messageReceived.MessageId;
|
||||
|
||||
|
||||
//Main.helper.Log($"Client Received packet {Packets[id].packet.GetType().Name} from {messageReceived.FromConnection.Id}");
|
||||
|
||||
IPacket packet = DeserialisePacket(messageReceived);
|
||||
|
||||
//Main.helper.Log($"Client Received packet {Packets[id].packet.GetType().Name} from {packet.clientId}");
|
||||
Main.LogSync($"CLIENT RECV: {Packets[id].packet.GetType().Name} (id={id}) from client {packet.clientId}");
|
||||
|
||||
if (KCClient.client.IsConnected)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user