Server Events

The server listens to these events.

Next Card

Tell the server to get a new Card

socket.emit('next')

Parameters

None

Submit Answer

Send the user's vote to the server

socket.emit('submit', answer)

Parameters

Name
Type
About

answer

String or number

For WYR, NHIE, & TOD, this should be either 1 or 2, denoting which option the user voted for. For Word Wreck, it should be the answer the user submitted. For MLT, it should be the user's ID.

Get Votes

This is only for MLT, NHIE, WYR, & TOD

Get all the current votes to display to the user.

socket.emit('get_votes', type)

Parameters

Name
Type
About

type

Number

Either 1, or 2 depending on the option you want to display (either option 1 or 2). For TOD, truth is 1 and dare is 2. For NHIE, HAVE is 1 and HAVE NOT is 2. For MLT, pass 0 as it is irrelevant.

Get Player List

socket.emit('get_players')

Parameters

None

Chat

Send a message to the chat

socket.emit('message', message)

Parameters

Name
Type
About

message

String

The user's message

Add Pack

Add a Pack to the game

socket.emit('add_pack', packId)

Parameters

Name
Type
About

packId

String

The ID of the pack to add.

Kicking Users

socket.emit('remove', id)

Additional Events

These events only apply to Word Wreck, Choice Duel, Freeplay, and Caption Clash

Since some games have more components to it, it has a few extra events.

Vote

Submit a vote for an answer.

socket.emit('text_vote', uid)

Parameters

Name
Type
About

uid

String

The UID of the user the player voted for

Last updated

Was this helpful?