fix(scene): persist scene only after the client actually moves
The user's save was bricked by teleporting to entry 100000304: the client offers it in the map but NREs in AdventurePhase._EnterStep1_InitializeMapInfo while loading, and the server had already saved that scene - every login then replayed the broken scene (stuck on the train-window loading screen). - loadScene no longer calls SavePersistent; SceneEntityMove's 5s cadence persists the scene only once the client walks in it (the existing arena guard already kept challenge scenes out of the save) - reset persistent to entry 102020107 (proven walkable in the 01:00/01:38 sessions)
This commit is contained in:
1 parent
ebf313256f
commit
768baeb62a
3 files changed
+28
-8
No files matched your search
@@ -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,
|
||||
|
||||
+7
-7
@@ -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",
|
||||
|
||||
@@ -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 ไม่ใช่โค้ดพัง
|
||||
Reference in new issue
Block a user