Restrict game server reg
停權遊戲伺服器註冊¶
停權遊戲伺服器註冊 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.)
]
}