文档中心 > API类目 > 云游戏API

alibaba.cloudgame.interactive.game.status.get (获取游戏状态)

获取游戏状态

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
game_status_get_request GameStatusGetRequest 可选 请求入参
  • └ mix_game_id
  • String
  • 可选
  • cgeabntyjfjdtg
  • 游戏id
  • └ token
  • String
  • 可选
  • xxx
  • 验签token
  • └ room_id
  • Number
  • 可选
  • 1
  • 房间id

响应参数

名称 类型 示例值 描述
result Result 返回结果
  • └ code
  • String
  • OK
  • 返回状态码
  • data
  • GameStatusGetResponse
  • 返回结果
  • game
  • OpenGameDTO
  • 游戏详情
  • └ mix_game_id
  • String
  • N0A6X0JIJGA=
  • 游戏id
  • └ name
  • String
  • 超级玛丽
  • 游戏名称
  • └ creator
  • String
  • 1234
  • 主播id
  • └ total_player_num
  • Number
  • 4
  • 支持玩家数量
  • └ player_num
  • Number
  • 2
  • 当前玩家数量
  • └ room_id
  • Number
  • 1
  • 房间id
  • └ game_session
  • String
  • xxxx
  • 游戏会话id
  • └ status
  • String
  • KICK_OUT
  • 用户状态
  • player_list
  • OpenGamePlayerDTO []
  • {}
  • 玩家列表
  • └ user_id
  • String
  • 1234
  • 玩家id
  • └ player_index
  • String
  • 0
  • 位置索引
  • └ ext_info
  • String
  • {}
  • 扩展字段
  • └ status_data
  • String
  • {}
  • 状态详情数据
  • └ user_id
  • String
  • 1234
  • 用户id
  • └ message
  • String
  • OK
  • 返回描述

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCloudgameInteractiveGameStatusGetRequest req = new AlibabaCloudgameInteractiveGameStatusGetRequest();
AlibabaCloudgameInteractiveGameStatusGetRequest.GameStatusGetRequest obj1 = new AlibabaCloudgameInteractiveGameStatusGetRequest.GameStatusGetRequest();
obj1.setMixGameId("cgeabntyjfjdtg");
obj1.setToken("xxx");
obj1.setRoomId(1L);
req.setGameStatusGetRequest(obj1);
AlibabaCloudgameInteractiveGameStatusGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_cloudgame_interactive_game_status_get_response>
    <result>
        <code>OK</code>
        <data>
            <game>
                <mix_game_id>N0A6X0JIJGA=</mix_game_id>
                <name>超级玛丽</name>
                <creator>1234</creator>
                <total_player_num>4</total_player_num>
                <player_num>2</player_num>
            </game>
            <room_id>1</room_id>
            <game_session>xxxx</game_session>
            <status>KICK_OUT</status>
            <player_list>
                <open_game_player_d_t_o>
                    <user_id>1234</user_id>
                    <player_index>0</player_index>
                </open_game_player_d_t_o>
            </player_list>
            <ext_info>{}</ext_info>
            <status_data>{}</status_data>
            <user_id>1234</user_id>
        </data>
        <message>OK</message>
    </result>
</alibaba_cloudgame_interactive_game_status_get_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部