LambdaHack- A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe HaskellNone




The server definitions for the server-client communication protocol.


The communication channels

type ConnServerDict = EnumMap FactionId ChanServer Source #

Connection information for all factions, indexed by faction identifier.

data ChanServer Source #

Connection channel between the server and a single client.

The server-client communication monad

class MonadServer m => MonadServerComm m where Source #

The server monad with the ability to communicate with clients.


getsDict :: (ConnServerDict -> a) -> m a Source #

modifyDict :: (ConnServerDict -> ConnServerDict) -> m () Source #

liftIO :: IO a -> m a Source #


sendUpdate :: (MonadServerAtomic m, MonadServerComm m) => FactionId -> UpdAtomic -> m () Source #

If the AtomicFail conditions hold, send a command to client, otherwise do nothing.

sendUpdateCheck :: (MonadServerAtomic m, MonadServerComm m) => FactionId -> UpdAtomic -> m () Source #

Send a command to client, crashing if the AtomicFail conditions don't hold when executed on the client's state.


updateConn :: (MonadServerAtomic m, MonadServerComm m) => (Bool -> FactionId -> ChanServer -> IO ()) -> m () Source #

Update connections to the new definition of factions. Connect to clients in old or newly spawned threads that read and write directly to the channels.

Internal operations