*/
log_wr('COMM: '.$mesg);
-if ($table_idx < 0 || $table_idx >= TABLE_N)
+$table_idx = (int)$table_idx;
+if ($table_idx < 0 || $table_idx >= TABLES_N)
exit;
-log_mop(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg));
+log_wr(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg));
-$sem = Bin5::lock_data($table_idx);
+$sem = Bin5::lock_data(TRUE, $table_idx);
if (($bri = Bin5::load_data($table_idx,$table_token)) == FALSE) {
echo "Bin5 Load data error";
$argz = explode('|', $mesg);
log_wr('POSTSPLIT: '.$argz[0].' user->stat: ['.$user->stat.']');
-log_mop($user->step, 'bin::index_wr.php: after get_user()');
+log_wr($user->step, 'bin::index_wr.php: after get_user()');
if (false && $argz[0] == 'shutdown') {
log_auth($user_cur->sess, "Shutdown session. delegate to room gc the autologout");
if ($table->asta_win > -1 &&
$user->table_pos == $table->asta_win) {
$a_brisco = $argz[1];
- if ($a_brisco >= 0 && $a_brisco < (BIN5_PLAYERS_N == 5 ? 40 : 24)) {
+ if ($a_brisco >= 0 && $a_brisco < 40) {
$table->briscola = $a_brisco;
$table->friend = $table->card[$a_brisco]->owner;
log_wr("GSTART 2");
}
log_wr("before save data");
Bin5::save_data($bri);
-log_mop($user->step, 'bin::index_wr.php: after save_data()');
+log_wr($user->step, 'bin::index_wr.php: after save_data()');
Bin5::unlock_data($sem);
exit;