/** * <host> = server hostname or IP. * <port> = config's "port=" setting. Default is 9999. */// Create a new requestvarxhr=newXMLHttpRequest();// Open the connection to the serverxhr.open("POST","//<host>:<port>/data",true);// Set headers to correct Content-Typexhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");// Ask server for all stats from every worldxhr.send("players=all");// Handle the response from the serverxhr.onload=function(e){console.log(e.target.responseText);}
API Examples
// For all worlds the player(s) have been inxhr.send("players=player1,player2,player4");// For specific worlds, i.e. world named "nether"xhr.send("players=player1,player3&worlds=nether");
Comments
To post a comment, please login or register a new account.
Comments