基于Valve的Rcon、A2s_player、A2s_Info的查询接口
java -jar valveapi-0.0.1-SNAPSHOT.jar --server.port=9090
其中,-jar 后面的参数为项目jar文件,9090为web服务端口号 注意:若Windows运行出现乱码,请在启动项前加入-Dfile.encoding=utf-8参数,例
java -Dfile.encoding=utf-8 -jar valveapi-0.0.1-SNAPSHOT.jar --server.port=9090
{"ip":"服务器ip地址:服务器端口号","cmd":"say 啊啊啊","passwd":"服务器RCON密码"}
{
"success": true,
"data": "Console: 啊啊啊\n",
"msg":""
}
{"ip":"服务器ip地址:服务器端口号"}
{
"success": true,
"msg": "",
"data": {
"name": "XXXXXXXXX",
"map": "c5m1_waterfront",
"players": "0/14",
"time": "21ms",
"visibility": "public"
}
}
{"ip":"服务器ip地址:服务器端口号"}
{
"success": true,
"msg": "",
"data": [
{
"index": 0,
"name": "XXXX",
"score": 0,
"time": "45875.816"
},
{
"index": 0,
"name": "XXXXXX",
"score": 9,
"time": "44703.492"
}
]}