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:
@@ -38,6 +38,7 @@ namespace KCM.Packets
|
||||
{
|
||||
try
|
||||
{
|
||||
Main.LogSync($"SEND TO ALL: {this.GetType().Name} (id={packetId}) except={exceptToClient}");
|
||||
if (exceptToClient == 0)
|
||||
{
|
||||
if (KCServer.IsRunning)
|
||||
@@ -75,6 +76,7 @@ namespace KCM.Packets
|
||||
{
|
||||
try
|
||||
{
|
||||
Main.LogSync($"SEND: {this.GetType().Name} (id={packetId}) to={toClient} myId={KCClient.client?.Id}");
|
||||
if (KCClient.client.IsConnected && toClient == 0)
|
||||
{
|
||||
this.clientId = KCClient.client.Id;
|
||||
|
||||
Reference in New Issue
Block a user