-
Notifications
You must be signed in to change notification settings - Fork 55
/
comm.js
42 lines (40 loc) · 1012 Bytes
/
comm.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Protocol options
* @type {{Port: number}}
*/
var Protocol = {
BindAddress: '0.0.0.0',
Port: 8080
};
module.exports.Protocol = Protocol;
/**
* Message IDs
* @readonly
* @enum {string}
*/
var Message = {
CONNECT: 'connect',
RECONNECT: 'reconnect',
DISCONNECT: 'disconnect',
CREATE_GUEST: 'createGuest',
GET_MATCH_LIST: 'getMatchList',
PLAY_RANDOM: 'playRandom',
CREATE_MATCH: 'createMatch',
JOIN_MATCH: 'joinMatch',
ROLL_DICE: 'rollDice',
MOVE_PIECE: 'movePiece',
CONFIRM_MOVES: 'confirmMoves',
UNDO_MOVES: 'undoMoves',
RESIGN_GAME: 'resignGame',
RESIGN_MATCH: 'resignMatch',
EVENT_PLAYER_JOINED: 'eventPlayerJoined',
EVENT_TURN_START: 'eventTurnStart',
EVENT_DICE_ROLL: 'eventDiceRoll',
EVENT_PIECE_MOVE: 'eventPieceMove',
EVENT_MATCH_START: 'eventMatchStart',
EVENT_MATCH_OVER: 'eventMatchOver',
EVENT_GAME_OVER: 'eventGameOver',
EVENT_GAME_RESTART: 'eventGameRestart',
EVENT_UNDO_MOVES: 'eventUndoMoves',
};
module.exports.Message = Message;