>
client to server<
server to client
Emitted when a user is updated.
{
id: '...',
username: '...'
}
Update our own data.
{
username: ''
}
Send a new chat message.
{
text: '...'
}
Emitted when a new message is received.
{
user: {...},
text: '...'
}
Emitted when you or a user join the game.
{
game: {
id: '...',
users: [{...}, {...}]
},
user: {
id: '...',
username: '...'
},
me: true
}
Emitted when a user leave the game.
{
game: {
id: '...',
users: [{...}, {...}]
},
user: {
id: '...'
}
}
Emitted when the game start.
{
time: 10
}
Emitted when the game end.
{
ranks: [
{
userId: 'xxx',
score: 'xxx',
rank: 1
}
]
}
Emitted when a new question is sent.
{
id: '...',
time: 30
}
Emitted when a question must be updated.
{
id: '...',
svg: {}
}
Send an answer to the question.
{
id: '...',
questionId: '...',
text: '...'
}
Emitted to acknowledge the answer to a question.
{
id: '...',
valid: true
}
Emitted when a user answer correctly to the question.
{
question: {...},
user: {...},
rank: 1,
points: 3
}
Emitted when the question is finished.
{
time: 10,
scores: {
'userIdxxx': 10
}
}