$ret = array();
for ($i = 0 ; $i < 40 ; $i++) {
- $ret[$i] = new Card($i, 'bunch', 'no_owner');
+ $ret[$i] =& new Card($i, 'bunch', 'no_owner');
}
- return ($ret);
+ $oret = &$ret;
+ return ($oret);
}
function bunch_make()
$this->user = array();
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- $this->user[$i] = new User("", "");
+ $this->user[$i] =& new User("", "");
}
for ($i = 0 ; $i < TABLES_N ; $i++)
- $this->table[$i] = new Table();
+ $this->table[$i] =& new Table();
$this->garbage_timeout = 0;
}
if (strcmp($sess, $this->user[$i]->sess) == 0) {
// find it
$idx = $i;
- return ($this->user[$i]);
+ $ret = &$this->user[$i];
+ return ($ret);
}
}
log_main($sess, sprintf("get_user: Wrong sess from page [%s]",$PHP_SELF));
if ($idx != -1 && $i == MAX_PLAYERS) {
/* SUCCESS */
+ $curtime = time();
if ($sess == "") {
$this->user[$idx]->sess = uniqid("");
$sess = $this->user[$idx]->sess;
$this->user[$idx]->name = $name_new;
$this->user[$idx]->stat = "room";
$this->user[$idx]->subst = "standup";
- $this->user[$idx]->laccwr = time();
+ $this->user[$idx]->lacc = $curtime;
+ $this->user[$idx]->laccwr = $curtime;
$this->user[$idx]->bantime = 0;
log_main("XXX", sprintf("TROVATO LIBERO A [%d] sess [%s] name [%s]", $idx, $sess, $name_new));
function init_data()
{
- $brisco = new brisco();
+ $brisco =& new brisco();
return $brisco;
}
shm_detach($shm);
- return ($bri);
+ $ret = &$bri;
+ return ($ret);
}
return (NULL);