+ // Before all align times with table timeout
+ for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) {
+ $table_cur =& $this->table[$table_idx];
+ // if the table is complete and exists its shared mem we get the info about users lacc
+ if ($table_cur->player_n == PLAYERS_N) {
+ if (($sem = Briskin5::lock_data($table_idx)) != FALSE) {
+ if (($bri = &Briskin5::load_data($table_idx)) != FALSE) {
+ if ($bri->garbage_manager(TRUE) == TRUE) {
+ // if garbaged you need to save data
+ Briskin5::save_data(&$bri);
+ if ($bri->is_abandoned()) {
+ // FIXME recovery of room and clean of the table
+ /*
+
+ #
+ # KILL USERS
+ #
+
+ if ($user_cur->lacc + EXPIRE_TIME_RD < $curtime) { // Auto logout dell'utente
+ log_rd2($user_cur->sess, "AUTO LOGOUT.");
+
+ if ($user_cur->stat == 'table' || $user_cur->stat == 'room') {
+ log_auth($user_cur->sess, "Autologout session.");
+
+ $tmp_sess = $user_cur->sess;
+ $user_cur->sess = "";
+ step_unproxy($tmp_sess);
+ $user_cur->name = "";
+ $user_cur->step = 0;
+ $user_cur->the_end = FALSE;
+
+ log_rd2($user_cur->sess, "AUTO LOGOUT.");
+ if ($user_cur->subst == 'sitdown' || $user_cur->stat == 'table')
+ $this->room_wakeup(&$user_cur);
+ else if ($user_cur->subst == 'standup')
+ $this->room_outstandup(&$user_cur);
+ else
+ log_rd2($sess, "LOGOUT FROM WHAT ???");
+ }
+ }
+
+ #
+ # destroy shared
+ #
+
+ Briskin5::destroy_data($user->table);
+
+
+ */
+ }
+ }
+ $table_bri = &$bri->table[0];
+ for ($i = 0 ; $i < PLAYERS_N ; $i++) {
+ $this->user[$table_cur->player[$i]]->lacc =
+ $bri->user[$table_bri->player[$i]]->lacc;
+ }
+ }
+ Briskin5::unlock_data($sem);
+ }
+ }
+ }
+