From 329cc1f9b6657ce580b3a297e39a7cd259a62537 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Thu, 16 May 2013 17:19:15 -0700 Subject: More PHP warning and notice fixes. --- do.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'do.php') diff --git a/do.php b/do.php index 59c40cd..25a663d 100644 --- a/do.php +++ b/do.php @@ -173,8 +173,12 @@ if ($_GET['r'] == 'getpath') { $encoded = json_encode($json); die($encoded); } - - + //TODO: !! tutorial complete hackery! + if ($mapID == 5 && $moves == 75 && $accepted == false) { + $_SESSION['preCompletedTutorial'] = true; + $_SESSION['preCompletedTutorialNotified'] = false; + } + if ($_GET['isChallenge'] == 'true') { if (isChallengeMap($mapID)) { // $firephp->log('Calling challenges'); @@ -183,9 +187,9 @@ if ($_GET['r'] == 'getpath') { // $firephp->log('Challenges called!'); die(json_encode($json)); } - exit; + die(json_encode($json)); } - + //Get current score data. - to see if a pertinent score was beat. $sql = "SELECT `moves` as bestmoves, `displayName`, IFNULL(q1.mymoves, 0) FROM `solutions`, `users` @@ -211,7 +215,6 @@ if ($_GET['r'] == 'getpath') { $json['best'] = 0; $json['bestby'] = 'no one'; } - // --------- ------------------------------ --------- // --------- RUSH THE PATH BACK TO THE USER --------- // --------- ------------------------------ --------- @@ -225,6 +228,7 @@ if ($_GET['r'] == 'getpath') { flush(); //The connection is now closed, no further communication to the client can be done! } + // --------- CONTINUE EXECUTION --------- //TODO: !! Close the session with session_write_close(); as soon as possible. @@ -293,8 +297,7 @@ if ($_GET['r'] == 'getpath') { // --------- USER LOGGED IN //Is the map still valid to score on? - if (!isCurrentMap($mapID)) - return; + if (!isCurrentMap($mapID)) return; // --------- UPDATE SCORES $json['error'][] = 'map is current'; -- cgit v1.2.3