diff --git a/source/masterserver/scripts/desktop_notifications.js b/source/masterserver/scripts/desktop_notifications.js
index 2011f311..09160311 100644
--- a/source/masterserver/scripts/desktop_notifications.js
+++ b/source/masterserver/scripts/desktop_notifications.js
@@ -83,6 +83,7 @@ function timedRequest()
var jsonText = JSON.parse(request.responseText);
var newServerList = {};
+ games_with_stats = 100;
// Repopulate table content
var table = "
\n"
+ " Version | \n"
@@ -147,7 +148,16 @@ function timedRequest()
statusClass = 'unknown';
}
- table += "" + escapeHtml(statusTitle) + " | ";
+ //debugger;
+ if ((statusCode == "2" || statusCode == "3") && jsonText[i].gameUUID != "")
+ {
+ var specialColHTML = "" + escapeHtml(statusTitle) + " | ";
+ table += specialColHTML;
+ }
+ else
+ {
+ table += "" + escapeHtml(statusTitle) + " | ";
+ }
/// Country
if(jsonText[i].country !== "")
@@ -195,6 +205,15 @@ function timedRequest()
table += "
";
+ if ((statusCode == "2" || statusCode == "3") && jsonText[i].gameUUID != "")
+ {
+ table += "";
+ table += " | ";
+ table += "
";
+
+ games_with_stats++;
+ }
+
////// DESKTOP NOTIFICATIONS SECTION
// Store data in an array keyed by the concatenation of the IP and port
@@ -229,6 +248,11 @@ function timedRequest()
var tableDOM = document.getElementsByTagName("tbody");
tableDOM[0].innerHTML = table;
+ //debugger;
+ for(var gameIndex = 100; gameIndex < 200; ++gameIndex) {
+ setupGameStatsLink(gameIndex);
+ }
+
// Catch empty case
if(jsonText.length == 0)
{
diff --git a/source/masterserver/scripts/utils.js b/source/masterserver/scripts/utils.js
index fa7b83ab..b466e231 100644
--- a/source/masterserver/scripts/utils.js
+++ b/source/masterserver/scripts/utils.js
@@ -26,8 +26,7 @@ function asynchDone(url, target) {
}
}
-//debugger;
-for(var gameIndex = 1; gameIndex < 200; ++gameIndex) {
+function setupGameStatsLink(gameIndex) {
if(document.getElementById('gameStats_' + gameIndex) ) {
var link = document.getElementById('gameStats_' + gameIndex);
link.onclick = function() {
@@ -48,3 +47,9 @@ for(var gameIndex = 1; gameIndex < 200; ++gameIndex) {
};
}
}
+//debugger;
+
+for(var gameIndex = 1; gameIndex < 200; ++gameIndex) {
+ setupGameStatsLink(gameIndex);
+}
+
diff --git a/source/masterserver/showServersJson.php b/source/masterserver/showServersJson.php
index 2efc23a3..7db60dd0 100644
--- a/source/masterserver/showServersJson.php
+++ b/source/masterserver/showServersJson.php
@@ -12,7 +12,7 @@
// consider replacing this by a cron job
cleanupServerList();
- $servers_in_db = mysql_query( 'SELECT * FROM glestserver status <> 3 OR (status = 3 AND lasttime > DATE_add(NOW(), INTERVAL -8 hour)) ORDER BY status, lasttime DESC, connectedClients > 0 DESC, (networkSlots - connectedClients), ip DESC;' );
+ $servers_in_db = mysql_query( 'SELECT * FROM glestserver WHERE status <> 3 OR (status = 3 AND lasttime > DATE_add(NOW(), INTERVAL -8 hour)) ORDER BY status, lasttime DESC, connectedClients > 0 DESC, (networkSlots - connectedClients), ip DESC;' );
$all_servers = array();
while ( $server = mysql_fetch_array( $servers_in_db ) )
{