- $curtime = time();
- $user_wup = array();
- $user_wup_n = 0;
- $user_tab = array();
- $user_tab_n = 0;
- 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->is_empty()) {
- continue;
- }
- if ($update_lacc == TRUE) {
- $user_cur->laccwr = $curtime;
- }
- log_main("cur: ".$user_cur->name." subst: ".$user_cur->subst);
- 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_wup_n++] = $user_cur;
-
- $remove_wagon = FALSE;
- if($table->wag_own == $table->player[$i]) {
- $remove_wagon = TRUE;
- $table->wag_reset($curtime);
- }
- }
- $user_tab[$user_tab_n++] = $table->player[$i];
- }
-
- for ($wup_idx = 0 ; $wup_idx < $user_wup_n ; $wup_idx++)
- $table->user_rem($this, $user_wup[$wup_idx]);
-
- /* aggiorna l'array dei giocatori al tavolo. */
-
- for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- log_main("START LOOP");
- $user_cur = $this->user[$i];
- if ($user_cur->is_active() == FALSE || $user_cur->stat != 'room') { // is not active user or the stat isn't 'room'
- log_main("name: ".$user_cur->name."skip subst: ".$user_cur->subst);
- continue;
- }
-
- log_main("___");
- log_main("VALORI name: ".$user_cur->name." tab: ".$user_cur->table." taix: ".$table_idx);
-
- $ret = "gst.st = ".($user_cur->step+1)."; ".($remove_wagon ? sprintf("tra.rem(%d);",$table_idx) : "");
- if ($user_cur->stat == "room") {
- log_main("DOCUMENT.index.php from table");
-
- $ret .= $this->table_content($user_cur, $table_idx);
- $ret .= $this->standup_content($user_cur);
-
- $ret .= $table->act_content($user_cur);
-
-
- for ($tab_idx = 0 ; $tab_idx < $user_tab_n ; $tab_idx++)
- if ($user_tab[$tab_idx] == $i)
- break;