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

alibaba.cloudgame.liteplay.gaming.event.receive (游戏状态事件回调)

Paas游戏状态事件回调

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
request_param ReceiveGamingEventRequestDto 必须 入参对象
  • └ game_id
  • String
  • 必须
  • xxxa
  • 游戏id
  • └ event_code
  • String
  • 必须
  • POP_DISPATCHED
  • 事件编码
  • └ event_message
  • String
  • 可选
  • 调度成功
  • 事件说明
  • └ time_stamp
  • Number
  • 必须
  • 1623333333
  • 时间戳
  • └ account_id
  • String
  • 必须
  • 2333
  • 用户账号ID
  • └ game_session_id
  • String
  • 可选
  • gamesession11333
  • 游戏会话ID
  • └ account_domain
  • String
  • 必须
  • 0
  • 用户账号域
  • └ action
  • String
  • 必须
  • GAME_DISPAATCH
  • API名字
  • └ front_app_key
  • String
  • 可选
  • ake
  • 前台appKey
  • └ project_id
  • String
  • 必须
  • 1
  • 项目id
  • └ version
  • Number
  • 必须
  • 1
  • API版本

响应参数

名称 类型 示例值 描述
result Result {} 接口返回model
  • └ code
  • String
  • 0
  • code
  • data
  • ReceiveGamingEventResponseDto
  • {}
  • 回调响应内容
  • └ consume_state
  • Number
  • 0
  • 状态
  • └ message
  • String
  • 成功
  • 描述
  • └ message
  • String
  • 成功
  • message

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCloudgameLiteplayGamingEventReceiveRequest req = new AlibabaCloudgameLiteplayGamingEventReceiveRequest();
AlibabaCloudgameLiteplayGamingEventReceiveRequest.ReceiveGamingEventRequestDto obj1 = new AlibabaCloudgameLiteplayGamingEventReceiveRequest.ReceiveGamingEventRequestDto();
obj1.setGameId("xxxa");
obj1.setEventCode("POP_DISPATCHED");
obj1.setEventMessage("调度成功");
obj1.setTimeStamp(1623333333L);
obj1.setAccountId("2333");
obj1.setGameSessionId("gamesession11333");
obj1.setAccountDomain("0");
obj1.setAction("GAME_DISPAATCH");
obj1.setFrontAppKey("ake");
obj1.setProjectId("1");
obj1.setVersion(1L);
req.setRequestParam(obj1);
AlibabaCloudgameLiteplayGamingEventReceiveResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_cloudgame_liteplay_gaming_event_receive_response>
    <result>
        <code>0</code>
        <data>
            <consume_state>0</consume_state>
            <message>成功</message>
        </data>
        <message>成功</message>
    </result>
</alibaba_cloudgame_liteplay_gaming_event_receive_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

返回
顶部