+ function room_join_wakeup(&$user)
+ {
+ $table_idx = $user->table;
+ $table = &$this->table[$table_idx];
+
+ log_main("JOIN_WAKEUP", "begin function table:".$table_idx." stat: ".$user->stat." subst: ".$user->subst);
+
+ $curtime = time();
+
+ log_main("JOIN 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);
+ if ($user_cur->sess != "") {
+ $user_cur->laccwr = $curtime;
+ if ($user_cur->subst == "shutdowned") {
+ $user_cur->stat_set("room");
+ $user_cur->subst = "sitdown";
+ }
+ else if ($user_cur->subst == "shutdowner") {
+ $user_cur->stat_set("room");
+ $user_cur->subst = "standup";
+ $user_cur->table = -1;
+ $user_wup = &$user_cur;
+ }
+ }
+ }
+
+ /* aggiorna l'array dei giocatori al tavolo. */
+ $table->user_rem(&$this, &$user_wup);
+
+ for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
+ $user_cur = &$this->user[$i];
+ if ($user_cur->sess == '' || $user_cur->stat != 'room')
+ continue;
+
+ log_main("VALORI", "name: ".$user_cur->name." tab: ".$user_cur->table." taix: ".$table_idx." ucur: ".$user_cur." us: ".$user);
+
+ $ret = "gst.st = ".($user_cur->step+1)."; ";
+ if ($user_cur->stat == "room") {
+ log_main("DOCUMENT.index.php", "from table");