GenGame.ServerAuthoritative behaviour (gen_game v0.1.1)
This is a behaviour that you can implement in lib/gen_game_mod/mod.ex. Every functions in this module will be called when there are particular event in GenGame.
Summary
Callbacks
RPC is custom action. Payload from client will be passed as map to the function without modification. The function can either return a map or error with reason that will be forwarded to the client as reply.
Types
Link to this type
error_reason()
@type error_reason() :: atom()
Link to this type
socket()
@type socket() :: Phoenix.Socket.t()
Callbacks
Link to this callback
rpc(list)
@callback rpc(list()) :: {:ok, map()} | {:error, error_reason()}
RPC is custom action. Payload from client will be passed as map to the function without modification. The function can either return a map or error with reason that will be forwarded to the client as reply.
Functions
Link to this function
dispatch_event(event, payload)
Link to this function