Functions that connect the client code to the server.
Make a client connection to a proxy server.
No WebSocket connection will be used to send messages.
Simulate a round-trip through the message encoder, decoder, and message processor.
Returns a function that takes a request message, encodes it, decodes it, processes it into a response, encodes and decodes that, then returns the result.
Usually passed as the first arg to makeProxyServer.
Return a Cmd to send a message through a server interface.
Return the server URL from inside a ServerInterface.
Check that the passed GameId is in the ServerState's game dict.
If it is, return the gamestate. Otherwise wrap the message in an ErrorRsp.
Check that the passed GameId is in the ServerState's game dict and that it satisifed the ModeChecker.
If it does, return the gamestate. Otherwise wrap the message in an ErrorRsp.
Check that the passed PlayerId is in the ServerState's player dict.
If it is, return the PlayerInfo record for the player.
Otherwise wrap the message in an ErrorRsp.
"<gameid>"
Add a game to a ServerState.
Add a player to a ServerState.
Remove a game from a ServerState
Remove a player from a ServerState
Push a PublicGame onto a list of them.
Remove the PublicGame with the given GameId from a list of games.
Create the ErrorRsp record returned in the errors from CheckOnlyGameid, checkGameid, and checkPlayerid.
Make a client connection to a real WebSocket server.
The
msgwill usually be a no-operation message. It is only used to fill a slot in the returnedServerInterface. That slot is only used by the proxy server.