保留
警告:此处的 API 文档适用于 Clanforge。如果使用 Multiplay Hosting,请参阅 Multiplay Hosting API 文档。
在通过 <machineid>
指定的机器上保留通过 <serverid>
指定的游戏服务器。
与分配不同,当玩家加入或游戏服务器处于活跃状态时,您必须从专用游戏服务器中保留游戏服务器。机器 ID 和服务器 ID 都在 Clanforge 上生成并传递给游戏服务器。
https://api.multiplay.co.uk/cfp/v1/machine/<machineid>/reserve_server
方法 | 内容类型 |
GET | application/x-www-form-urlencoded |
请求参数
变量 | 描述 | 可选 |
machineid | <machineid> 参数接受机群中某个机器的标识符。 | 否 |
serverid | <serverid> 参数接受指定机器上某个游戏服务器的游戏服务器实例 ID。 | 否 |
响应字段
字段 | 类型 | 描述 | 可选 |
---|---|---|---|
profileid | 整数 | 此服务器所用配置文件的 ID | 否 |
uuid | 字符串 | 分配的 ID | 否 |
regions | 字符串 | 此游戏服务器所在地区的 ID | 否 |
created | 字符串 | 创建保留的时间 | 否 |
requested | 字符串 | 请求保留的时间 | 否 |
fulfilled | 字符串 | 完成保留的时间 | 否 |
serverid | 整数 | 此保留的服务器所对应的 ID | 否 |
fleetid | 字符串 | 此服务器所在机群的 ID | 否 |
regionid | 字符串 | 此服务器所在地区的 ID | 否 |
machineid | 整数 | 此服务器所在机器的 ID | 否 |
ip | 字符串 | 此游戏服务器的 IP(版本 4)地址 | 否 |
ipv6 | 字符串 | 此游戏服务器的 IP(版本 6)地址(如果机群支持的话) | 是 |
game_port | 整数 | 此游戏服务器的网络端口 | 否 |
请求示例
curl --location --request GET 'https://api.multiplay.co.uk/cfp/v1/machine/<machineid>/reserve_server?serverid=<serverid>' \
--header 'Authorization: Basic YOUR_AUTH_CREDENTIALS'\
--header 'Content-Type: application/x-www-form-urlencoded'
响应示例
{
"success": <status>,
"messages": [],
"allocation": {
"profileid": <profileid>,
"uuid": <uuid>,
"regions": <regions>,
"created": <created>,
"requested": <requested>,
"fulfilled": <fufilled>,
"serverid": <serverid>,
"fleetid": <fleetid>,
"regionid": <regionid>,
"machineid": <machineid>,
"ip": <ip>,
"game_port": <port>
}
}