跳转至

初始化被暂停用户的排名

封禁游戏服务器注册

封禁游戏服务器注册 API 在注册或变更封禁用户信息时,提供将该信息自动传递到游戏服务器的功能。通过此 API,可以在游戏服务器实时接收封禁用户信息。

  • 信息传输时间:当被暂停的用户信息被新注册或更改时,它会自动传输到游戏服务器。当暂停解除时,信息不会通过API传输。
  • 信息传输单位:每个请求最多传输100个被暂停的用户信息项。例如,如果有2,000个被暂停的用户,则向游戏服务器发送20个请求,每个请求分为100个。

要使用封禁游戏服务器注册 API,需先准备好可接收请求(Request)的游戏服务器。游戏服务器注册可在 Hive 控制台通过以下路径进行设置。

  • 路径: Hive 控制台 > 认证 > 封禁 > 游戏服务器注册

基础

描述
Request URL 在 Hive 控制台游戏服务器中已注册项目的游戏服务器 URL : [Hive 控制台 > 认证 > 封禁 > 游戏服务器注册]
HTTP 方法 POST
内容类型 application/json
数据格式 JSON
授权 Bearer 游戏服务器认证密钥
Note
  • Bearer 令牌对应 [Hive 控制台 > 认证 > 封禁 > 游戏服务器注册 > 项目详情 > 游戏服务器认证密钥]。
  • 游戏服务器认证密钥验证必须开发,以便可以在请求的游戏服务器上进行验证。

请求

名称 类型 必需 描述
game_index 整数 O 游戏索引
server_url 字符串 O 游戏服务器 URL
data List O 封禁用户列表
data.player_id 整数 O 玩家 ID
data.status String O 封禁状态

P: 永久封禁
B: 有封禁期限的用户
data.start_date 字符串 O 暂停开始日期
data.end_date 字符串 O 暂停结束日期

响应

名称 类型 描述 备注
result_code 整数 结果代码 * 0: 正常
* 所有其他代码都是错误(游戏服务器响应的代码)

请求示例

curl -X POST {URL of the game server of the project registered to the Hive console game server}
-H 'Content-Type: application/json'
-H 'Authorization: Bearer {Game server authentication key issued when registering the Hive console game server}'
-d '{"game_index": 539, "server_url": "{URL of the game server of the project registered to the Hive console game server}", "data": [{"player_id": 1, "status": "B", "start_date": "2024-07-10 20:56:59", "end_date": "2024-07-13 20:56:59"}, {"player_id": 2, "status": "B", "start_date": "2024-07-10 20:56:59", "end_date": "2024-07-20 20:56:59"}, {"player_id": 3, "status": "P", "start_date": "2024-07-10 20:56:59", "end_date": "9999-12-31 00:00:00"}]}'

请求 JSON 示例

{
"game_index": 539,
"server_url": "{URL of the game server of the project registered in the Hive console game server}",
"data": [
{
"player_id": 1,
"status": "B",
"start_date": "2024-07-10 20:56:59",
"end_date": "2024-07-13 20:56:59" }, { "player_id": 2, "status": "B", "start_date": "2024-07-10 20:56:59", "end_date": "2024-07-20 20:56:59" }, { "player_id": 3, "status": "P", "start_date": "2024-07 -10 20:56:59", "end_date": "9999-12-31 00:00:00" } . . .
 (Up to 100 suspended users sent. EX) If 2,000 suspended users are registered, a total of 20 game server transmission requests will occur, 100 each.)
]
}

响应 JSON 示例

{
"result_code": 0
}