3.4 Logout All Users (登出全部玩家)

Description (说明)

Invoke this API to force out all online player.
调用此API以强制登出所有玩家。

URL (网址)

https://{host}/api/logout_all_users

Request Method

POST

Request Parameters (请求参数)

Field
(栏位)
Type
(型态)
Required
(必要)
Description
(说明)
agentIdStringYAgent ID <= 50 characters
代理帐号
{
  "agentId": "hrgag"
}

Return Result (返回结果)

Field
(栏位)
Type
(型态)
Description
(说明)
codeStringStatus Code fixed 4 characters
状态码

Please refer to 5.4 Status Code for details.
详情请参考 5.4 状态代码
dataObject
agentIdStringAgent ID <= 50 characters
代理帐号
userIdsArray of StringContains all usernames that are force logout
包含强制登出的所有玩家用户名
successCountNumberTotal number of players force logout success by this call
强制登出成功的玩家总数
failureCountNumberTotal number of players force logout failure by this call
强制登出失败的玩家总数
{
  "code": "0000",
  "data": {
    "agentId": "hrgag",
    "userIds": [
      "hrgpl0001",
      "hrgpl0002",
      "hrgpl0003",
      "hrgpl0004",
      "hrgpl0005",
      "hrgpl0006",
      "hrgpl0007",
      "hrgpl0008"
    ],
    "successCount": 8,
    "failureCount": 0
  }
}

Sample Request For Each Language (各语言请求范例)

OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"agentId\":\"hrgag\"}");
Request request = new Request.Builder()
  .url("https://{host}/api/logout_all_users")
  .method("POST", body)
  .addHeader("Authorization", "Basic TWpNQ0JSM1NFYnBrYXdSNTpNak1DQlIzU0VicGthd1I1")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();