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

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

type ConnServerDict = EnumMap FactionId ConnServerFaction Source #

Connection information for all factions, indexed by faction identifier.

The server-client communication monad

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.

Internal operations

type ConnServerFaction = (Maybe (ChanServer ResponseUI RequestUI), ChanServer ResponseAI RequestAI) Source #

Connections to the human-controlled client of a faction and to the AI client for the same faction.