fixed json desktop notifications
This commit is contained in:
parent
b71ec8447e
commit
5d5c2855b6
|
@ -83,6 +83,7 @@ function timedRequest()
|
|||
var jsonText = JSON.parse(request.responseText);
|
||||
var newServerList = {};
|
||||
|
||||
games_with_stats = 100;
|
||||
// Repopulate table content
|
||||
var table = "<tr>\n"
|
||||
+ " <th title=\"glestVersion\">Version</th>\n"
|
||||
|
@ -147,7 +148,16 @@ function timedRequest()
|
|||
statusClass = 'unknown';
|
||||
}
|
||||
|
||||
table += "<td title=\"" + jsonText[i].status + "\" class=\"" + statusClass + "\">" + escapeHtml(statusTitle) + "</td>";
|
||||
//debugger;
|
||||
if ((statusCode == "2" || statusCode == "3") && jsonText[i].gameUUID != "")
|
||||
{
|
||||
var specialColHTML = "<td title=\"" + jsonText[i].status + "\" class=\"" + statusClass + "\"><a id=\"gameStats_" + games_with_stats + "\" href=\"#\" gameuuid=\"" + jsonText[i].gameUUID + "\">" + escapeHtml(statusTitle) + "</a></td>";
|
||||
table += specialColHTML;
|
||||
}
|
||||
else
|
||||
{
|
||||
table += "<td title=\"" + jsonText[i].status + "\" class=\"" + statusClass + "\">" + escapeHtml(statusTitle) + "</td>";
|
||||
}
|
||||
|
||||
/// Country
|
||||
if(jsonText[i].country !== "")
|
||||
|
@ -195,6 +205,15 @@ function timedRequest()
|
|||
|
||||
table += "</tr>";
|
||||
|
||||
if ((statusCode == "2" || statusCode == "3") && jsonText[i].gameUUID != "")
|
||||
{
|
||||
table += "<tr width='100%%' class='fullyhide' id='content_row_" + jsonText[i].gameUUID + "'>";
|
||||
table += "<td width='100%%' colspan='100'></td>";
|
||||
table += "</tr>";
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ) )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue