X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_wr.php;h=649320141e53751d26f403d165c4191f7ca4416a;hb=2e3cd237127d4d429bd7132d2ed06e597ac9f4dc;hp=3e2c027baa5621812bee2fbb627131dd9e06cc29;hpb=196926208788f38d8ca9813860f59bf2c4a33d2e;p=brisk.git
diff --git a/web/index_wr.php b/web/index_wr.php
index 3e2c027..6493201 100644
--- a/web/index_wr.php
+++ b/web/index_wr.php
@@ -22,8 +22,16 @@
*/
require_once("Obj/brisk.phh");
+// require_once("Obj/proxyscan.phh");
require_once("briskin5/Obj/briskin5.phh");
+// Use of proxies isn't allowed.
+// if (is_proxy()) {
+// sleep(5);
+// exit;
+// }
+log_load("index_rd.php");
+
if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
echo "Debugging time!";
exit;
@@ -56,13 +64,19 @@ $argz = explode('|', $mesg);
log_wr('POSTSPLIT: '.$argz[0]);
if ($argz[0] == 'shutdown') {
- log_auth($user_cur->sess, "Shutdown session.");
+ log_auth($user->sess, "Shutdown session.");
+
+ $user->reset();
+ /* factorized with ->reset()
$tmp_sess = $user->sess;
$user->sess = "";
step_unproxy($tmp_sess);
$user->name = "";
+ while (array_pop($user->comm) != NULL);
+ $user->step = 0;
$user->the_end = FALSE;
-
+ */
+
log_rd2("AUTO LOGOUT.");
if ($user->subst == 'sitdown' || $user->stat == 'table')
$room->room_wakeup(&$user);
@@ -108,6 +122,19 @@ else if ($user->stat == 'room') {
if ($argz[0] == 'sitdown') {
log_wr("SITDOWN command");
+ if ($G_shutdown) {
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+
+ $timecur = time();
+ $dt = date("H:i ", $timecur);
+ $user->comm[$user->step % COMM_N] .= sprintf('chatt_sub("%s","Il server sta per essere riavviato, non possono avere inizio nuove partite.");', $dt.NICKSERV);
+
+ $user->step_inc();
+ Room::save_data($room);
+ Room::unlock_data($sem);
+ exit;
+ }
+
if ($user->the_end == TRUE) {
log_wr("INFO:SKIP:argz == sitdown && the_end == TRUE => ignore request.");
Room::unlock_data($sem);
@@ -116,7 +143,7 @@ else if ($user->stat == 'room') {
/* TODO: refact to a function */
if ($user->bantime > $user->laccwr) {
$user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
- $user->comm[$user->step % COMM_N] .= show_notify("
Ti sei alzato da un tavolo senza il consenso degli altri giocatori. Dovrai aspettare ancora ".secstoword($user->bantime - $user->laccwr)." prima di poterti sedere nuovamente.", 2000, "Torna in piedi.", 400, 100);
+ $user->comm[$user->step % COMM_N] .= show_notify("
Ti sei alzato da un tavolo senza il consenso degli altri giocatori. Dovrai aspettare ancora ".secstoword($user->bantime - $user->laccwr)." prima di poterti sedere nuovamente.", 2000, "resta in piedi.", 400, 100);
$user->step_inc();
Room::save_data($room);
@@ -190,6 +217,10 @@ else if ($user->stat == 'room') {
log_wr("Pre if!");
+// ARRAY_POP DISABLED
+// // CHECK
+ while (array_pop($user_cur->comm) != NULL);
+
$ret = "";
$ret .= sprintf('gst.st_loc++; gst.st=%d; createCookie("table_idx", %d, 24*365, cookiepath); createCookie("table_token", "%s", 24*365, cookiepath); the_end=true; window.onunload = null ; document.location.assign("briskin5/index.php");|', $user_cur->step+1, $table_idx, $table_token);