Rooms have states: SEARCHING, CHATTING and CHOOSING.
enum class operation : int {
SEARCHING_START = 0, // |
SEARCHING_STOP = 1, // | ---> SEARCHING
SEARCHING_GAME_FOUND = 2, // |
CHATTING_NEW_MESSAGE = 3, // | ---> CHATTING
CHATTING_STAGE_IS_OVER = 4, // |
CHOOSING_USERS_CHOSEN = 5, // | ---> CHOOSING
CHOOSING_STAGE_IS_OVER = 6, // |
}
{
"operation": 0,
"body": {
"profile": {
"username": "<string>",
"contact": "<string>",
"language": "<int>"
}
}
}
Places the user in an available room. If necessary, the server will create a room.
{
"operation": 0,
"body": {}
}
... over time (see config.yml) ...
{
"operation": 2,
"body": {
"foundGameData": {
"chattingStageDuration": "<int>",
"chattingTopic": "<string>",
"choosingStageDuration": "<int>",
"localProfileId": "<int>",
"profilePublicList": [
{
"id": "<int>",
"username": "<string>"
},
...
],
"startSessionTime": "<int>"
}
}
}
Users are assigned a local number in the order they are added to the room.
{
"operation": 1
}
Until information about the found game comes. Or just gracefully close the websocket.
{
"operation": 3,
"body": {
"message": {
"text": "<string>"
}
}
}
{
"operation": 3,
"body": {
"message": {
"senderId": "<int>",
"text": "<string>"
}
}
}
Your own message will arrive almost in sync.
... over time (see config.yml) ...
{
"operation": 4,
"body": {}
}
{
"operation": 5,
"body": {
"userIdList": [
"<int>",
...
]
}
}
... over time (see config.yml) ...
{
"operation": 6,
"body": {
"matchedUsers": [
{
"id": "<int>",
"contact": "<string>"
},
...
]
}
}