From: Matteo Nastasi (mop) Date: Wed, 24 Jan 2007 22:09:02 +0000 (+0000) Subject: aggiunto smammamorti X-Git-Tag: 3.0.0~338 X-Git-Url: http://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=04e1d4690aafd42fb24abf8c24dd9f036b4b08a8 aggiunto smammamorti --- diff --git a/TODO.txt b/TODO.txt index 269228b..8e1ea06 100644 --- a/TODO.txt +++ b/TODO.txt @@ -14,7 +14,6 @@ TODO ==== - URGENT!- smammamorti URGENT!- ban temporaneo dai tavoli URGENT - flash player to play sound @@ -35,7 +34,7 @@ MIDDLE TODO =========== - - split server-side data + URGENT - split server-side data - user assistant (with button to enable disable) - asta: highlight buttons (css hover) - documentation @@ -56,6 +55,7 @@ DONE ==== + DONE - smammamorti DONE - unload of the stream DONE - standup centrati DONE - current player - in info diff --git a/web/brisk.phh b/web/brisk.phh index 2a7355c..f929470 100644 --- a/web/brisk.phh +++ b/web/brisk.phh @@ -28,17 +28,19 @@ define(COMM_N, 12); define(COMM_GEN_N, 50); define(SESS_LEN, 13); define(STREAM_TIMEOUT, 20); -define(EXPIRE_TIME, 180); +define(EXPIRE_TIME_RD, 180); +define(EXPIRE_TIME_SMAMMA, 300); define(GARBAGE_TIMEOUT, 10); define(NICKSERV, "SERVER"); define(BRISK_DEBUG, FALSE); // define(DEBUGGING, "local"); -$root_wellarr = Array ( 'Benvenuto in brisk (Ver. 0.4.3).', +$G_brisk_version = "0.4.4"; + +$root_wellarr = Array ( 'Benvenuto in brisk (Ver. '.$G_brisk_version.').', 'Se vuoi iscriverti alla Mailing List, cliccala!' ); -$table_wellarr = Array ( 'In bocca al lupo!'); +$table_wellarr = Array ( 'Benvenuto al tavolo.'); -$G_brisk_version = "0.4.3"; $G_room_help= '
@@ -295,6 +297,7 @@ class User { var $name; // name of the user var $sess; // session of the user var $lacc; // last access (for the cleanup) + var $laccwr; // last access (for the cleanup) var $stat; // status (outdoor, room, table, game, ...) var $subst; // substatus for each status var $step; // step of the current status @@ -309,7 +312,8 @@ class User { function User($name, $sess, $stat = "", $subst = "", $table = -1) { $this->name = $name; $this->sess = $sess; - $this->lacc = time(); + $this->lacc = time(); + $this->laccwr = time(); $this->stat = $stat; $this->subst = $subst; $this->step = 1; @@ -352,15 +356,9 @@ class brisco { if ($user_cur->sess == "") continue; - if ($user_cur->lacc < $curtime) { // Auto logout dell'utente + if ($user_cur->lacc + EXPIRE_TIME_RD < $curtime) { // Auto logout dell'utente log_rd2($user_cur->sess, "AUTO LOGOUT."); - /* - if ($user_cur->stat == 'table') { - log_rd2($user_cur->sess, "AUTO LOGOUT: Yet not implemented in table stat!"); - continue; - } - else - */ + if ($user_cur->stat == 'table' || $user_cur->stat == 'room') { log_auth($user_cur->sess, "Autologout session."); @@ -379,6 +377,15 @@ class brisco { // } // if (0 == 1) } + + if ($user_cur->laccwr + EXPIRE_TIME_SMAMMA < $curtime) { // lo rimettiamo in piedi + if ($user_cur->stat == 'room' && $user_cur->subst == 'sitdown') { + $this->room_wakeup(&$user_cur); + $user_cur->comm[$user_cur->step % COMM_N] = "gst.st = ".($user_cur->step+1)."; "; + $user_cur->comm[$user_cur->step % COMM_N] .= show_notify("
Sei stato inattivo per ".(EXPIRE_TIME_SMAMMA/60.0)." minuti.

Quindi ritorni tra i Giocatori in piedi.", 0, "torna ai tavoli", 400, 100); + $user_cur->step++; + } + } } log_rd2($user_cur->sess, "GARBAGE UPDATED!"); @@ -392,12 +399,11 @@ class brisco { $table_idx = $user->table; $table = &$this->table[$table_idx]; - log_main("WAKEUP", "begin function table:".$table_idx); + log_main("WAKEUP", "begin function table:".$table_idx." stat: ".$user->stat." subst: ".$user->subst); $from_table = ($user->stat == "table"); if ($from_table) { log_main("WAKEUP", "from table [".$user->table."] nplayers_n: ".$this->table[$user->table]->player_n); - for ($i = 0 ; $i < $table->player_n ; $i++) { $user_cur = &$this->user[$table->player[$i]]; log_main("PREIMPOST", "INLOOP name: ".$user_cur->name); @@ -413,7 +419,10 @@ class brisco { } } } - + else { + $user->stat = "room"; + $user->subst = "standup"; + } /* aggiorna l'array dei giocatori al tavolo. */ $table->user_rem(&$this, &$user); @@ -424,8 +433,6 @@ class brisco { log_main("VALORI", "name: ".$user_cur->name."from_table: ".$from_table." tab: ".$user_cur->table." taix: ".$table_idx." ucur: ".$user_cur." us: ".$user); - // function show_room(&$bri, &$user) - $ret = "gst.st = ".($user_cur->step+1)."; "; if ($from_table && ($user_cur->table == $table_idx || $user_cur == $user)) { $ret .= 'gst.st_loc++; the_end=true; window.onunload = null; document.location.assign("index.php");|'; @@ -433,6 +440,8 @@ class brisco { log_main("DOCUMENT.index.php", "from table"); } else if ($user_cur->stat == "room") { + log_main("DOCUMENT.index.php", "from table"); + $ret .= table_content($this, $user_cur, $table_idx); $ret .= standup_content($this, $user_cur); diff --git a/web/index_rd.php b/web/index_rd.php index ad4a874..a8193b6 100644 --- a/web/index_rd.php +++ b/web/index_rd.php @@ -72,7 +72,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su return (unrecerror()); } log_auth($sess, "update lacc"); - $user->lacc = time() + EXPIRE_TIME; + $user->lacc = time(); save_data($bri); $first_loop = FALSE; diff --git a/web/index_wr.php b/web/index_wr.php index b3362fe..3133fe7 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -60,6 +60,8 @@ if ($argz[0] == 'shutdown') { log_rd2($sess, "SHUTDOWN FROM WHAT ???"); } else if ($user->stat == 'room') { + $user->laccwr = time(); + if ($argz[0] == 'help') { $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; $user->comm[$user->step % COMM_N] .= show_notify(str_replace("\n", " ", $G_room_help), 0, "torna ai tavoli", 600, 500); @@ -156,6 +158,7 @@ else if ($user->stat == 'room') { * * ***************/ else if ($user->stat == 'table' && $user->subst == 'asta') { + $user->laccwr = time(); $table = &$bri->table[$user->table]; if ($argz[0] == 'logout') {