feat(gameserver): /save admin command to force a world snapshot (#41) #42
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!42
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/save-command"
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?
Closes #41. Stacked on #40 — review/merge that first; this PR targets the persistence branch so its diff is only the
/savework.Adds an admin
/savechat command to force an immediate world save instead of waiting for the 15s periodic snapshot.WorldPersister: gathers a snapshot of every online player and flushes it toworld.sav. Both the periodicPersistenceServiceand/savego through the same single instance, and a lock-free gate (Interlocked) skips a save requested while another is in flight — so a manual save and the periodic one never write the file at once.PersistenceServicenow delegates toWorldPersister(timer + shutdown).SaveCommand : GmCommand(/save), authorized server-side by the signedadminclaim viaCanExecute. It returns aSaveWorldresult the session handler fulfils (persistence is off theWorldfacade, like targeting), replying with aSystemMessage: saved N players / nothing to save / already in progress / failed.docs/gm-commands.mdupdated with the/saverow.Tests:
WorldPersisterTests(writes file + reload / empty world / sequential saves both persist) andCommandTests(/saveas admin returnsSaveWorld; non-admin refused). Whole suite green (GameServer 110), 0 warnings, csharpier clean.Definition of Done
/saveas admin writesworld.savimmediately and reports how many players were saved./saveis refused and writes no file./savewith no players online reports nothing to save and writes no file.WorldPersister)./saveshare one code path (WorldPersister).docs/gm-commands.mdlists/save.