fix(gameserver): stamp save blobs to prevent a periodic write rolling back a disconnect save #96
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!96
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/persistence-lost-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Code-review finding bug-1 (integrity).
The periodic snapshot captures every online player's blob (
SerializeOnlinePlayers) then writes them to the store in a later step; a disconnect that lands in between writes a fresher blob that the stale periodic write could then overwrite — silently rolling the session back on next login (PlayerStorewas last-writer-wins with no recency ordering).Stamp each blob with its capture tick (
World.CurrentTick, read on the sim thread in the sameInvokeAsyncas the serialize).PlayerStore.SaveAsyncnow drops a save whose stamp is older than the one already stored, so the later-captured blob wins regardless of the off-thread write order.Test:
PlayerStore_DropsAnOlderStampedSave— a fresh (stamp 10) save survives a subsequent stale (stamp 5) write.Definition of Done