X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=733b5faa5ca9801c0e64d88655d2af1a662995b2;hb=225d405fc65a983470f3d690ea7ea0ca6a3d7779;hp=2c060d241e1df4f7b02efcf0353b7d81c31842d6;hpb=2866ca461e9916336ef73fd199210955ab34cbb6;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 2c060d2..733b5fa 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -1561,46 +1561,27 @@ class Room { } if ($to_tabl) { - // FIXME BRISK4: include for each kind of table - require_once("${G_base}briskin5/Obj/briskin5.phh"); - // 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) { - log_main("PLAYERS == N TABLE ".$table_idx); - - if (($sem = Bin5::lock_data(TRUE, $table_idx)) != FALSE) { - log_main("bin5 lock data success"); - - $no_recovery = FALSE; - if (($bri = Bin5::load_data($table_idx)) != FALSE) { - if ($table_cur->table_token != $bri->table_token) { - log_main("ERROR: not matching table_token. Room: ".$table_cur->table_token." Table: ".$bri->table_token); - $bri = FALSE; - } - } - - if ($bri != FALSE) { - $bri_table = $bri->table[0]; - for ($i = 0 ; $i < $bri_table->player_n ; $i++) { - // stat must be "table" by definition - $bri_user = $bri->user[$i]; + // FIXME BRISK4: include for each kind of table + require_once("${G_base}briskin5/Obj/briskin5.phh"); + // Before all align times with table timeout + for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) { + if (isset($this->match[$table_idx])) { + $bri = $this->match[$table_idx]; + + $bri_table = $bri->table[0]; + for ($i = 0 ; $i < $bri_table->player_n ; $i++) { + // stat must be "table" by definition + $bri_user = $bri->user[$i]; - if ($target != "" && $bri_user->name != $target) - continue; - log_main("writa: ".$user_mesg); - $bri_user->comm[$bri_user->step % COMM_N] = "gst.st = ".($bri_user->step+1)."; "; - $bri_user->comm[$bri_user->step % COMM_N] .= $to_tabl; - $bri_user->step_inc(); - } - Bin5::save_data($bri); - } - Bin5::unlock_data($sem); - } // bri::lock_data - } // if ($table_cur->player_n == PLAYERS_N) { - } // for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) { + if ($target != "" && $bri_user->name != $target) + continue; + log_main("writa: ".$user_mesg); + $bri_user->comm[$bri_user->step % COMM_N] = "gst.st = ".($bri_user->step+1)."; "; + $bri_user->comm[$bri_user->step % COMM_N] .= $to_tabl; + $bri_user->step_inc(); + } + } // if (isset($this->match + } // for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) { } // if ($to_tabl == true ... if ($update_room) { @@ -1736,6 +1717,7 @@ class Room { $ghost_user = $this->user[$ghost]; $curtime = time(); + $ghost_user->comm[$ghost_user->step % COMM_N] = ""; $ghost_user->step_inc(); if ($sess == "") { $sess = uniqid(""); @@ -1748,18 +1730,16 @@ class Room { // If user at the table we need to update the table data too $table_idx = $ghost_user->table; if ($ghost_user->stat == "table" && $this->table[$table_idx]->player_n == PLAYERS_N) { - // FIXME BRISK4: include for each kind of table - require_once("${G_base}briskin5/Obj/briskin5.phh"); - if (($brisem = Bin5::lock_data(TRUE, $table_idx)) != FALSE) { - if (($bri = Bin5::load_data($table_idx)) != FALSE) { - if ($bri->the_end != TRUE) { - $bri->user[$ghost_user->table_pos]->step_inc(); - $bri->user[$ghost_user->table_pos]->sess = $sess; - Bin5::save_data($bri); - } + require_once("${G_base}briskin5/Obj/briskin5.phh"); + if (isset($this->match[$table_idx])) { + $bri = $this->match[$table_idx]; + + if ($bri->the_end != TRUE) { + $bri->user[$ghost_user->table_pos]->comm[$bri->user[$ghost_user->table_pos]->step % COMM_N] = ""; + $bri->user[$ghost_user->table_pos]->step_inc(); + $bri->user[$ghost_user->table_pos]->sess = $sess; + } } - Bin5::unlock_data($brisem); - } } $idx = $ghost;