Skip to content

JSON Protocols

caelinp edited this page Oct 20, 2018 · 9 revisions

Queuing up for a game

When the player wants to queue up for a game, the client must emit an event called queue_for_game which sends a JSON message with the following structure:

{"username": "Johnny", "course": "CPEN321", "rank": 5, "pic" : "xx"}

where the player_id is p_xxxxxxxxxx, p indicating the string represents a player and the 10 xs are a series of numbers unique to that player.

Question structure

The question database holds JSON strings representing questions, structured like so:

{"question": "What is the color of an orange?", "correct_ans": "orange", "wrong_ans1": "red", "wrong_ans2": "blue", "wrong_ans3": "all of the above", "difficulty": 5, "creator_id": 1234567890, "prof_verified": true, "reported": false}

Clone this wiki locally