📝 Docs about the socket.io-connection
This commit is contained in:
+23
-2
@@ -1,6 +1,27 @@
|
||||
# Socket.IO-Client-Docs
|
||||
|
||||
## Init
|
||||
## Main structure
|
||||
|
||||
### Admin
|
||||
|
||||
1. The admin emits the `register_as_admin`-event with the `game_pin` and `game_id`
|
||||
2. Then he should receive the `registered_as_admin`-event and is successfully registered as an admin, but he could also
|
||||
receive the self-explaining `already_registered_as_admin`, which means, that an admin already exists.
|
||||
The `registered_as_admin`-event contains the quiz.
|
||||
3. If players join, the `player_joined`-event will be emitted with the username of the user who joined
|
||||
4. The admin can now set the index of the question which sould be show on the player-screen with
|
||||
the `set_question_number`-event.
|
||||
5. Now, the admin can emit the `get_question_results`-event to show the results of the question-index which is sent with
|
||||
this event, on the screen of the users and on its own.
|
||||
6. The response of the `get_question_results`-event is the `question_results`-event, containing the results.
|
||||
|
||||
> Note: Most of these events require some kind of data.
|
||||
|
||||
### Player
|
||||
TODO
|
||||
## API-Docs
|
||||
|
||||
### Init
|
||||
|
||||
Event: `join_game`
|
||||
|
||||
@@ -8,7 +29,7 @@ body: `{game_id}` (obtained by `/api/v1/quiz/join`)
|
||||
|
||||
return: `None`
|
||||
|
||||
## Get Game Data
|
||||
### Get Game Data
|
||||
|
||||
Event: `get_game_data`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user