#

SUD

Description

This document describes how to push events to the game service.

Request URL

Request Method

  • Transport protocol: HTTPS
  • Request method: POST
  • Parameters are passed in the body in JSON format (see the request example).
  • The Content-Type header should be set to "application/json;charset=utf-8".
  • The Authorization header is required.

Request Headers

Request Parameters

Parameter Required Type Description
event Yes string Game event
mg_id Yes string Game ID
timestamp Yes string Push timestamp (in milliseconds)
data Yes object Event data

Game Event/Event Data (event/data) Corresponding Table

Game Event Event Data Description
user_in UserInReqData User joins the game
user_out UserOutReqData User leaves the game
user_ready UserReadyReqData User is ready or cancels ready
game_start GameStartReqData Game starts
captain_change CaptainChangeReqData Captain changes
user_kick UserKickReqData User is kicked out
game_end GameEndReqData Game ends
game_setting GameSettingReqData Game settings
ai_add AiAddReqData AI joins the game
room_info RoomInfoReqData Get seat information of the room
quick_start QuickStartReqData Start a game with one click
1. Check if the user information in the message is valid and initialize the user information
2. If there is a game in progress, an error will be reported. If there is no game in progress, kick out all players in the game seat
3. Set the game configuration (such as flying chess)
4. The user in the message joins the game seat
5. Everyone is ready
6. Start a game and initialize the game scene
room_clear RoomClearReqData Reset and clear the room
1. If there is a game in progress, the game will be settled
2. Kick out all players in the game seat
game_create GameCreateReqData Game creation (for racing games)
game_delete GameDeleteReqData Game deletion (for racing games)
mode_ex_change ModeExChangeReqData Sud-mode changes
user_in_batch UserInBatchReqData Batch user join

Request Example

{
    "event": "user_in",
    "mg_id": "mg_id_1",
    "app_id": "app_id_1",
    "timestamp": "1657770493152",
    "data": {
        "uid": "uid_1",
        "room_id":"room_id_1",
        "mode": 1,
        "language":"zh-CN",
        "seat_index": -1,
        "is_seat_random": true,
        "team_id": 1
    }
}

Response Parameters

  • BaseResp
Parameter Required Type Description
ret_code Yes int Response code
ret_msg Yes string Response message
data No object Response data

Response Example

{
  "ret_code": 0,
  "ret_msg": ""
}

results matching ""

    No results matching ""