Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

#36

  • Loading branch information...
commit 76273e38fb8d773565205c6723347fdc9405d06a 1 parent 3b1d19f
@houjing houjing authored
Showing with 16 additions and 2 deletions.
  1. +2 −2 index.php
  2. +14 −0 utils.php
View
4 index.php
@@ -73,7 +73,7 @@
/******************* game ***********************/
elseif ($se == 'game') {
if ($s && strlen($s)==64 && sessionActive($s) ) refreshSession($s);
- else { header('Location: login.php'); die; }
+ else { header('Location: index.php?section=login'); die; }
if ($_GET && $to = $_GET['to']) {
changeLocation($s, $to);
@@ -88,7 +88,7 @@
'pic' => 'img/sasuke.jpeg',
'description' => currentZoneDescription($s),
'ways' => allowedZones($s),
- 'players_list' => array( array( id => idBySession($s), name => userBySession($s) ) ),
+ 'players_list' => usersOnLocation($s),
);
}
/******************* game ***********************/
View
14 utils.php
@@ -227,6 +227,12 @@ function changeLocation($s, $lid) {
}
else return false;
}
+
+function usersOnLocation($s) {
+ $q = mysql_query( 'SELECT `user`, `id` FROM `uniusers` WHERE `sessexpire` > NOW() AND `location`='.userLocation($s) );
+ for ($a=array(), $i=0; $r = mysql_fetch_assoc($q); $a[$i++]=array(id => $r['id'], name => $r['user']) );
+ return $a;
+}
/************************* GAME ***************************/
@@ -243,6 +249,14 @@ function array_filter_($a, $m) {
return $r;
}
+function b64UrlEncode($i) {
+ return strtr(base64_encode($i), '+/=', '-_,');
+}
+
+function b64UrlDecode($i) {
+ return base64_decode(strtr($i, '-_,', '+/='));
+}
+
function insertEncoding($e) {
header('Content-Type: text/html; charset='.$e);
}
Please sign in to comment.
Something went wrong with that request. Please try again.