X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2FObj%2Fbrisk.phh;h=73e514746b9de5ac7571d59a16220bb1a3fa5de6;hb=5f6e075fb3dc321ee1fdbbefc744647339f19645;hp=82a95ce3ac650631139b6b6b0cab623119087564;hpb=1e3ae80924342e436b2100e5631e6fd58d4af79d;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index 82a95ce..73e5147 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -393,7 +393,7 @@ class Table {
$thiz->player_n = 0;
$thiz->auth_only = FALSE;
- $thiz->wag_own = NULL;
+ $thiz->wag_own = -1;
$thiz->wag_com = "";
$thiz->wag_tout = 0;
@@ -462,11 +462,11 @@ class Table {
return ($thiz);
}
- function wag_set($user, $mesg)
+ function wag_set($user_idx, $mesg)
{
log_main("WAG_SET");
- $this->wag_own = $user;
+ $this->wag_own = $user_idx;
$this->wag_com = $mesg;
$this->wag_tout = 0;
}
@@ -476,7 +476,7 @@ class Table {
log_main("WAG_RESET");
unset($this->wag_own);
- $this->wag_own = NULL;
+ $this->wag_own = -1;
$this->wag_com = "";
$this->wag_tout = $timeout;
}
@@ -694,8 +694,10 @@ class User {
$i_start = (1 > ($from->step - COMM_N) ? 1 : ($from->step - COMM_N));
for ($i = $i_start ; $i < $from->step ; $i++) {
- $ii = $i % COMM_N;
- $this->comm[$ii] = $from->comm[$ii];
+ $ii = $i % COMM_N;
+ if (isset($from->comm[$ii])) {
+ $this->comm[$ii] = $from->comm[$ii];
+ }
}
$this->asta_card = $from->asta_card;
$this->asta_pnt = $from->asta_pnt;
@@ -1172,7 +1174,7 @@ class Room {
log_rd2("AUTO LOGOUT.");
if ($user_cur->subst == 'sitdown' || $user_cur->stat == 'table')
- $this->room_wakeup(&$user_cur);
+ $this->room_wakeup($user_cur);
else if ($user_cur->subst == 'standup')
$this->room_outstandup(&$user_cur);
else
@@ -1182,7 +1184,7 @@ class Room {
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);
+ $this->room_wakeup($user_cur);
$user_cur->comm[$user_cur->step % COMM_N] = "gst.st = ".($user_cur->step+1)."; ";
/* MLANG:
Sei stato inattivo per ".(EXPIRE_TIME_SMAMMA/60.0)." minuti.
Quindi ritorni tra i Giocatori in piedi.", "torna ai tavoli" */
$user_cur->comm[$user_cur->step % COMM_N] .= show_notify($mlang_brisk['tabtout_a'][$G_lang].(EXPIRE_TIME_SMAMMA/60.0).$mlang_brisk['tabtout_b'][$G_lang], 0, $mlang_brisk['btn_backstand'][$G_lang], 400, 100);
@@ -1239,8 +1241,8 @@ class Room {
// $ret .= table_act_content(($user->subst == 'standup'), $this->table[$i]->player_n, $i, $user->table,
// ($this->table[$i]->auth_only == FALSE ? TRUE : $user->flags & USER_FLAG_AUTH));
$ret .= $this->table[$i]->act_content($user);
- if ($this->table[$i]->wag_own != NULL)
- $ret .= sprintf('tra.add(%d, "%s: %s"); ', $i, $this->table[$i]->wag_own->name, $this->table[$i]->wag_com);
+ if ($this->table[$i]->wag_own != -1)
+ $ret .= sprintf('tra.add(%d, "%s: %s"); ', $i, $this->user[$this->table[$i]->wag_own]->name, $this->table[$i]->wag_com);
else
$ret .= sprintf('tra.rem(%d); ', $i);
}
@@ -1250,7 +1252,7 @@ class Room {
}
- function room_wakeup(&$user)
+ function room_wakeup($user)
{
$table_idx = $user->table;
$table = &$this->table[$table_idx];
@@ -1286,11 +1288,10 @@ class Room {
$user->laccwr = $curtime;
}
- $remove_wagon = false;
- if($table->wag_own == $user) {
- $remove_wagon = true;
+ $remove_wagon = FALSE;
+ if($table->wag_own == $user->idx_get()) {
$table->wag_reset($curtime);
-
+ $remove_wagon = TRUE;
}
@@ -1298,7 +1299,7 @@ class Room {
$table->user_rem(&$this, &$user);
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- $user_cur = &$this->user[$i];
+ $user_cur = $this->user[$i];
if ($user_cur->sess == '' || $user_cur->stat != 'room')
continue;
@@ -1485,24 +1486,23 @@ class Room {
log_main("table_update: post");
}
- function room_sitdown(&$user, $table_idx)
+ function room_sitdown($user, $table_idx)
{
log_main("room_sitdown ".($user == FALSE ? "USER: FALSE" : "USER: ".$user->name));
$train_app = "";
if ($table_idx > -1 && $table_idx < TABLES_N) {
- $table = &$this->table[$table_idx];
+ $table = $this->table[$table_idx];
// wagon shutdown
- if ($table->wag_own != NULL && $table->player_n == PLAYERS_N) {
+ if ($table->wag_own != -1 && $table->player_n == PLAYERS_N) {
for ($i = 0 ; $i < TABLES_N ; $i++) {
- $user_cur =& $this->user[$table->player[$i]];
- if ($user_cur == $table->wag_own) {
- $train_app = sprintf("tra.rem(%d); ", $table_idx);
- $table->wag_reset(time());
- break;
- }
+ if ($table->wag_own == $table->player[$i]) {
+ $train_app = sprintf("tra.rem(%d); ", $table_idx);
+ $table->wag_reset(time());
+ break;
+ }
}
}
}
@@ -1538,7 +1538,7 @@ class Room {
}
}
- function chatt_send(&$user, $mesg)
+ function chatt_send($user, $mesg)
{
GLOBAL $G_base, $G_alarm_passwd, $mlang_brisk, $G_lang;
$only_you = FALSE;
@@ -1574,7 +1574,7 @@ class Room {
$table = &$this->table[$user->table];
- if ($table->wag_own != NULL) {
+ if ($table->wag_own != -1) {
// MLANG
Il messaggio di segnalazione del tavolo è già attivato.
$msg = $mlang_brisk['tickjust'][$G_lang];
$to_user = show_notify($msg, 0, "chiudi", 400, 100);
@@ -1594,7 +1594,7 @@ class Room {
$msg = substr($msg, 5);
- $table->wag_set($user, $msg);
+ $table->wag_set($user->idx_get(), $msg);
$to_user = sprintf('tra.add(%d, "%s");', $user->table, xcape(sprintf("%s: %s", $user->name, $msg)));
$to_room = $to_user;
/* for old isolation management $is_ticker = TRUE; */
@@ -1857,7 +1857,7 @@ class Room {
if ($to_room != FALSE) {
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- $user_cur = &$this->user[$i];
+ $user_cur = $this->user[$i];
if ($target != "" && $user_cur->name != $target)
continue;
// if ($user_cur->sess == '' || $user_cur->stat != 'room')
@@ -2191,7 +2191,7 @@ class Room {
function standup_update($user)
{
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- $user_cur = &$this->user[$i];
+ $user_cur = $this->user[$i];
if ($user_cur->sess == '')
continue;