Safe Haskell | None |
---|---|
Language | Haskell2010 |
Semantics of responses sent by the server to clients.
Synopsis
- class MonadClient m => MonadClientWriteRequest m where
- class MonadClient m => MonadClientAtomic m where
- handleResponse :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientWriteRequest m) => Response -> m ()
Documentation
class MonadClient m => MonadClientWriteRequest m where Source #
Client monad in which one can send requests to the client.
sendRequestAI :: RequestAI -> m () Source #
sendRequestUI :: RequestUI -> m () Source #
clientHasUI :: m Bool Source #
class MonadClient m => MonadClientAtomic m where Source #
Monad for executing atomic game state transformations on a client.
execUpdAtomic :: UpdAtomic -> m () Source #
Execute an atomic update that changes the client's State
.
execPutState :: State -> m () Source #
Put state that is intended to be the result of performing
an atomic update by the server on its copy of the client's State
.
handleResponse :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientWriteRequest m) => Response -> m () Source #
Handle server responses.
Note that for clients communicating with the server over the net,
RespUpdAtomicNoState
should be used, because executing a single command
is cheaper than sending the whole state over the net.
However, for the standalone exe mode, with clients in the same process
as the server, a pointer to the state set with execPutState
is cheaper.