Compare commits

...

3 Commits

Author SHA1 Message Date
chacha e74be85b3c update README 2023-04-20 15:01:59 +02:00
chacha c04a2220bd Merge branch 'master' of https://chacha.ddns.net/gitea/chacha/UT99-Mod-ChaChaRESTStats 2023-04-20 15:00:05 +02:00
chacha b17b6b747e fix Gamestyle
fix JSON boolean formating
2023-04-20 15:00:00 +02:00
2 changed files with 20 additions and 21 deletions

View File

@ -48,16 +48,10 @@ __GET__ <SERVER_PREFIX>/api/v1/defaults_server
## Sample Output
__GET__ http://YOUR_SERVER_IP:YOUR_LISTEN_PORT/api/v1/map_list
```
{"Maplist":["CTF-Gauntlet.unr","CTF-Command.unr","CTF-Coret.unr","CTF-Dreary.unr","CTF-LavaGiant.unr","CTF-November.unr"]}
```
```{"Maplist":["CTF-Gauntlet.unr","CTF-Command.unr","CTF-Coret.unr","CTF-Dreary.unr","CTF-LavaGiant.unr","CTF-November.unr"]}```
__GET__ http://YOUR_SERVER_IP:YOUR_LISTEN_PORT/api/v1/current_all
```
{"GameName":"Capture the Flag","GameClass":"Botpack.CTFGame","LevelTitle":"Lava Giant","Level":"CTF-LavaGiant","Mutators":["Botpack.FatBoy"],"player_list":[{"PlayerName":"chacha","Ping":12,"Score":0.000000,"bIsABot":false,"bIsSpectator":true,"IP":"172.16.4.101"}]}
```
```{"GameName":"Capture the Flag","GameClass":"Botpack.CTFGame","LevelTitle":"Lava Giant","Level":"CTF-LavaGiant","Mutators":["Botpack.FatBoy"],"player_list":[{"PlayerName":"chacha","Ping":25,"Score":0.000000,"bIsABot":False,"bIsSpectator":False,"IP":"172.16.4.101"}]}```
__GET__ http://YOUR_SERVER_IP:YOUR_LISTEN_PORT/api/v1/default_all
```
{"GameStyle":"HardCore","GameStyle":"Turbo","GameSpeed":100.000000,"AirControl":35.000000,"UseTranslocator":True,"MaxPlayers":16,"MaxSpectators":2,"bMultiWeaponStay":True,"bTournament":False,"bPlayersBalanceTeams":False,"bForceRespawn":False,"GoalTeamScore":3.000000,"TimeLimit":0,"FriendlyFireScale":0.000000,"ServerName":"Another UT Server","AdminName":"","AdminEmail":"","MOTDLine1":"","MOTDLine2":"","MOTDLine3":"","MOTDLine4":"","bWorldLog":True}
```
```{"GameStyle":"Turbo","GameSpeed":100.000000,"AirControl":35.000000,"UseTranslocator":True,"MaxPlayers":16,"MaxSpectators":2,"bMultiWeaponStay":True,"bTournament":False,"bPlayersBalanceTeams":False,"bForceRespawn":False,"GoalTeamScore":3.000000,"TimeLimit":0,"FriendlyFireScale":0.000000,"ServerName":"Another UT Server","AdminName":"","AdminEmail":"","MOTDLine1":"","MOTDLine2":"","MOTDLine3":"","MOTDLine4":"","bWorldLog":True}```

View File

@ -227,13 +227,18 @@ function string QueryDefaultsSettings()
GameStyle+=1;
switch (GameStyle) {
case 0:
tmp$="\"GameStyle\":\"Normal\",";
break;
case 1:
tmp$="\"GameStyle\":\"HardCore\",";
case 2:
tmp$="\"GameStyle\":\"Turbo\",";
case 0:
tmp$="\"GameStyle\":\"Normal\",";
break;
case 1:
tmp$="\"GameStyle\":\"HardCore\",";
break;
case 2:
tmp$="\"GameStyle\":\"Turbo\",";
break;
default:
tmp$="\"GameStyle\":\"Normal\",";
break;
}
GameSpeed = class<DeathMatchPlus>(GameClass).Default.GameSpeed * 100.0;
@ -306,19 +311,19 @@ function string QueryCurrentPlayers()
tmp$="\"Score\":"$P.PlayerReplicationInfo.Score$",";
if (P.PlayerReplicationInfo.bIsABot)
{
tmp$="\"bIsABot\":true,";
tmp$="\"bIsSpectator\":false,";
tmp$="\"bIsABot\":True,";
tmp$="\"bIsSpectator\":False,";
}
else
{
tmp$="\"bIsABot\":false,";
tmp$="\"bIsABot\":False,";
if (P.PlayerReplicationInfo.bIsSpectator)
{
tmp$="\"bIsSpectator\":true,";
tmp$="\"bIsSpectator\":True,";
}
else
{
tmp$="\"bIsSpectator\":false,";
tmp$="\"bIsSpectator\":False,";
}
}
IP = "";