diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2012-07-31 22:34:08 -0700 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2012-07-31 22:34:08 -0700 |
commit | 2d290b23c402561ef30c1de665895c120dd79483 (patch) | |
tree | 8bde5ebd953f3dd375abe88e61e40571df313b1f /do.php | |
parent | 628c2e712e39fe85762583fd1ddc12609746fc58 (diff) | |
download | pathery-2d290b23c402561ef30c1de665895c120dd79483.tar.xz |
Everything related to the scoreboard.
New feedback page.
Changed the speed of the pauses on checkpoints during a path animation.
Changed how notifications are recieved.
Diffstat (limited to 'do.php')
-rw-r--r-- | do.php | 39 |
1 files changed, 34 insertions, 5 deletions
@@ -5,6 +5,8 @@ include "includes/maps.php"; include "includes/db.inc.php";
include "includes/datas.php";
+$note = false;
+
//Auto login;
include_once("globe.php");
if (!isset($_SESSION['accepted']) || $_SESSION['accepted'] <> 1)
@@ -29,18 +31,39 @@ if (isset($_GET['act']) && $_GET['act'] == "getmap") { }
}
+// !! Depreciate?
if (isset($_GET['checkachieve']) && $_GET['checkachieve'] == 'true' && $_SESSION['accepted'] == 1) {
$json['notification'] = true;
-
$userID = $_SESSION['userID'];
-
//Located in includes/datas.php
$note = getNotified($userID);
-
if ($note !== false)
$json['notificationtext'] = $note;
}
+if ($_GET['r'] == 'reqScorePage') {
+ $mapID = $_GET['mapid'] + 0;
+ $page = $_GET['reqPage'] + 0;
+ if (!is_int($mapID) OR !is_int($page))
+ return;
+
+ //Include the notification text
+ $json = getScores($mapID, $page, 3);
+ $json['mapid'] = $mapID;
+ $json['page'] = $page;
+
+ if ($_SESSION['accepted'] == 1) {
+ $userID = $_SESSION['userID'];
+ $note = getNotified($userID);
+ if ($note !== false)
+ $json['notificationtext'] = $note;
+ }
+
+ $encoded = json_encode($json);
+ die($encoded);
+}
+
+
if ($_GET['r'] == 'getscores') {
$mapID = $_GET['mapid'] + 0;
if (!is_int($mapID))
@@ -59,12 +82,18 @@ if ($_GET['r'] == 'getsol') { $userID = $_SESSION['userID'];
- if ($_SESSION['accepted'] == 1)
+///// !! FIX FIX FIX FIX FIX FIX //////
+ if ($_SESSION['accepted'] == 1) {
$json = getSolution($userID, $mapID);
- if (isset($_SESSION[$mapID.'sol']) AND $mysolution == '') {
+ if ($tmp['moves'] > $_SESSION[$mapID.'sol']) {
+ $json = $tmp;
+ }
+ }
+ if (isset($_SESSION[$mapID.'sol'])) {
$json['solution'] = $_SESSION[$mapID.'sol'];
$json['moves'] = $_SESSION[$mapID.'moves'];
}
+
$json['mapid'] = $mapID;
$encoded = json_encode($json);
|