diff --git a/internal/gameserver/handlers_scene.go b/internal/gameserver/handlers_scene.go index e383b21..accab4d 100644 --- a/internal/gameserver/handlers_scene.go +++ b/internal/gameserver/handlers_scene.go @@ -842,11 +842,14 @@ func loadScene(s *Session, entryID uint32, isEnterScene bool, teleportID *uint32 sceneInfo.EntityGroupList = append(sceneInfo.EntityGroupList, playerGroup) if isEnterScene { + // in-memory only: the scene is persisted by SceneEntityMove once the + // client actually moves. Saving here would brick the save when the + // client cannot load the destination (e.g. entry 100000304) - every + // login would then NRE in AdventurePhase on the same broken scene. player.Scene.EntryID = entryID player.Scene.FloorID = floorID player.Scene.PlaneID = planeID player.Position = jsonPos - player.SavePersistent() if err := s.Send(&goproto.EnterSceneByServerScNotify{ Scene: sceneInfo, diff --git a/persistent b/persistent index 96b5765..a3ff9ea 100644 --- a/persistent +++ b/persistent @@ -6,15 +6,15 @@ "3": 1004 }, "position": { - "x": 5379, - "y": 0, - "z": -2300, - "rot_y": 54387 + "x": -92, + "y": 4278, + "z": 68083, + "rot_y": 155566 }, "scene": { - "plane_id": 10000, - "floor_id": 10000000, - "entry_id": 100000304 + "plane_id": 10202, + "floor_id": 10202001, + "entry_id": 102020107 }, "main_character": "FemaleHarmony", "march_type": "MarchHunt", diff --git a/tools/AI TOOLBOX/memory/2026-10-07.md b/tools/AI TOOLBOX/memory/2026-10-07.md index e5c5049..448421c 100644 --- a/tools/AI TOOLBOX/memory/2026-10-07.md +++ b/tools/AI TOOLBOX/memory/2026-10-07.md @@ -94,3 +94,20 @@ map-rotation mode ด้วย state ว่าง → พังตอน init **Repo:** push ไปที่ https://github.com/CAtlas0784/GaC-hkrpg-GO.git แล้ว (main @ 29b16b5) + สร้าง branch `Test` และใช้ branch นี้ต่อ (ตามคำสั่ง user) + +## รอบ 5 (02:32 session — ค้างหน้าโหลดหมุนๆ + รูปหน้าจอ train window) + +**ประเด็นสำคัญที่เกือบหลอก:** ตารางเทียบ 4 session พบว่า 01:38 (exe 01:19) เดินได้ 466 moves +ทั้งที่ตอบ 4190/6827 ครบ — แสดงว่า MapRotation ไม่ใช่ตัวการหลัก + +**ต้นเหตุจริง:** user วาปไป entry **100000304** ตอน 01:59 (client เสนอเองในแมพ แต่โหลดไม่ได้ +จริง → NRE ที่ AdventurePhase.InitializeMapInfo) และ server **save ฉากพังนั้นทันที** +→ ทุก login หลังจากนั้นโหลดแมพพังซ้ำ (1418 หด 1998→1671 = คนละฉาก) + +**แก้ 2 ชั้น:** +1. รีเซ็ต persistent กลับ entry 102020107 (แมพที่พิสูจน์แล้วว่าเดินได้ใน session 01:00/01:38) +2. **save-on-move**: loadScene(isEnterScene) แก้แค่ in-memory — persistent จะถูกเซฟโดย + SceneEntityMove (ทุก 5 วิ) เมื่อ client เดินได้จริงเท่านั้น → แมพพังไม่มีวัน brick save + (บังเอิญ arena-guard เดิมช่วยด้วย: ฉาก arena ไม่ถูกเซฟอยู่แล้ว) + +**บทเรียน:** เทียบ log ต้องดู "ฉากที่โหลด" ด้วย — 1418 ต่างกัน = คนละ entry ไม่ใช่โค้ดพัง