#
UserInReqData
Parameter | Required | Type | Description |
---|---|---|---|
user_info | Yes | object | userInfoObj object, user_info is used first. If it is empty, the code field will be used. |
room_id | Yes | string | Room ID |
mode | Yes | int32 | Mode Default: 1 |
language | No | string | Language Default: zh-CN |
seat_index | No | int32 | The game position (seat number) to join. Pass -1 to indicate joining randomly. Start from 0 and cannot be greater than the number of seats. Default is 0. |
is_seat_random | No | bool | Default is false. Valid when seat_index is present. If the game position (seat number) is already occupied, whether to randomly assign an empty seat to sit. is_seat_random=true randomly assign empty seats to sit is_seat_random=false do not randomly assign |
team_id | No | int32 | For games that do not support teams: fill in the value of 1; for games that support teams: fill in the value of 1 or 2 (two teams) |
is_ready | No | bool | Whether to prepare Default: false false: not ready true: ready |
userInfoObj description
Parameter | Required | Type | Description |
---|---|---|---|
uid | Yes | string | The user ID, Maximum length 200 bytes |
nick_name | Yes | string | The user nickname. |
avatar_url | Yes | string | The URL of the user avatar. (The recommended size is 128 x 128 pixels.) |
gender | Yes | string | The gender. Valid values: female, male. If the gender is unknown, leave it empty. |
is_ai | No | int32 | Whether the player is a robot. Valid values: 0: common user; 1: robot. The parameter is set to 0 by default. |
ai_level | No | int32 | ai level 0: simple ai 1: simple ai 2: intermediate ai 3: advanced ai Default is 0 |
Request Example
{
"event": "user_in",
"mg_id": "mg_id_1",
"timestamp": "1657770493152",
"data": {
"user_info": {
"uid": "uid_1",
"nick_name": "nick_name_1",
"avatar_url": "https://icon.png?128*128",
"gender": "female",
"is_ai": 0,
"ai_level": 0
}
"room_id":"roomId_1",
"mode": 1,
"language":"zh-CN",
"seat_index": -1,
"is_seat_random": false,
"team_id": 1,
"is_ready": false
}
}