$user_cur = &$this->user[$table->player[$i]];
log_main("PREIMPOST: INLOOP name: ".$user_cur->name);
- if ($user_cur != $user) {
+ if ($user->idx_get() != $table->player[$i]) {
$user_cur->stat_set("room");
$user_cur->subst = "sitdown";
$user_cur->laccwr = $curtime;
// log_main("VALORI: name: ".$user_cur->name."from_table: ".$from_table." tab: ".$user_cur->table." taix: ".$table_idx." ucur: ".$user_cur." us: ".$user);
$ret = "gst.st = ".($user_cur->step+1)."; ".($remove_wagon ? sprintf("tra.rem(%d);",$table_idx) : "");
- if ($from_table && ($user_cur->table == $table_idx || $user_cur == $user)) {
+ if ($from_table && ($user_cur->table == $table_idx || $user->idx_get() == $i)) {
$ret .= 'gst.st_loc++; the_end=true; window.onunload = null; window.onbeforeunload = null; document.location.assign("index.php");|';
// $ret .= 'gst.st_loc++; document.location.assign("index.php");|';
log_main("DOCUMENT.index.php: from table");
// $ret .= table_act_content(FALSE, 0, $table_idx, $user->table, FALSE);
$ret .= $table->act_content($user);
- if ($user_cur == $user) {
+ if ($user->idx_get() == $i) {
// set the new status
$ret .= 'subst = "standup"; tra.show(); ';
// clean the action buttons in other tables
$user_cur->table = -1;
$user_wup[$user_wup_n++] = &$user_cur;
- $remove_wagon = false;
- if($table->wag_own == $user_cur) {
- $remove_wagon = true;
+ $remove_wagon = FALSE;
+ if($table->wag_own == $table->player[$i]) {
+ $remove_wagon = TRUE;
$table->wag_reset($curtime);
}
}
- $user_tab[$user_tab_n++] = &$user_cur;
+ $user_tab[$user_tab_n++] = $table->player[$i];
}
}
for ($tab_idx = 0 ; $tab_idx < $user_tab_n ; $tab_idx++)
- if ($user_cur == $user_tab[$tab_idx])
- break;
+ if ($user_tab[$tab_idx] == $i)
+ break;
// for users that wakeup the room will be reconstructed by index_rd.php
if ($tab_idx < $user_tab_n) {
if ($table_idx > -1)
$ret .= $this->table_content($user_cur, $table_idx);
- if ($user_cur == $user) {
+ if ($user->idx_get() == $i) {
$itin = ($user->flags & USER_FLAG_AUTH ? "<i>" : "");
$itou = ($user->flags & USER_FLAG_AUTH ? "</i>" : "");
$ret .= sprintf('$("myname").innerHTML = "<b>%s%s%s</b>: ";', $itin, xcape($user->name), $itou);
$ret .= $this->table_content($user_cur, $table_idx);
$ret .= $this->standup_content($user_cur);
- if ($user_cur == $user) {
+ if ($user->idx_get() == $i) {
$ret .= 'subst = "sitdown"; tra.hide(); ';
// clean the action buttons in other tables
for ($e = 0 ; $e < TABLES_N ; $e++) {
$user_cur = $this->user[$i];
if ($target != "" && $user_cur->name != $target)
continue;
- // if ($user_cur->sess == '' || $user_cur->stat != 'room')
- if ($user_cur->sess == '' || $user_cur->stat == 'table' || $user_cur == $user)
+ if ($user_cur->sess == '' || $user_cur->stat == 'table' || $user->idx_get() == $i)
continue;
if ($is_normchat == TRUE) {
if ($user_cur->stat == 'room') {
$user_cur->comm[$user_cur->step % COMM_N] = "gst.st = ".($user_cur->step+1)."; ".$this->standup_content($user_cur);
- if ($user_cur == $user) {
+ if ($user->idx_get() == $i) {
$itin = ($user->flags & USER_FLAG_AUTH ? "<i>" : "");
$itou = ($user->flags & USER_FLAG_AUTH ? "</i>" : "");
$content = "[ ";
for ($i = 0 ; $i < $table->player_n ; $i++) {
- $user_cur = &$this->user[$table->player[$i]];
-
- $flags = $user_cur->flags;
-
- if ($user_cur == $user)
- $flags |= 1;
-
- log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx));
-
- $content .= sprintf('%s[ %d, "%s" ]',($i == 0 ? '' : ', '), $flags, xcape($user_cur->name));
+ $user_cur = &$this->user[$table->player[$i]];
+
+ $flags = $user_cur->flags;
+
+ if ($user->idx_get() == $table->player[$i])
+ $flags |= 1;
+
+ log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx));
+
+ $content .= sprintf('%s[ %d, "%s" ]',($i == 0 ? '' : ', '), $flags, xcape($user_cur->name));
}
$content .= ' ]';