LambdaHack-0.2.14: A roguelike game engine in early development

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.HandleRequestServer

Description

Semantics of request. A couple of them do not take time, the rest does. Note that since the results are atomic commands, which are executed only later (on the server and some of the clients), all condition are checkd by the semantic functions in the context of the state before the server command. Even if one or more atomic actions are already issued by the point an expression is evaluated, they do not influence the outcome of the evaluation. TODO: document

Synopsis

Documentation

handleRequestAI :: (MonadAtomic m, MonadServer m) => FactionId -> ActorId -> RequestAI -> m ActorId Source

The semantics of server commands. The resulting actor id is of the actor that carried out the request.

handleRequestUI :: (MonadAtomic m, MonadServer m) => FactionId -> RequestUI -> m (Maybe ActorId) Source

The semantics of server commands. The resulting actor id is of the actor that carried out the request. Nothing means the command took no time.

reqMove :: (MonadAtomic m, MonadServer m) => ActorId -> Vector -> m () Source

Actor moves or attacks. Note that client may not be able to see an invisible monster so it's the server that determines if melee took place, etc. Also, only the server is authorized to check if a move is legal and it needs full context for that, e.g., the initial actor position to check if melee attack does not try to reach to a distant tile.