}
function create($idx, $name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
- // error_log("User::create BEGIN", 0);
-
if (($thiz = new User()) == FALSE)
return (FALSE);
static function load_data($id, $sess)
{
- // error_log("User::load_data BEGIN", 0);
-
log_main("load_data: id [".$id."] sess [".($sess == FALSE ? "FALSE" : $sess)."] ");
$doexit = FALSE;
break;
}
log_only("user == ".($user == FALSE ? "FALSE" : "TRUE")." user === ".($user === FALSE ? "FALSE" : "TRUE")." user isset ".(isset($user) ? "TRUE" : "FALSE"));
- if (isset($user))
- log_only("bri count ".count($user));
if ($user == FALSE) {
log_only("INIT MAIN DATA");
$shm = FALSE;
- // var_dump($user);
- // error_log("User::save_data BEGIN", 0);
-
if (($tok = @ftok(FTOK_PATH."/user".$id, "B")) == -1) {
return (FALSE);
}
log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE"));
if ($authenticate != FALSE) {
- // error_log(print_r(&$authenticate, TRUE),0);
$user_type = $authenticate->type_get();
}
else {
GLOBAL $sess;
$doexit = FALSE;
- // error_log("Room::load_data BEGIN", 0);
-
do {
if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1) {
log_main("ftok failed");
log_only("INIT MAIN DATA");
shm_detach($shm);
- // error_log("DE CHE", 0);
-
$room = Room::create();
if (Room::save_data($room) == FALSE)
$ret = FALSE;
$shm = FALSE;
- // var_dump($room);
- // error_log("Room::save_data BEGIN", 0);
-
if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1)
return (FALSE);
{
GLOBAL $G_lang;
+ $ret = "";
+
$mins = floor($secs / 60);
$secs = $secs % 60;
if ($G_lang == 'en') {
/* if it exists check for a valid challenge */
if (($a_sem = Challenges::lock_data()) != FALSE) {
- // error_log("loop-2", 0);
if (($chals = &Challenges::load_data()) != FALSE) {
- // error_log("loop-1", 0);
for ($e = 0 ; $e < $chals->item_n ; $e++) {
- // error_log("loop", 0);
log_main("challenge[".$e."]: ".$chals->item[$e]->login);
if (strcmp($login, $chals->item[$e]->login) == 0) {
- // error_log("loop2", 0);
log_main("login_verify [".$pass."] with [".md5($chals->item[$e]->token.$user_obj->pass)."]");
if (strcmp($pass, md5($chals->item[$e]->token.$user_obj->pass)) == 0) {
- // error_log("loop3", 0);
log_main("login_verify SUCCESS for ".$login);
$chals->rem($login);
$ret = LoginDBItem::LoginDBItemFromRecord($user_obj);
- // error_log("dbitem: ".print_r($ret, TRUE));
break;
}
}
} // end for ($e = 0 ...
- // error_log("end loop-1", 0);
}
if ($chals->ismod()) {
function ImpPoints($s)
{
- // error_log($s, 0);
$arr = explode('|', $s);
- // error_log("TTOK: ".count($arr), 0);
if (count($arr) != 20) {
- // error_log("COUNT: ".count($arr));
return FALSE;
}
static function load_data($tab_id, $id, $sess)
{
- // error_log("Bin5_user::load_data BEGIN id [".$id."]", 0);
-
- log_main("load_data: tab_id [".$tab_id."] id [".$id."] sess [".($sess == FALSE ? "FALSE" : $sess)."] ");
+ log_main("Bin5_user::load_data: tab_id [".$tab_id."] id [".$id."] sess [".($sess == FALSE ? "FALSE" : $sess)."] ");
$doexit = FALSE;
do {
break;
}
log_only("user == ".($user == FALSE ? "FALSE" : "TRUE")." user === ".($user === FALSE ? "FALSE" : "TRUE")." user isset ".(isset($user) ? "TRUE" : "FALSE"));
- if (isset($user))
- log_only("bri count ".count($user));
if ($user == FALSE) {
log_only("INIT MAIN DATA");
$shm = FALSE;
- // var_dump($user);
- // error_log("Bin5_user::save_data BEGIN id [".$id."]", 0);
-
if (($tok = @ftok(FTOK_PATH."/bin5/table".$tab_id."/user".$id, "B")) == -1) {
return (FALSE);
}
$doexit = FALSE;
$shm = FALSE;
- log_wr("TABLE_IDX ".FTOK_PATH."/bin5/table".$table_idx."/table");
+ log_wr("TABLE_FTOK ".FTOK_PATH."/bin5/table".$table_idx."/table");
do {
if (($tok = @ftok(FTOK_PATH."/bin5/table".$table_idx."/table", "B")) == -1) {
return (FALSE);
}
- // error_log("maincheck: step di i [".$proxy_step['i']."]", 0);
-
// log_rd2("M");
/* Sync check (read only without modifications */
ignore_user_abort(TRUE);
log_lock("P");
$S_load_stat['U_heavy']++;
- // if (($bri = &Bin5::load_data($table_idx, $table_token)) == FALSE)
- // if (($user = Bin5_user::load_data($table_idx, $table_token)) == FALSE)
if (($user = Bin5_user::load_data($table_idx, $proxy_step['i'], $sess)) == FALSE) {
break;
}
$sem = Bin5::lock_data($table_idx);
-if (($bri = &Bin5::load_data($table_idx,$table_token)) == FALSE) {
+if (($bri = Bin5::load_data($table_idx,$table_token)) == FALSE) {
echo "Bin5 Load data error";
log_wr("Bin5 Load data error");
Bin5::unlock_data($sem);
}
$argz = explode('|', $mesg);
-log_wr('POSTSPLIT: '.$argz[0]);
+log_wr('POSTSPLIT: '.$argz[0].' user->stat: ['.$user->stat.']');
log_mop($user->step, 'bin::index_wr.php: after get_user()');
if (false && $argz[0] == 'shutdown') {
log_rd2("bin5/index_wr.php: AUTO LOGOUT.");
if ($user->stat == 'table') {
- $bri->table_wakeup(&$user);
+ $bri->table_wakeup($user);
// to force the logout
$user->lacc = 0;
}
*********************/
else if ($user->stat == 'table') {
$user->laccwr = time();
- $table = &$bri->table[$user->table];
+ $table = $bri->table[$user->table];
if ($argz[0] == 'tableinfo') {
log_wr("PER DI TABLEINFO");
FROM %sbin5_matches as m, %sbin5_games as g
WHERE g.mcode = m.code GROUP BY m.code, m.ttok",
$G_dbpfx, $G_dbpfx, $G_dbpfx);
- // error_log($mtc_sql, 0);
if (pg_query($bdb->dbconn->db(), $mtc_sql) == FALSE) {
log_crit("statadm: temporary matches table creation [$mtc_sql] failed");
break;
$tmt_sql = sprintf("SELECT * FROM %sbin5_temp_matches WHERE tstamp < to_timestamp(%d)",
$G_dbpfx, $curtime - TRI_LIMIT);
- // error_log($tmt_sql, 0);
// if deletable old matches exists then ...
if (($tmt_pg = pg_query($bdb->dbconn->db(), $tmt_sql)) != FALSE) {
$mtc_sql = sprintf("SELECT * from %sbin5_matches WHERE code = %d",
$G_dbpfx, $tmt_obj->code);
- // error_log($mtc_sql, 0);
if (($mtc_pg = pg_query($bdb->dbconn->db(), $mtc_sql)) == FALSE || pg_numrows($mtc_pg) != 1) {
log_crit("statadm: matches row select failed");
break;
Room::unlock_data($sem);
exit;
}
-if (($user = &$room->get_user($sess, &$idx)) == FALSE) {
+if (($user = $room->get_user($sess, &$idx)) == FALSE) {
Room::unlock_data($sem);
$argz = explode('|', xcapemesg($mesg));
log_wr("postsave bri");
}
// change room
- $room->room_sitdown(&$user, $table_idx);
-
- log_wr("MOP finish");
-
+ $room->room_sitdown($user, $table_idx);
+ log_wr("MOP finish");
}
else if ($argz[0] == 'logout') {
$user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";