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:
2025-12-14 15:35:57 +01:00
parent 6b014c72db
commit c4e25f6c12
6 changed files with 47 additions and 11 deletions

View File

@@ -26,7 +26,12 @@ namespace KCM.StateManagement.BuildingState
Building building = (Building)observer.state;
//Main.helper.Log("Should send building network update for: " + building.UniqueName);
Main.LogSync($"SENDING building state update for: {building.UniqueName} guid={building.guid}");
Main.LogSync($" position={building.transform.position}");
if (building.transform.childCount > 0)
{
Main.LogSync($" rotation={building.transform.GetChild(0).rotation} (euler={building.transform.GetChild(0).rotation.eulerAngles})");
}
new BuildingStatePacket()
{