Commit Graph

39 Commits

Author SHA1 Message Date
181936e3d4 Refactor seed handling in game start logic and improve packet sending reliability 2025-12-14 23:22:34 +01:00
62db70c1c4 Refactor packet sending to use SendReliable method for improved reliability and remove unnecessary logging 2025-12-14 23:18:23 +01:00
36acbb57c5 Enhance reliability of chunk data transmission and update world seed handling on game start 2025-12-14 23:13:43 +01:00
3124f82a2f alap 2025-12-14 21:08:19 +01:00
3a7b81bfd7 save 2025-12-14 21:04:22 +01:00
c4eb7e944d Fix map synchronization between host and clients
Problem: Clients received WorldSeed packet before ServerSettings,
causing world generation with wrong mapSize/mapBias/mapRivers
parameters. Same seed but different parameters = different maps.

Solution: Include all map parameters directly in WorldSeed packet:
- WorldSize (map size)
- WorldType (map bias - continents/islands/etc)
- WorldRivers (river/lake density)

Now packet order doesn't matter - WorldSeed has everything needed
for identical world generation across all clients.

Changes:
- WorldSeed.cs: Add map parameters, set before Generate()
- ClientConnected.cs: Send full world params to joining clients
- ServerLobbyScript.cs: Send full params on new world generation
- Added [WORLD SYNC] debug logging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 21:00:15 +01:00
fc467f4af8 Fix StartGame NullReferenceException in multiplayer
Remove MainMenuMode.StartGame() reflection call that expected
"Choose Your Map" screen state. Clients never see this screen
in multiplayer, causing null references. Now transitions directly
to playing mode like save loading does.

Fixes: NullReferenceException at MainMenuMode.StartGame()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 20:52:44 +01:00
b0f790cb6e Fix 3 critical bugs: server shutdown, building placement crashes
Fixed issues:
1. Server now stops when host returns to menu (Main.cs:342-356)
   - Notifies clients with "Host disconnected" modal
   - Prevents server from running in background

2. PlayerAddBuildingHook NullReferenceException (Main.cs:762-806)
   - Added comprehensive null checks for reflection fields
   - Added array bounds validation for landMass index
   - Added registry initialization checks
   - Fixes 98% building placement failure rate

3. IndexOutOfRangeException in WorldPlace (WorldPlace.cs:167-183)
   - LandMassNames array auto-expands when needed
   - Defensive code prevents index out of bounds errors

Updated README.md:
- Removed fixed issues from bug tracker
- Added "Fixed Issues" section documenting changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 20:06:53 +01:00
c4e25f6c12 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>
2025-12-14 15:35:57 +01:00
6b014c72db Fix building materials and road/aqueduct rotation for remote players
Add UpdateMaterialSelection() and UpdateRotation() calls after building
placement to fix visual issues when host views client's buildings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:27:41 +01:00
dca0140aab Improve multiplayer sync stability 2025-12-14 14:51:46 +01:00
b05c3415f2 codex talán fixálta idk 2025-12-14 13:09:32 +01:00
8f3d83e807 Fix: Compile errors - variable naming and missing using
- Rename lambda variable 'v' to 'w' to avoid conflict with local 'v'
- Rename local Villager 'v' to 'newVillager' for clarity
- Add missing 'using Assets.Interface' for IResourceStorage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 11:02:01 +01:00
eab7931f52 Fix: Add position sync for villagers and duplicate check
- Add position property to AddVillagerPacket
- Teleport villager to correct position on client
- Add duplicate guid check to prevent double villager creation
- Send position from Main.cs hook

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 10:52:39 +01:00
7d6c915b49 Fix: Prevent duplicate building placement via guid check
- Check if building with same guid already exists before placing
- Prevents buildings overlapping from network packet retries
- Logs skip when duplicate detected

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 10:51:53 +01:00
f03e13236f asd 2025-12-14 01:45:02 +01:00
60d509344c fix? 2025-12-14 01:42:22 +01:00
224ba3f912 Merge branch 'main' of https://git.devbeni.lol/devbeni/K-C-Multiplayer 2025-12-14 01:19:31 +01:00
634a5f7983 sex 2025-12-14 00:42:03 +01:00
77f4d4fed0 talán???? 2025-12-14 00:34:42 +01:00
8edea198cd most elvileg el indul és javítottuk ezueket a szarokat. 2025-12-13 23:09:07 +01:00
f82ae76a3e talán fix geic végre big-pickle 2025-12-13 23:03:10 +01:00
e636ad6e19 asd 2025-12-13 20:57:23 +01:00
a2d87106ba talán 2025-12-13 20:21:25 +01:00
f45402af9a fix 2 2025-12-13 19:42:49 +01:00
0776da883f BIG FIX XD 2025-12-13 19:12:53 +01:00
7fc86a804a syx 2025-12-13 18:35:44 +01:00
c6c60a7e07 fix? 2025-12-13 17:11:00 +01:00
6e16be8646 fix? 2025-12-13 16:45:17 +01:00
cb59d5a918 network fix 2025-12-13 16:39:02 +01:00
0b16efc4be Farm és save desync feltérképezése 2025-12-13 16:01:09 +01:00
3d5ef1686a uhum aha nem tudom mi ez a szar 2025-12-13 14:33:59 +01:00
a88b3f155e client stuff fix 2025-12-13 14:31:08 +01:00
1e49828385 player list fix idk 2025-12-13 14:30:48 +01:00
6ce0df40ca lobby stuff 2025-12-13 14:30:24 +01:00
b934751afd just a little one 2025-12-13 14:29:58 +01:00
13c6527215 uhum fix 2025-12-13 14:29:47 +01:00
f199bbde65 a nother one 2025-12-13 14:29:35 +01:00
679c3c9a52 first commit 2025-12-13 14:28:35 +01:00