From c21481d9806ea5e7350b60134e0360fe392fc78d Mon Sep 17 00:00:00 2001 From: Snap Date: Sat, 2 May 2015 20:39:43 -0700 Subject: Progress continues for the Matches! Hoorah --- pages/games.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'pages') 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='; + 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. -- cgit v1.2.3