From: Matteo Nastasi (mop) Date: Mon, 14 Mar 2011 20:20:53 +0000 (+0100) Subject: remove all reference operator because with php5 pass by reference is the default... X-Git-Tag: 3.4.3~5 X-Git-Url: http://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=44f4d1b333ecb3cc3c3666cc5acb2422edcf029d remove all reference operator because with php5 pass by reference is the default for classes --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 7ccecb7..3f65f17 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -1172,7 +1172,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 +1182,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); @@ -1250,7 +1250,7 @@ class Room { } - function room_wakeup(&$user) + function room_wakeup($user) { $table_idx = $user->table; $table = &$this->table[$table_idx]; @@ -1297,7 +1297,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; @@ -1484,14 +1484,14 @@ 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 != -1 && $table->player_n == PLAYERS_N) { @@ -1536,7 +1536,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; @@ -1855,7 +1855,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') @@ -2189,7 +2189,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; diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index 0c36306..06f737e 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -323,7 +323,7 @@ class Table_briskin5 extends Table { log_main("bunch_make end"); } - function init(&$userarr) + function init($userarr) { /* MOVED INTO SPAWN $this->mazzo = rand(0,PLAYERS_N-1); @@ -334,14 +334,14 @@ class Table_briskin5 extends Table { */ for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) { $this->total[$i] = 0; - $user_cur = &$userarr[$this->player[$i]]; + $user_cur = $userarr[$this->player[$i]]; $user_cur->exitislock = TRUE; } log_main("table::init: ci siamo"); } - function game_init(&$userarr) + function game_init($userarr) { log_rd2("GSTART 4"); @@ -359,7 +359,7 @@ class Table_briskin5 extends Table { for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) { $this->asta_pla[$i] = TRUE; - $user_cur = &$userarr[$this->player[$i]]; + $user_cur = $userarr[$this->player[$i]]; $user_cur->subst = 'asta'; $user_cur->asta_card = -2; $user_cur->asta_pnt = -1; @@ -394,9 +394,9 @@ class Table_briskin5 extends Table { } - function exitlock_show(&$userarr, $table_pos) + function exitlock_show($userarr, $table_pos) { - $ct = $this->exitlock_calc(&$userarr, $table_pos); + $ct = $this->exitlock_calc($userarr, $table_pos); $ret = sprintf('exitlock_show(%d, %s);', $ct, ($userarr[$this->player[$table_pos]]->exitislock ? 'true' : 'false')); @@ -527,14 +527,14 @@ class Briskin5 { exit; } - $user =& $room->user; - $table =& $room->table[$table_idx]; + $user = $room->user; + $table = $room->table[$table_idx]; log_wr("Briskin5 constructor"); for ($i = 0 ; $i < $table->player_n ; $i++) { $user[$table->player[$i]]->table_token = $table_token; - $this->user[$i] =& User_briskin5::spawn(&$user[$table->player[$i]], $table_idx, $i); + $this->user[$i] =& User_briskin5::spawn($user[$table->player[$i]], $table_idx, $i); } $this->table[0] =& Table_briskin5::spawn(&$table); @@ -583,7 +583,7 @@ class Briskin5 { if ($force || $this->garbage_timeout < $curtime) { for ($i = 0 ; $i < BRISKIN5_MAX_PLAYERS ; $i++) { - $user_cur = &$this->user[$i]; + $user_cur = $this->user[$i]; if ($user_cur->sess == "" || ($user_cur->stat == 'table' && ($user_cur->subst == 'shutdowned' || $user_cur->subst == 'shutdowner'))) continue; @@ -613,7 +613,7 @@ class Briskin5 { } // $user->bantime = $user->laccwr + BAN_TIME; - $this->table_wakeup(&$user_cur); + $this->table_wakeup($user_cur); } } } @@ -791,7 +791,7 @@ class Briskin5 { } - function chatt_send(&$user, $mesg) + function chatt_send($user, $mesg) { GLOBAL $mlang_brisk, $G_lang; @@ -820,7 +820,7 @@ class Briskin5 { // update local graph // update remote graphs for ($i = 0 ; $i < BRISKIN5_MAX_PLAYERS ; $i++) { - $user_cur = &$this->user[$i]; + $user_cur = $this->user[$i]; // if ($user_cur->sess == '' || $user_cur->stat != 'room') if ($user_cur->sess == '') continue; @@ -908,7 +908,7 @@ class Briskin5 { } } - function table_wakeup(&$user) + function table_wakeup($user) { $table = &$this->table[0]; @@ -1085,7 +1085,7 @@ Examples of $is_transition, $is_again: function show_table(&$room, &$user, $sendstep, $is_transition, $is_again) { $table_idx = $user->table; - $table = &$room->table[$table_idx]; + $table = $room->table[$table_idx]; $table_pos = $user->table_pos; $ret = "table_init();"; @@ -1317,7 +1317,7 @@ function show_table_info(&$room, &$table, $table_pos) GLOBAL $G_lang, $mlang_bin5_bin5; $ret = ""; - $user = &$room->user[$table->player[$table_pos]]; + $user = $room->user[$table->player[$table_pos]]; $pnt_min = $table->points_n - MAX_POINTS < 0 ? 0 : $table->points_n - MAX_POINTS; $noty = sprintf(''); @@ -1497,7 +1497,7 @@ function game_result($asta_pnt, $pnt) } } -function log_points($curtime, &$user, $where, $mesg) +function log_points($curtime, $user, $where, $mesg) { GLOBAL $_SERVER; diff --git a/web/briskin5/Obj/placing.phh b/web/briskin5/Obj/placing.phh index d6d6547..01ee168 100644 --- a/web/briskin5/Obj/placing.phh +++ b/web/briskin5/Obj/placing.phh @@ -105,7 +105,7 @@ define(SUBTY_FREQ_LO, 0); define(SUBTY_FREQ_HI, 1); -function placings_show(&$user) +function placings_show($user) { $mtime = placing_time(); $tm = placing_date($mtime); @@ -251,7 +251,7 @@ function placing_show_file($user, $ty, $subty) // // -function placing_show_pgsql(&$user, $ty, $subty) +function placing_show_pgsql($user, $ty, $subty) { GLOBAL $G_dbpfx; @@ -304,7 +304,7 @@ function placing_show_pgsql(&$user, $ty, $subty) return ($ret); } -function placing_show(&$user, $ty, $subty) +function placing_show($user, $ty, $subty) { GLOBAL $G_dbasetype; diff --git a/web/index_rd.php b/web/index_rd.php index 88c740b..9b82158 100644 --- a/web/index_rd.php +++ b/web/index_rd.php @@ -296,7 +296,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if ($user->subst == 'sitdown') { log_load("ROOM WAKEUP"); - $room->room_wakeup(&$user); + $room->room_wakeup($user); } else if ($user->subst == 'standup') $room->room_outstandup(&$user); diff --git a/web/index_wr.php b/web/index_wr.php index 9ac86bf..6d61c01 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -192,7 +192,7 @@ if ($argz[0] == 'shutdown') { log_rd2("AUTO LOGOUT."); if ($user->subst == 'sitdown' || $user->stat == 'table') - $room->room_wakeup(&$user); + $room->room_wakeup($user); else if ($user->subst == 'standup') $room->room_outstandup(&$user); else { @@ -656,10 +656,10 @@ else if ($user->stat == 'room') { **********************/ else if ($user->subst == 'sitdown') { if ($argz[0] == 'wakeup') { - $room->room_wakeup(&$user); + $room->room_wakeup($user); } else if ($argz[0] == 'logout') { - $room->room_wakeup(&$user); + $room->room_wakeup($user); $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; $user->comm[$user->step % COMM_N] .= 'postact_logout();'; $user->the_end = TRUE;