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

alibaba.cloudgame.interactive.game.joincode.assign (分配joinCode)

分配joinCode

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
join_code_assign_request JoinCodeAssignRequest 可选 请求入参
  • └ mix_game_id
  • String
  • 可选
  • cgeabntyjfjdtg
  • 游戏id
  • └ user_id
  • String
  • 可选
  • 1234
  • 主播用户id
  • └ room_id
  • Number
  • 可选
  • 1
  • 房间id
  • └ token
  • String
  • 可选
  • xxx
  • 验签token
  • └ play_index
  • String
  • 可选
  • 1
  • 玩家位置

响应参数

名称 类型 示例值 描述
result Result 返回结果
  • └ code
  • String
  • OK
  • 返回状态码
  • data
  • JoinCodeAssignResponse
  • 返回结果
  • └ join_code
  • String
  • adg3sa
  • 联机码
  • └ game_session
  • String
  • xxxx
  • 游戏会话id
  • player_list
  • Long []
  • {}
  • 玩家列表
  • └ user_id
  • String
  • 11111
  • 玩家id
  • └ player_index
  • String
  • 0
  • 位置索引
  • └ ext_info
  • String
  • {}
  • 扩展字段
  • └ message
  • String
  • OK
  • 返回描述

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCloudgameInteractiveGameJoincodeAssignRequest req = new AlibabaCloudgameInteractiveGameJoincodeAssignRequest();
AlibabaCloudgameInteractiveGameJoincodeAssignRequest.JoinCodeAssignRequest obj1 = new AlibabaCloudgameInteractiveGameJoincodeAssignRequest.JoinCodeAssignRequest();
obj1.setMixGameId("cgeabntyjfjdtg");
obj1.setUserId("1234");
obj1.setRoomId(1L);
obj1.setToken("xxx");
obj1.setPlayIndex("1");
req.setJoinCodeAssignRequest(obj1);
AlibabaCloudgameInteractiveGameJoincodeAssignResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_cloudgame_interactive_game_joincode_assign_response>
    <result>
        <code>OK</code>
        <data>
            <join_code>adg3sa</join_code>
            <game_session>xxxx</game_session>
            <player_list>
                <long>
                    <user_id>11111</user_id>
                    <player_index>0</player_index>
                </long>
            </player_list>
            <ext_info>{}</ext_info>
        </data>
        <message>OK</message>
    </result>
</alibaba_cloudgame_interactive_game_joincode_assign_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

返回
顶部