Commit Graph

21 Commits

Author SHA1 Message Date
1cc3042781 feat: Implement various multiplayer stability and synchronization fixes
This commit addresses several critical issues reported by the user to improve the stability and synchronization of the Kingdoms and Castles multiplayer mod.

Key changes include:

- Improved Lobby Stability: Fixed NullReferenceException during lobby entry.
- Enhanced Session Cleanup: Refined disconnection logic to prevent Steamworks shutdown and enable seamless new game starts without client restarts.
- Optimized Building Synchronization: Implemented a throttling mechanism for building state updates to reduce network traffic.
- Resolved Villager Freezing: Introduced a null check for destroyed observed buildings to prevent synchronization cascades.
- Fixed Map Desynchronization: Ensured the host reliably sends the world seed to all clients before game start.
- Reliable Save Game Transfer: Switched save file chunk transfer to reliable messaging mode to prevent incomplete save loads.
- Addressed Compilation Issues: Resolved all compilation errors and warnings that arose from the implemented fixes.
2025-12-14 23:22:57 +01:00
4057cf37c5 sex 2025-12-14 20:52:55 +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
deb0c0ad92 Document follow-up steps 2025-12-14 16:33:45 +01:00
10d20e29ad Kódban található KRITIKUS hibák részletes dokumentációja
A README-ben leírt bugok pontos helyének és okának meghatározása
a kódbázisban, javítási javaslatokkal:

DOKUMENTÁLT HIBÁK:
1. Server nem áll le menüváltáskor
   - Hely: KCServer.cs (hiányzó logika)
   - Ok: OnApplicationQuit csak app bezáráskor hívódik
   - Javítás: TransitionToHook-ban server.Stop() hívás

2. PlayerAddBuildingHook NullReferenceException (LEGKRITIKUSABB)
   - Hely: Main.cs:764
   - Ok: landMassBuildingRegistry.data[landMass] null/hibás indexelés
   - Eredmény: 55/56 épület fail (98%!)
   - Javítás: NULL check + array méret ellenőrzés

3. IndexOutOfRangeException WorldPlace-ben
   - Hely: WorldPlace.cs:167-168
   - Ok: LandMassNames tömb túl kicsi
   - Okozó: #2 hiba miatt building nem adódik hozzá → tömb nem nő
   - Javítás: Védekező kód + #2 javítása

ÖSSZEFÜGGÉSEK:
A három hiba cascade failure-t okoz: server fut menüben →
packeteket fogad → building placement fail (#2) →
IndexOutOfRange (#3) → 98% épület nem jelenik meg!

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 16:11:48 +01:00
a3409a2d5c asd 2025-12-14 16:07:35 +01:00
5b0f957295 Dokumentálva a README.md fájlban található hibák
Új szekció hozzáadva a dokumentációs hibák részletes leírásával:
- Nyelvtani hibák (hiányzó ékezetek 6 helyen)
- Strukturális hiányosságok (bevezető, útmutatók)
- Konzisztencia problémák

A hibák NEM lettek javítva, csak dokumentálva, hogy hol találhatók
és hogyan kell őket javítani. Prioritások meghatározva.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-14 16:04:41 +01:00
faaedcc0fd Update bug tracker with complete log analysis
KRITIKUS: 55/56 (98%) building placement FAILS!
- 56 BUILDING PLACEMENT START
- Only 1 BUILDING PLACEMENT END
- 55 "Error in add building hook" NullReferenceException
- 9 IndexOutOfRangeException
- 2 StartGame.Start() crashes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:00:25 +01:00
d87c12384e Update bug tracker with issues found from output.txt analysis
KRITIKUS bugs added:
- Server nem all le amikor host kilep menube
- Kliens nem lesz kidobva host kilepesekor
- Packetek erkeznek menu-ben

Building placement errors:
- PlayerAddBuildingHook NullReferenceException (~50+ occurrences)
- IndexOutOfRangeException in WorldPlace

Added log analysis timeline from 15:39-15:56 session.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:58:02 +01:00
560a985323 Add Keep placement bug to tracker
Multiple Keeps can be placed on same island, causing original player to lose their Keep.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:42:26 +01:00
490e0d74e6 Add bug tracker README with known issues and status
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:37:48 +01:00
888c807b96 nah 2025-12-14 10:50:05 +01:00
0776da883f BIG FIX XD 2025-12-13 19:12:53 +01:00
cb6fd3a727 asd 2025-12-13 19:00:55 +01:00
02af5c8c68 ok 2025-12-13 17:13:03 +01:00
6e16be8646 fix? 2025-12-13 16:45:17 +01:00
cb59d5a918 network fix 2025-12-13 16:39:02 +01:00
efa6016fe5 íyx 2025-12-13 16:08:37 +01:00
0b16efc4be Farm és save desync feltérképezése 2025-12-13 16:01:09 +01:00
91a1ab4261 oke 2025-12-13 14:52:00 +01:00
fd0ebe9014 yes 2025-12-13 14:35:45 +01:00