LambdaHack-0.2.14: A roguelike game engine in early development

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.ProtocolServer

Contents

Description

The server definitions for the server-client communication protocol.

Synopsis

The communication channels

data ChanServer resp req Source

Connection channel between the server and a single client.

Constructors

ChanServer 

Fields

responseS :: !(TQueue resp)
 
requestS :: !(TQueue req)
 

type ConnServerDict = EnumMap FactionId ConnServerFaction 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.

Protocol

Assorted

updateConn :: (MonadAtomic m, MonadServerReadRequest m) => (FactionId -> ChanServer ResponseUI RequestUI -> IO ()) -> (FactionId -> ChanServer ResponseAI RequestAI -> 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.