You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typePlayerLimitError=Error&{name: 'PlayerLimitError'message: 'Exceeded game player limit'}typeJoinRoomError=|PlayerLimitError|EventSourceReadError|EventSourceWriteError
Model
typeGameRoom={playerIds: string[];roomId: string;status: 'wait for join'|'game started';};
workflow: join roominput:
event sourcejoin room commandoutput:
async result of ok -> game roomerr -> join room errorstep:
read all events from event sourceif error occured:
return event source read errorcheckPlayerCountAgainstGameLimitif exceeded game player limit:
return player limit errorappend event to event sourceif error occured:
return event source write errorotherwise:
return game room
@JohnsonMao
I also consider that
should we add the current status of the game room, such like 'wait for join' | 'game started' ?
because I think we should not let player joined if game already started.
implement design of https://hackmd.io/KvV2Ou3HS9uN11OUpsAUzA?both#Workflow-join-room
The text was updated successfully, but these errors were encountered: