The webadmin page displays the current game status in the top right of the screen which includes:
- Map
- Current player count
- Max player amount
- Current wave
- Maximum waves
This is returned in HTML format so needs to be parsed if you intend on doing something smart with the output. However getting it is a little tricky due to it being behind the webadmin's login wall.
curl http://server:8080/ServerAdmin/current+gamesummary -b authcred="<authcred>" -b sessionid="<sessionid>" -X POST
The easiest way to do this is to just log into the webadmin using your normal credentials then wait on your browser pinging it for the first time. This is done once every few seconds. You can fish the two cookies out of the networking tab of your developer tools.
The authcred is generated using the following Javascript
var hashAlg = "";
$(document).ready(function(){
if (hashAlg != "sha1") {
return;
}
$('#loginform').submit(function(){
var hashme = $('#password').val()+$('#username').val();
$('#password_hash').val("$sha1$"+hex_sha1(hashme));
$('#password').val("");
return true;
});
});
While the sessionid
is sent back by the server when you browse to the login page. Once you're there, you can just return that sessionid
which is verified on the webadmin portal.