LambdaHack-0.2.8: A roguelike game engine in early and active development

Safe HaskellNone



Saving and restoring server game state.



saveGameBkpSer :: Config -> State -> StateServer -> IO ()Source

Save game to the backup savefile, in case of crashes. This is only a backup, so no problem is the game is shut down before saving finishes, so we don't wait on the mvar. However, if a previous save is already in progress, we skip this save.

saveGameSer :: Config -> State -> StateServer -> IO ()Source

Save a simple serialized version of the current state. Protected by a lock to avoid corrupting the file.

restoreGameSer :: Config -> (FilePath -> IO FilePath) -> IO (Maybe (State, StateServer))Source

Restore a saved game, if it exists. Initialize directory structure and cope over data files, if needed.