-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.js
More file actions
43 lines (40 loc) · 1016 Bytes
/
Copy pathconstants.js
File metadata and controls
43 lines (40 loc) · 1016 Bytes
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
43
module.exports = {
/*
* Actions sent by players and master to the server.
*/
ACTION: {
MASTER: {
// Triggered when the master connects
CONNECT: 'quizjs-master-connect',
// Triggered when the state is reset
RESET: 'quizjs-master-reset',
// Triggered when it's another player's turn to answer
NEXT: 'quizjs-master-next'
},
PLAYER: {
// Triggered when a player connects
CONNECT: 'quizjs-player-connect',
// Triggered when a player subscribes to a question
SUBSCRIBE: 'quizjs-player-subscribe'
}
},
/**
* Events sent by server and client to their listeners.
*/
EVENT: {
MASTER: {
// Triggered when the master is registered to the server
REGISTER: 'quizjs-master-register'
},
PLAYER: {
// Triggered when a player is registered to the server
REGISTER: 'quizjs-player-register'
},
STATE: {
// Triggered when the state is reset
RESET: 'quizjs-state-reset',
// Triggered when the state is updated
UPDATE: 'quizjs-state-update'
}
}
};