summaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/games.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/pages/games.php b/pages/games.php
index bee6cd3..b68a530 100644
--- a/pages/games.php
+++ b/pages/games.php
@@ -9,6 +9,12 @@ htmlHeader(array(), 'Game Lobby', 'Game Lobby');
echo soundManager2();
topbar($headerLinks);
+
+if (is_int($_GET['ID'])) {
+ $matchID = $_GET['ID'];
+}
+
+
?>
@@ -35,11 +41,10 @@ function matchUpdateTimer() {
}
-
-
function pollMatchStatus() {
var dataString = 'requestUpdate=1';
- dataString = '&playerIsReady='+playerIsReady;
+ dataString += '&matchID=<? echo $matchID; ?>';
+ dataString += '&playerIsReady='+playerIsReady;
$.ajax({
//type: "POST",
@@ -62,9 +67,13 @@ function pollMatchStatusDone(data) {
if (json.gameStarted == true) {
// Show the game if it's ready
- if (isInt(json.mapID) && matchMapReceived == false) {
+ if (json.mapReady == true && matchMapReceived == false) {
+ console.log("match countdown start!");
displayMap(json.mapID, "mapDisplay", 600);
matchMapReceived = true;
+
+ displayCountDownToGame(json.secondsTillGameExpires);
+
}
//This will be a negative number if the game is going.