Client Events
Your client should listen to these events.
Connected
When this is emitted, we recommend saving the player's UID for the kick feature.
Automatically sent when a user connects using socket.connect()
.
Parameters
Name | Type | About |
---|---|---|
data | Object | Object with game and user info. See structure below. |
Player Join
Parameters
Name | Type | About |
---|---|---|
data | Object | Object with player information. |
Player Leave
Parameters
Name | Type | About |
---|---|---|
uid | String | The UID of the disconnecting player. |
Votes
Get the votes sent from get_votes
Parameters
Name | Type | About |
---|---|---|
votes | Array | The votes, which are object containing the user's name & their answer. |
New Question
Get the new data from next
Parameters
Name | Type | About |
---|---|---|
question | String or object | The modes with one question will return the card content as a string. The ones with more than one will return an object, where |
Error
Listen for errors.
Receive a Chat Message
Receive a chat message on the client.
Parameters
Name | Type | About |
---|---|---|
data | Object | An object containing the message (content) and author. See the structure below. |
Players
Get an array of players from get_players
Parameters
Name | Type | About |
---|---|---|
data | Array | See structure below. |
Kicking a User
Additional Word Wreck Events
Since Word Wreck has more components to it, it has a few extra events.
Vote
This will emit when everyone has submitted an answer to vote on.
Do not confuse this with votes for the other modes. Word Wreck involves 2 components to a round, with the 2nd being voting. This is for this 2nd round, not to get votes.
Parameters
Name | Type | About |
---|---|---|
voteOptions | Array | The answers to vote for. See structure below. |
Winner
When everyone has voted, this event will emit with the winner.
Parameters
Name | Type | About |
---|---|---|
winner | Object | The name of the winner and their answer. See structure below. |
Last updated