0.4.18 • Published 6 years ago
@mgonnet/umpire v0.4.18
@mgonnet/umpire
Sequence Diagrams
User Connection to Umpire Server

Lobby creation

Listening Message types
| Message | Message data | Response type | Response data |
|---|---|---|---|
| REGISTER | {name: 'pepe'} | REGISTER-ACCEPTED | |
| REGISTER-REJECTED | |||
| REGISTER-REJECTED | { reason: 'User already registered' } | ||
| LEAVE-SERVER | LEAVE-SERVER-ACCEPTED | ||
| CREATE-LOBBY | {name: 'lobby'} | CREATE-LOBBY-REJECTED | { reason: 'User already in lobby' } |
| CREATE-LOBBY-REJECTED | { reason: 'Lobby name already exists' } | ||
| CREATE-LOBBY-ACCEPTED | { players: { name: 'useloom'}, creator: 'useloom' } | ||
| CREATE-LOBBY-REJECTED | { reason: 'Player is not registered' } | ||
| CLOSE-LOBBY | CLOSE-LOBBY-REJECTED | { reason: 'Player is not the lobby creator' } | |
| CLOSE-LOBBY-REJECTED | { reason: 'User is not in a lobby' } | ||
| CLOSE-LOBBY-ACCEPTED | |||
| JOIN-LOBBY | {name: 'lobby'} | JOIN-LOBBY-REJECTED | { reason: 'User is already in a lobby' } |
| JOIN-LOBBY-REJECTED | { reason: 'Lobby does not exist' } | ||
| JOIN-LOBBY-REJECTED | { reason: 'Game already started' } | ||
| JOIN-LOBBY-ACCEPTED | |||
| LEAVE-LOBBY | LEAVE-LOBBY-ACCEPTED | ||
| LEAVE-LOBBY-REJECTED | { reason: 'Player is not inside a lobby' } | ||
| CHOOSE-ROL | {rol: 'b'} | CHOOSE-ROL-ACCEPTED | { name: 'rataplan', rol: 'b' } |
| CHOOSE-ROL-REJECTED | { reason: 'Player is not inside a lobby' } | ||
| START-GAME | START-GAME-ACCEPTED | { players: { name: 'useloom', rol: 'b' },{ name: 'rataplan', rol: 'w' } ,turn: 'w'} | |
| START-GAME-REJECTED | { reason: 'Player is not the lobby creator' } | ||
| START-GAME-REJECTED | { reason: 'Player is not inside a lobby' } | ||
| START-GAME-REJECTED | { reason: 'There are roles without player' } | ||
| MOVE | {move: 'e4'} | MOVE-REJECTED | { reason: 'Not your turn' } |
| MOVE-ACCEPTED | { name: 'rataplan', move: 'e4', turn: b } | ||
| MOVE-REJECTED | { reason: 'Invalid move' } |
Emitted Messages
| Message | Message data | Trigger | Notes |
|---|---|---|---|
| JOINED-LOBBY | { name: 'rataplan' } | JOIN-LOBBY-ACCEPTED | Broadcasted to lobby when someone joins |
| CLOSE-LOBBY-ACCEPTED | CLOSE-LOBBY | Broadcasted to lobby when the creator closes it | |
| CHOOSED-ROL | { name: 'rataplan', rol: 'b' } | CHOOSE-ROL | Broadcasted to lobby when a player chooses a rol |
| GAME-STARTED | { players: { name: 'useloom', rol: 'b' },{ name: 'rataplan', rol: 'w' } ,turn: 'w'} | START-GAME | Broadcasted to lobby when the creator starts the game |
| MOVED | { name: 'rataplan', move: 'e4', turn: b } | MOVE | Broadcasted to lobby when the creator starst the game |
| LEFT-LOBBY | { name: 'rataplan' } | LEAVE-LOBBY | Broadcasted to lobby when a player leaves |
Specification status
References
1- Factory functions: https://medium.com/@vapurrmaid/should-you-use-classes-in-javascript-82f3b3df6195 2- JsDoc: https://medium.com/@trukrs/type-safe-javascript-with-jsdoc-7a2a63209b76
0.4.18
6 years ago
0.4.17
6 years ago
0.4.16
6 years ago
0.4.15
6 years ago
0.4.14
6 years ago
0.4.13
6 years ago
0.4.12
6 years ago
0.4.11
6 years ago
0.4.10
6 years ago
0.4.9
6 years ago
0.4.8
6 years ago
0.4.7
6 years ago
0.4.6
6 years ago
0.4.5
6 years ago
0.4.4
6 years ago
0.4.3
6 years ago
0.4.2
6 years ago
0.4.1
6 years ago
0.4.0
6 years ago
0.3.6
6 years ago
0.3.5
6 years ago