extreme-carpaccio
extreme-carpaccio copied to clipboard
Persist game state
I would like the game state to be persisted when the game server stops.
Use-cases:
- manage a server crash
- split the game on 2 different days
- manage a laptop shutdown because of low battery 😆
Every game iteration, the game state is saved into a LevelDB local database. On server startup, the game state is rebuilt from the state stored in LevelDB.
I have a pull request almost ready to submit.
WDYT?
Sounds exciting!
Here's my understanding:
Scenario: Reload existing state after stop
Given I am the facilitator I have started a session
And for some reason I had to stop the server
When I start the server again on the same machine
Then the state of the game until the moment the server was stopped should be loaded
And the game should resume from that point on
Scenario: Reload existing state after crash
Given I am the facilitator I have started a session
And for some reason the server has crashed
When I start the server again on the same machine
Then the state of the game until the moment the server crashed should be loaded
And the game should resume from that point on
And I wonder about:
Scenario: Start over after a previous session
Given I am the facilitator I have started a session
And for some reason I stopped the server
And I want to start a new session without the previous state
When <what should happen here?>
Then server should start with a clean state
That’s correct. Last scenario :
Scenario: Start over after a previous session Given I am the facilitator I have started a session And for some reason I stopped the server And I want to start a new session without the previous state When the facilitator deletes the data directory Then server should start with a clean state
That’s how it works in my branch.
Cool!
Let's just make sure we make these instructions available in the README.
That said, very excited about this feature.