Safe Haskell | None |
---|---|
Language | Haskell2010 |
Saving and restoring game state, used by both server and clients.
Synopsis
- type ChanSave a = MVar (Maybe a)
- saveToChan :: ChanSave a -> a -> IO ()
- wrapInSaves :: Binary a => COps -> (a -> FilePath) -> (ChanSave a -> IO ()) -> IO ()
- restoreGame :: Binary a => COps -> FilePath -> IO (Maybe a)
- saveNameCli :: COps -> FactionId -> String
- saveNameSer :: COps -> String
- loopSave :: Binary a => COps -> (a -> FilePath) -> ChanSave a -> IO ()
- vExevLib :: COps -> (Version, Version)
- showVersion2 :: (Version, Version) -> Text
- delayPrint :: Text -> IO ()
Documentation
saveToChan :: ChanSave a -> a -> IO () Source #
restoreGame :: Binary a => COps -> FilePath -> IO (Maybe a) Source #
Restore a saved game, if it exists. Initialize directory structure and copy over data files, if needed.
saveNameSer :: COps -> String Source #
Internal operations
loopSave :: Binary a => COps -> (a -> FilePath) -> ChanSave a -> IO () Source #
Repeatedly save serialized snapshots of current state.
delayPrint :: Text -> IO () Source #