log_wr('COMM: '.$mesg);
-
if (($CO_bin5_pref_ring_endauct = gpcs_var('CO_bin5_pref_ring_endauct', $get, $post, $cookie)) === FALSE)
$CO_bin5_pref_ring_endauct = "";
-
-
log_wr(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg));
-
if (($user = &$bin5->get_user($sess, &$idx)) == FALSE) {
echo "Get User Error";
log_wr("Get User Error");
$user->step_inc();
}
else if ($argz[0] == 'chatt') {
- $bin5->chatt_send(&$user,$mesg);
+ $bin5->chatt_send(&$user, $mesg);
}
else if ($argz[0] == 'preferences_update') {
log_wr("PER DI PREFERENCES_UPDATE");
}
else if ($user->subst == 'asta') {
if ($argz[0] == 'lascio') {
- // && $user->handpt <= 2) {
- /* $index_cur = $table->gstart % BIN5_PLAYERS_N; */
-
- /* log_wr(sprintf("GIOCO FINITO !!!")); */
-
- /* $table->mult += 1; */
- /* $table->old_reason = sprintf("Ha lasciato %s perché aveva al massimo 2 punti.", xcape($user->name)); */
-
- /* // Non si cambia mazzo se si abbandona la partita */
- /* $table->game_next(0); */
-
- /* if ($user->table_orig < TABLES_AUTH_N) { */
- /* require_once("../Obj/dbase_".$G_dbasetype.".phh"); */
-
- /* if (($bdb = BriskDB::create()) != FALSE) { */
- /* $bdb->bin5_points_save($curtime, $table, $user->table_orig, $ucodes, $pt_cur); */
- /* unset($bdb); */
- /* } */
- /* else { */
- /* log_points($remote_addr, $curtime, $user, "STAT:BRISKIN5:FINISH_GAME", "DATABASE CONNECTION FAILED"); */
- /* } */
- /* log_points($curtime, $user, "STAT:BRISKIN5:FINISH_GAME", $plist); */
- /* } */
-
- /* $table->game_init(&$bin5->user); */
-
- if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
+ if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$user_cur = &$bin5->user[$table->player[$i]];
else if ($table->asta_pla_n == 0) {
log_wr("PASSANO TUTTI!");
- if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_ALLPASS, $user)) {
+ if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_ALLPASS, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$user_cur = &$bin5->user[$table->player[$i]];
$a_brisco = $argz[1];
if ($a_brisco >= 0 && $a_brisco < (BIN5_CARD_HAND * BIN5_PLAYERS_N)) {
$table->briscola = $a_brisco;
+
+ $tourn_values = array(11, 10, 4,3,2, 1,1,1,1,1);
+ $table->tourn_pts = 0;
+ $seed = $a_brisco - ($a_brisco % 10);
+ for ($i = $seed ; $i < ($seed + min(10, BIN5_CARD_HAND * BIN5_PLAYERS_N)) ; $i++) {
+ if ($table->card[$i]->owner == $table->asta_win) {
+ $table->tourn_pts += $tourn_values[$i - $seed];
+ }
+ }
+
$table->friend = $table->card[$a_brisco]->owner;
log_wr("GSTART 2");
$table->gstart = ($table->mazzo+1) % BIN5_PLAYERS_N;
if ($table->turn == (BIN5_PLAYERS_N * BIN5_CARD_HAND)) { /* game finished */
log_wr(sprintf("GIOCO FINITO !!!"));
- if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_FINISH, $user)) {
+ if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_FINISH, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$user_cur = &$bin5->user[$table->player[$i]];
$retar[$i] .= show_table(&$bin5,&$user_cur,$user_cur->step+1,TRUE, TRUE);