LabAPI_QueryServer
A LabAPI plugin that launches a local HTTP query server for querying game round information.
LabAPI_QueryServer
A LabAPI plugin that launches a local HTTP query server for querying game round information.
一个 LabAPI 插件,可以启动一个本地 HTTP 查询服务器,用于查询游戏回合信息。
Use / 使用
Download LabAPI_QueryServer_x64.dll from Releases and place it in %appdata%\SCP Secret Laboratory\LabAPI\plugins\<port>.
从 Releases 中下载 LabAPI_QueryServer_x64.dll 并放入 %appdata%\SCP Secret Laboratory\LabAPI\plugins\<port>。
For example, when the server port is set to 7777 under default configuration.
以默认配置情况下,服务器端口为7777时为例。
GET http://127.0.0.1:7777/
If everything is normal, it will return:
一切正常的话,将会返回:
{
"name":"My Server Name",
"port":7777,
"player":{
"online":4,
"max":20,
// or [] 或 []
"list":[
{
"name": "德二吹风机D2s",
"is_admin": true,
"is_dummy": false
}
],
"admins":1
},
// Round time 回合时间
"time":83,
// FriendlyFire 友伤
"friendly_fire":false,
// Warhead detonation 核弹引爆
"warhead":false,
// LCz Decontamination 轻收净化程序
"decontamination":false,
"success":true
}
If a request is made while the server is not fully started:
如果在服务器未完全启动时请求:
{
"data":"The server has not yet fully started. Please try again later.",
"success":true
}
Other potential errors may result in HTTP status code 500.
其他潜在错误可能导致 HTTP 状态码500。
Config / 配置
| Configuration Item | Default value | Description |
|---|---|---|
| query_server_port | 0 | The port listened to by HttpListener. When set to 0, it defaults to listening on the LocalAdmin (server) port. |
| query_server_host | 127.0.0.1 | The address monitored by HttpListener. When monitoring all addresses, set it to *. |
| query_server_debug | false | Debug mode: When enabled, it outputs information for each request. |
| 配置项 | 默认值 | 介绍 |
|---|---|---|
| query_server_port | 0 | HttpListener 监听的端口,为 0 时默认监听 LocalAdmin (服务端)的端口。 |
| query_server_host | 127.0.0.1 | HttpListener 监听的地址,监听所有时应设置为 * 。 |
| query_server_debug | false | Debug 模式,开启后会输出每个请求的信息。 |
Author
Details
Published 2 days ago
Refreshed 9 seconds ago