Fix: Add periodic villager position sync from server

- Server syncs villager positions every ~3 seconds to clients
- Only syncs villagers that moved more than 0.5 units (bandwidth optimization)
- Maintains position cache to detect movement
- Clears cache on lobby leave to prevent stale data

🤖 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 10:58:37 +01:00
parent 8d599e13ad
commit dd17030e56
2 changed files with 60 additions and 27 deletions

View File

@@ -160,6 +160,7 @@ namespace Riptide.Demos.Steam.PlayerHosted
Main.helper.Log("clear players");
Main.kCPlayers.Clear();
Main.clientSteamIds.Clear(); // Clear client-to-steam ID mapping
Main.ClearVillagerPositionCache(); // Clear villager sync cache
LobbyHandler.ClearPlayerList();
LobbyHandler.ClearChatEntries();
Main.helper.Log("end clear players");