+ $change_page = TRUE;
+ log_load($sess, "resync from index.php");
+
+ if (isset($table_idx)) {
+ $table_idx = (int)$table_idx;
+ log_load($sess, "SET TABLE_IDX <yy".$table_idx.">".TABLES_N);
+ if ($table_idx >= 0 && $table_idx < TABLES_N) {
+ log_load($sess, "SET TABLE_IDX GOOD VALUE");
+ $bri_sem = Briskin5::lock_data($table_idx);
+ $bri = &Briskin5::load_data($table_idx);
+
+ if (($bri_user = &$bri->get_user($sess, &$bri_idx)) != FALSE) {
+ if ($bri_user->subst == "shutdowned" || $bri_user->subst == "shutdowner") {
+ // QUI WAKEUP
+ $table = &$room->table[$user->table];
+ $bri_table = &$bri->table[0];
+
+ for ($i = 0 ; $i < $bri_table->player_n ; $i++) {
+ $room->user[$table->player[$i]]->subst = $bri->user[$i]->subst;
+ $room->user[$table->player[$i]]->step = $bri->user[$i]->step;
+ $room->user[$table->player[$i]]->trans_step = $bri->user[$i]->step+1;
+ log_load($sess, "from table bri subst[".$i."]: ".$bri->user[$i]->subst);
+ log_load($sess, "from table roo subst[".$i."]: ".$room->user[$table->player[$i]]->subst);
+ }
+
+ $room->room_join_wakeup(&$user);
+
+ if (Room::save_data(&$room) == FALSE) {
+ echo "ERRORE SALVATAGGIO\n";
+ exit;
+ }
+
+ $change_page = FALSE;
+ }
+ log_load($sess, "from table subst: ".$bri_user->subst);
+ }
+ Briskin5::unlock_data($bri_sem);
+ }
+ }
+ log_load($sess, "unlock Room");
+ if ($change_page) {
+ Room::unlock_data($sem);
+ header ("Location: table.php");
+ exit;
+ }