X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbriskin5%2Findex_wr.php;h=9d5b4633c91c337b7366520241ad0f62436712d7;hb=64dd84d3ef203e8e4cf3166de00a580cfed11bf7;hp=9f070f9fb28236794a2a17d5c8205b5f69648bf2;hpb=faf9feed79ac32b41afc6bf4c954f92a028ab4ed;p=brisk.git diff --git a/web/briskin5/index_wr.php b/web/briskin5/index_wr.php index 9f070f9..9d5b463 100644 --- a/web/briskin5/index_wr.php +++ b/web/briskin5/index_wr.php @@ -2,7 +2,10 @@ /* * brisk - index_wr.php * - * Copyright (C) 2006 matteo.nastasi@milug.org + * Copyright (C) 2006-2008 Matteo Nastasi + * mailto: nastasi@alternativeoutput.it + * matteo.nastasi@milug.org + * web: http://www.alternativeoutput.it * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,8 +25,15 @@ */ require_once("../Obj/brisk.phh"); +// require_once("../Obj/proxyscan.phh"); require_once("Obj/briskin5.phh"); +// Use of proxies isn't allowed. +// if (is_proxy()) { +// sleep(5); +// exit; +//} + if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') { echo "Debugging time!"; exit; @@ -40,7 +50,14 @@ if ($table_idx < 0 || $table_idx >= TABLE_N) exit; $sem = Briskin5::lock_data($table_idx); -$bri = &Briskin5::load_data($table_idx,$table_token); + +if (($bri = &Briskin5::load_data($table_idx,$table_token)) == FALSE) { + echo "Bin5 Load data error"; + log_wr("Bin5 Load data error"); + Briskin5::unlock_data($sem); + exit; +} + if (($user = &$bri->get_user($sess, &$idx)) == FALSE) { echo "Get User Error"; log_wr("Get User Error"); @@ -96,7 +113,7 @@ else if ($user->stat == 'table') { if ($lockcalc < 3) { $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; $user->comm[$user->step % COMM_N] .= $table->exitlock_show(&$bri->user, $user->table_pos); - $user->comm[$user->step % COMM_N] .= show_notify("
I dati presenti sul server non erano allineati con quelli inviati dal tuo browser, adesso lo sono. Riprova ora.", 2000, "Torna alla partita.", 400, 100); + $user->comm[$user->step % COMM_N] .= show_notify("
I dati presenti sul server non erano allineati con quelli inviati dal tuo browser, adesso lo sono. Riprova ora.", 2000, "torna alla partita.", 400, 100); log_wr($user->comm[$user->step % COMM_N]); $user->step_inc(); @@ -133,7 +150,7 @@ else if ($user->stat == 'table') { log_wr(sprintf("GIOCO FINITO !!!")); $table->mult *= 2; - $table->old_reason = sprintf("Ha lasciato %s perche` aveva al massimo 2 punti.", $user->name); + $table->old_reason = sprintf("Ha lasciato %s perché aveva al massimo 2 punti.", xcape($user->name)); $table->game_next(); $table->game_init(&$bri->user); @@ -394,11 +411,10 @@ else if ($user->stat == 'table') { $turn_nex = ($table->gstart + $table->turn) % BRISKIN5_PLAYERS_N; log_wr(sprintf("The winner is: [%d] [%s]", $winner, $bri->user[$table->player[$winner]]->name)); - $card_take = sprintf("sleep(gst,2000);|cards_take(%d);|cards_hidetake($d);", - $winner, $winner); - $player_cur = "remark_off();" . $card_take . "|"; + $card_take = sprintf("sleep(gst,2000);|cards_take(%d);|", $winner); + $player_cur = "remark_off();" . $card_take; if ($turn_cur != $turn_nex) - $player_nex = $card_play . $card_take . "|"; + $player_nex = $card_play . $card_take; else $player_nex = ""; if ($table->turn < (BRISKIN5_PLAYERS_N * 8)) /* game NOT finished */ @@ -426,12 +442,13 @@ else if ($user->stat == 'table') { $retar[$i] = $ret; } - - - if ($table->turn == (BRISKIN5_PLAYERS_N * 8)) { /* game finished */ log_wr(sprintf("GIOCO FINITO !!!")); + $plist = "$table->table_token|$user->table|$table->player_n"; + $curtime = time(); + log_legal($curtime, $user->sess, $user->name, "STAT:FINISH_GAME", $plist); + /* ************************************************ */ /* PRIMA LA PARTE PER LO SHOW DI CHI HA VINTO */ /* ************************************************ */