LambdaHack-0.6.2.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.ProtocolM

Contents

Description

The server definitions for the server-client communication protocol.

Synopsis

The communication channels

type ConnServerDict = EnumMap FactionId ChanServer Source #

Connection information for all factions, indexed by faction identifier.

The server-client communication monad

class MonadServer m => MonadServerReadRequest m where Source #

The server monad with the ability to communicate with clients.

Minimal complete definition

getsDict, modifyDict, liftIO

Methods

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

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

liftIO :: IO a -> m a Source #

Protocol

Assorted

updateConn :: (MonadAtomic m, MonadServerReadRequest m) => Config -> (Maybe SessionUI -> 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