+ if ($asta_pnt == 61) {
+ if ($pnt > 60)
+ return (1);
+ else if ($pnt == 60)
+ return (0);
+ else
+ return (-1);
+ }
+ else {
+ if ($pnt >= $asta_pnt)
+ return (1);
+ else
+ return (-1);
+ }
+}
+
+function log_points($remote_addr, $curtime, $user, $where, $mesg)
+{
+ if (($fp = @fopen(LEGAL_PATH."/points.log", 'a')) != FALSE) {
+ /* Unix time | session | nickname | IP | where was | mesg */
+ fwrite($fp, sprintf("%ld|%s|%s|%s|%s|%s|%s|\n", $curtime, $user->sess,
+ ($user->flags & USER_FLAG_AUTH ? 'A' : 'N'),
+ $user->name, $remote_addr, $where , $mesg));
+ fclose($fp);
+ }
+}
+
+function game_description($act, $form, $old_mult, $win = -1, $win_name = "?1?", $fri = -1, $fri_name = "?2?",
+ $old_pnt = -1, $old_asta_pnt = -1)
+{
+ GLOBAL $G_lang, $mlang_bin5_bin5;
+
+ if ($form == 'html') {
+ $tg_br = "<br>";
+ $tg_hr = "<hr>";
+ $tg_bo = "<b>";
+ $tg_bc = "</b>";
+ $win_name = xcape($win_name);
+ $fri_name = xcape($fri_name);
+ }
+ else {
+ $tg_br = " ";
+ $tg_hr = " ";
+ $tg_bo = "";
+ $tg_bc = "";
+ }
+
+ if ($act == BIN5_RULES_OLDSCHEMA) {
+ return ("");
+ }
+ else if ($act == BIN5_RULES_ALLPASS) {
+ return (sprintf($mlang_bin5_bin5['info_alpa'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc));
+ }
+ else if ($act == BIN5_RULES_ABANDON) {
+ return (sprintf($mlang_bin5_bin5['info_aban'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ $win_name));
+ }
+ else {
+ $wol = game_result($old_asta_pnt, $old_pnt);
+
+ $noty = "";
+
+ if ($win != $fri) { // not alone case
+ /* MLANG: "<hr>Nell'ultima mano ha chiamato <b>%s</b>, il socio era <b>%s</b>,<br>", "hanno fatto <b>cappotto</b> EBBRAVI!.<hr>", "dovevano fare <b>%s</b> punti e ne hanno fatti <b>%d</b>: hanno <b>%s</b>.<hr>", "<hr>Nell'ultima mano <b>%s</b> si è chiamato in mano,<br>", "ha fatto <b>cappotto</b> EBBRAVO!.<hr>", "doveva fare <b>%s</b> punti e ne ha fatti <b>%d</b>: ha <b>%s</b>.<hr>", ($table->old_asta_pnt > 61 ? "almeno ".$table->old_asta_pnt : 'più di 60'), $table->old_pnt, ($wol == 1 ? "vinto" : ($wol == 0 ? "pareggiato" : "perso" */
+
+ $noty .= sprintf($mlang_bin5_bin5['info_part'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ $win_name,
+ $fri_name);
+ if ($old_pnt == 120) {
+ $noty .= sprintf($mlang_bin5_bin5['info_capp'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc );
+ }
+ else {
+ if ($old_asta_pnt > 61) {
+ $noty .= sprintf($mlang_bin5_bin5['info_alea'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ $old_asta_pnt, $old_pnt,
+ ($wol == 1 ? $mlang_bin5_bin5['info_win'][$G_lang] :
+ ($wol == 0 ? $mlang_bin5_bin5['info_peer'][$G_lang] :
+ $mlang_bin5_bin5['info_lost'][$G_lang])));
+ }
+ else {
+ $noty .= sprintf($mlang_bin5_bin5['info_more'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ $old_pnt,
+ ($wol == 1 ? $mlang_bin5_bin5['info_win'][$G_lang] :
+ ($wol == 0 ? $mlang_bin5_bin5['info_peer'][$G_lang] :
+ $mlang_bin5_bin5['info_lost'][$G_lang])));
+ } // else of if ($old_asta_pnt > 61) {
+ } // else of if ($old_pnt == 120) {
+ } // if ($win != $fri) { // not alone case
+ else {
+ $noty .= sprintf($mlang_bin5_bin5['info_alon'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ $win_name);
+ if ($old_pnt == 120) {
+ $noty .= sprintf($mlang_bin5_bin5['info_acap'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc);
+ }
+ else {
+ if ($old_asta_pnt > 61) {
+ $noty .= sprintf($mlang_bin5_bin5['info_aleaa'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ $old_asta_pnt, $old_pnt,
+ ($wol == 1 ? $mlang_bin5_bin5['info_win'][$G_lang] :
+ ($wol == 0 ? $mlang_bin5_bin5['info_peer'][$G_lang] :
+ $mlang_bin5_bin5['info_lost'][$G_lang])));
+ }
+ else {
+ $noty .= sprintf($mlang_bin5_bin5['info_morea'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ $old_pnt,
+ ($wol == 1 ? $mlang_bin5_bin5['info_win'][$G_lang] :
+ ($wol == 0 ? $mlang_bin5_bin5['info_peer'][$G_lang] :
+ $mlang_bin5_bin5['info_lost'][$G_lang])));
+ }
+ }
+ }
+ }
+
+ $old_multer = Bin5_table::s_multer($old_mult, $old_asta_pnt);
+ if ($old_multer > 1) {
+ $noty .= sprintf($mlang_bin5_bin5['info_omul'][$G_lang],
+ $tg_br, $tg_hr, $tg_bo, $tg_bc,
+ multoval($old_multer));
+ }
+ $noty .= sprintf('%2$s', $tg_br, $tg_hr);
+
+ return ($noty);