X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbriskin5%2Findex_wr.php;h=48cc433421ed03639d8f3c421fbaca5ccc8b61f9;hb=c96ea8bcfeea99ab6c21cc4773ed2e550b3155d9;hp=376d5ff3a26a9712733244caa6512fb32b876665;hpb=56654ce4046453f53782a7242d7a610eaf7dfef0;p=brisk.git diff --git a/web/briskin5/index_wr.php b/web/briskin5/index_wr.php index 376d5ff..48cc433 100644 --- a/web/briskin5/index_wr.php +++ b/web/briskin5/index_wr.php @@ -99,6 +99,16 @@ else if ($user->stat == 'table') { else if ($argz[0] == 'chatt') { $bri->chatt_send(&$user,$mesg); } + else if ($argz[0] == 'preferences_update') { + GLOBAL $CO_bin5_pref_ring_endauct; + + log_wr("PER DI TABLEINFO"); + + if ($CO_bin5_pref_ring_endauct == "true") + $user->privflags |= BIN5_USER_FLAG_RING_ENDAUCT; + else + $user->privflags &= ~BIN5_USER_FLAG_RING_ENDAUCT; + } else if ($argz[0] == 'logout') { $remcalc = $argz[1]; @@ -347,6 +357,11 @@ else if ($user->stat == 'table') { $user_cur->subst = 'game'; $ret = sprintf('gst.st = %d; subst = "game";', $user_cur->step+1); + if ($user_cur->privflags & BIN5_USER_FLAG_RING_ENDAUCT) { + // $ret .= "var de_che= 33;"; + $ret .= playsound("ringbell.mp3"); + } + $ret .= sprintf('document.title = "Brisk - Tavolo %d";', $user->table_orig); /* bg of caller cell */ $ret .= briscola_show($bri, $table, $user_cur); @@ -454,14 +469,21 @@ else if ($user->stat == 'table') { 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, "STAT:FINISH_GAME", $plist); /* ************************************************ */ /* PRIMA LA PARTE PER LO SHOW DI CHI HA VINTO */ /* ************************************************ */ - calculate_points(&$table); + $pt_cur = calculate_points(&$table); + + $plist = "$table->table_token|$user->table_orig|$table->player_n"; + $curtime = time(); + for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) { + $user_cur = &$bri->user[$table->player[$i]]; + $plist .= '|'.xcapelt($user_cur->name).'|'.$pt_cur[$i]; + } + log_legal($curtime, $user, "STAT:BRISKIN5:FINISH_GAME", $plist); + if ($user->table_orig < TABLES_AUTH_N) + log_points($curtime, xcapelt($user), "STAT:BRISKIN5:FINISH_GAME", $plist); $table->game_next(); $table->game_init(&$bri->user);