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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Server

Contents

- Re-exported from Game.LambdaHack.Server.LoopM
- Re-exported from Game.LambdaHack.Server.ProtocolM
- Re-exported from Game.LambdaHack.Server.Commandline
- Re-exported from Game.LambdaHack.Server.ServerOptions

Description

Semantics of requests that are sent by clients to the server, in terms of game state changes and responses to be sent to the clients.

See https://github.com/LambdaHack/LambdaHack/wiki/Client-server-architecture.

Synopsis

- loopSer :: (MonadServerAtomic m, MonadServerComm m) => ServerOptions -> (Bool -> FactionId -> ChanServer -> IO ()) -> m ()
- data ChanServer = ChanServer {
  - responseS :: CliSerQueue Response
  - requestAIS :: CliSerQueue RequestAI
  - requestUIS :: Maybe (CliSerQueue RequestUI)
  }
- serverOptionsPI :: ParserInfo ServerOptions
- data ServerOptions = ServerOptions {
  - sknowMap :: Bool
  - sknowEvents :: Bool
  - sknowItems :: Bool
  - sniff :: Bool
  - sallClear :: Bool
  - sboostRandomItem :: Bool
  - sgameMode :: Maybe (GroupName ModeKind)
  - sautomateAll :: Bool
  - skeepAutomated :: Bool
  - sdungeonRng :: Maybe SMGen
  - smainRng :: Maybe SMGen
  - snewGameSer :: Bool
  - scurChalSer :: Challenge
  - sdumpInitRngs :: Bool
  - ssavePrefixSer :: String
  - sdbgMsgSer :: Bool
  - sassertExplored :: Maybe Int
  - sshowItemSamples :: Bool
  - sstopAfterGameOver :: Bool
  - sclientOptions :: ClientOptions
  }

# Re-exported from Game.LambdaHack.Server.LoopM

loopSer Source #

Arguments

:: (MonadServerAtomic m, MonadServerComm m) |
=> ServerOptions | player-supplied server options
-> (Bool -> FactionId -> ChanServer -> IO ()) | function that initializes a client and runs its main loop
-> m () |

Start a game session, including the clients, and then loop, communicating with the clients.

The loop is started in server state that is empty, see `emptyStateServer`.

# Re-exported from Game.LambdaHack.Server.ProtocolM

data ChanServer Source #

Connection channel between the server and a single client.

Constructors

ChanServer |

Fields

- responseS :: CliSerQueue Response
- requestAIS :: CliSerQueue RequestAI
- requestUIS :: Maybe (CliSerQueue RequestUI)

# Re-exported from Game.LambdaHack.Server.Commandline

serverOptionsPI :: ParserInfo ServerOptions Source #

Parser for server options from commandline arguments.

# Re-exported from Game.LambdaHack.Server.ServerOptions

data ServerOptions Source #

Options that affect the behaviour of the server (including game rules).

Constructors

ServerOptions |

Fields

- sknowMap :: Bool
- sknowEvents :: Bool
- sknowItems :: Bool
- sniff :: Bool
- sallClear :: Bool
- sboostRandomItem :: Bool
- sgameMode :: Maybe (GroupName ModeKind)
- sautomateAll :: Bool
- skeepAutomated :: Bool
- sdungeonRng :: Maybe SMGen
- smainRng :: Maybe SMGen
- snewGameSer :: Bool
- scurChalSer :: Challenge
- sdumpInitRngs :: Bool
- ssavePrefixSer :: String
- sdbgMsgSer :: Bool
- sassertExplored :: Maybe Int
- sshowItemSamples :: Bool
- sstopAfterGameOver :: Bool
- sclientOptions :: ClientOptions

#### Instances

Instances details

Binary ServerOptions Source # |
Instance details Defined in Game.LambdaHack.Server.ServerOptions Methods put :: ServerOptions -> Put Source # get :: Get ServerOptions Source # putList :: [ServerOptions] -> Put Source #
Show ServerOptions Source # |
Instance details Defined in Game.LambdaHack.Server.ServerOptions Methods showsPrec :: Int -> ServerOptions -> ShowS Source # show :: ServerOptions -> String Source # showList :: [ServerOptions] -> ShowS Source #