diff --git a/source/masterserver/scripts/utils.js b/source/masterserver/scripts/utils.js new file mode 100644 index 00000000..fa7b83ab --- /dev/null +++ b/source/masterserver/scripts/utils.js @@ -0,0 +1,50 @@ +function asynchGet(url, target) { + //debugger; + //alert(target); + //document.getElementById(target).style.display='visible'; + document.getElementById(target).innerHTML = ' Fetching data...'; + if (window.XMLHttpRequest) { + req = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } + if (req != undefined) { + req.onreadystatechange = function() {asynchDone(url, target);}; + req.open("GET", url, true); + req.send(""); + } +} + +function asynchDone(url, target) { + //debugger; + if (req.readyState == 4) { // only if req is "loaded" + if (req.status == 200) { // only if "OK" + document.getElementById(target).innerHTML = req.responseText; + } else { + document.getElementById(target).innerHTML=" MG Error:\n"+ req.status + "\n" +req.statusText; + } + } +} + +//debugger; +for(var gameIndex = 1; gameIndex < 200; ++gameIndex) { + if(document.getElementById('gameStats_' + gameIndex) ) { + var link = document.getElementById('gameStats_' + gameIndex); + link.onclick = function() { + var row = document.getElementById('content_row_' + this.getAttribute('gameuuid')); + if(row && row.className == 'fullyhide') { + row.className = 'fullyshow'; + row.innerHTML = '
Game Duration | ' . PHP_EOL; diff --git a/source/masterserver/showServers.php b/source/masterserver/showServers.php index 2bf9e5e0..157ef34f 100644 --- a/source/masterserver/showServers.php +++ b/source/masterserver/showServers.php @@ -80,6 +80,7 @@ echo 'Build date | ' . PHP_EOL; echo '%s | %s", $server['status'], $status_class, $server['gameUUID'], htmlspecialchars( $status_title, ENT_QUOTES ), PHP_EOL ); + $games_with_stats++; + printf( "\t\t\t\t%s", $server['status'], $status_class, $games_with_stats, $server['gameUUID'], htmlspecialchars( $status_title, ENT_QUOTES ) ); + printf( " | %s", PHP_EOL ); } else { @@ -179,6 +182,14 @@ printf( "\t\t\t\t%s | %s", htmlspecialchars( $server['binaryCompileDate'], ENT_QUOTES ), PHP_EOL ); echo "\t\t\t" . '' . PHP_EOL; + + if (($status_code == 2 || $status_code == 3) && $server['gameUUID'] != "") + { + //echo "\t\t\t" . '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
%s", PHP_EOL ); + echo "\t\t\t" . ' |