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 (说明) |
|---|---|---|---|
| agentId | String | Y | Agent ID <= 50 characters 代理帐号 |
{
"agentId": "hrgag"
}
Return Result (返回结果)
| Field (栏位) | Type (型态) | Description (说明) |
|---|---|---|
| code | String | Status Code fixed 4 characters 状态码 |
| data | Object | |
| agentId | String | Agent ID <= 50 characters 代理帐号 |
| userIds | Array of String | Contains all usernames that are force logout 包含强制登出的所有玩家用户名 |
| successCount | Number | Total number of players force logout success by this call 强制登出成功的玩家总数 |
| failureCount | Number | Total 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();