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

NameTypeAbout

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

NameTypeAbout

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

Do not use this for MLT as they automatically send this with new_question

socket.emit('get_players')

Parameters

None

Chat

Send a message to the chat

socket.emit('message', message)

Parameters

NameTypeAbout

message

String

The user's message

Add Pack

Add a Pack to the game

socket.emit('add_pack', packId)

Parameters

NameTypeAbout

packId

String

The ID of the pack to add.

Kicking Users

Only the host can emit this event!

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

NameTypeAbout

uid

String

The UID of the user the player voted for

Last updated