$users[$gam_obj->asta_win]['login'] : ""),
$gam_obj->friend, ($gam_obj->friend != -1 ?
$users[$gam_obj->friend]['login'] : ""),
- $gam_obj->pnt, $gam_obj->asta_pnt);
+ $gam_obj->pnt, $gam_obj->asta_pnt, $gam_obj->tourn_pts);
// update matches with new ttok and table idx
$mtc_sql = sprintf("UPDATE %sbin5_matches SET (ttok, tidx) = ('%s', %d) WHERE code = %d RETURNING *;",
/*
* games management
*/
- $gam_sql = sprintf("INSERT INTO %sbin5_games (mcode, tstamp, act, asta_pnt, pnt, asta_win, friend, mazzo, mult)
- VALUES (%d, to_timestamp(%d), %d, %d, %d, %d, %d, %d, %d) RETURNING *;",
+ $gam_sql = sprintf("INSERT INTO %sbin5_games (mcode, tstamp, act, asta_pnt, pnt, asta_win, friend, mazzo, mult, tourn_pts)
+ VALUES (%d, to_timestamp(%d), %d, %d, %d, %d, %d, %d, %d, %d) RETURNING *;",
$G_dbpfx, $mtc_obj->code, $date, $action,
$table->old_asta_pnt, $table->old_pnt,
$table->old_asta_win,
$table->old_friend,
- $table->old_mazzo, $table->old_mult);
+ $table->old_mazzo, $table->old_mult,
+ $table->old_tourn_pts);
if (($gam_pg = $this->query($gam_sql)) == FALSE || pg_affected_rows($gam_pg) != 1) {
log_crit(sprintf("bin5_points_save: failed at insert game [%s]", $gam_sql));
break;
'info_curr' => array( 'it' => '%3$smano corrente%4$s',
'en' => '%3$scurrent hand%4$s'),
// br, hr, b, /b, win, fri
- 'info_part' => array( 'it' => 'Ha chiamato %3$s%5$s%4$s, il socio era %3$s%6$s%4$s,%1$s',
- 'en' => 'The declarer was %3$s%5$s%4$s, the partner was %3$s%6$s%4$s,%1$s'),
+ 'info_part' => array( 'it' => 'Ha chiamato %3$s%5$s%4$s (punti torneo %7$d), il socio era %3$s%6$s%4$s,%1$s',
+ 'en' => 'The declarer was %3$s%5$s%4$s (tournment points %7$d), the partner was %3$s%6$s%4$s,%1$s'),
// br, hr, b, /b
'info_capp' => array( 'it' => 'hanno fatto %3$scappotto%4$s EBBRAVI!.%1$s',
'en' => 'and they made %3Dscapot%4$s WELL DONE!.%1$s'),
'en' => 'lost'),
// br, hr, b, /b, win_name
- 'info_alon' => array( 'it' => '%3$s%5$s%4$s si è chiamato in mano,%1$s',
- 'en' => '%3$s%5$s%4$s play alone against each other,%1$s'),
+ 'info_alon' => array( 'it' => '%3$s%5$s%4$s si è chiamato in mano (punti torneo %6$d),%1$s',
+ 'en' => '%3$s%5$s%4$s play alone against each other (tournment points %6$d),%1$s'),
// br, hr, b, /b, old_asta_pnt, old_pnt, winornot
'info_aleaa' => array( 'it' => 'doveva fare %3$salmeno %5$d%4$s punti e ne ha fatti %3$s%6$d%4$s: ha %3$s%7$s%4$s.%1$s',
'en' => 'he/she had to do %3$sat least %5$d%4$s points and they had made %3$s%6$d%4$s: he/she had %3$s%7$s%4$s.%1$s'),
var $asta_win; // the caller idx position at table
var $briscola;
+ var $tourn_pts; // points in the caller hand
var $friend; // the callee idx position at table
var $match_id; // the id of the match on the database (-1 == just not saved)
var $old_asta_win; // the old caller idx position at table
var $old_friend; // the old callee idx position at table
+ var $old_tourn_pts; // the old tournment computed points in the hand of caller
+
function Bin5_table()
{
}
$thiz->total = array( 0, 0, 0, 0, 0);
$thiz->asta_win = -1;
$thiz->briscola = -1;
+ $thiz->tourn_pts = -1;
$thiz->friend = -1;
$thiz->turn = 0;
$thiz->asta_win = $from->asta_win;
$thiz->briscola = $from->briscola;
+ $thiz->tourn_pts = $from->tourn_pts;
$thiz->friend = $from->friend;
$thiz->match_id = $from->match_id;
$this->asta_pnt = 60;
$this->asta_win = -1;
$this->briscola = -1;
+ $this->tourn_pts = -1;
$this->friend = -1;
$this->turn = 0;
// $this->old_mult, $this->old_pnt, $this->old_reason and $this->old_asta_win are specific
$this->old_friend = $this->friend;
+ $this->old_tourn_pts = $this->tourn_pts;
+
$this->old_reason = game_description($action, 'html', $this->old_mult,
$this->old_asta_win,
($this->old_asta_win != -1 ?
$this->old_friend,
($this->old_friend != -1 ?
$bri->user[$this->player[$this->old_friend]]->name : ""),
- $this->old_pnt, $this->old_asta_pnt);
+ $this->old_pnt, $this->old_asta_pnt, $this->old_tourn_pts);
if ($user->table_orig < TABLES_AUTH_N) {
}
function game_description($act, $form, $old_mult, $win = -1, $win_name = "?1?", $fri = -1, $fri_name = "?2?",
- $old_pnt = -1, $old_asta_pnt = -1)
+ $old_pnt = -1, $old_asta_pnt = -1, $old_tourn_pts = -1)
{
GLOBAL $G_lang, $mlang_bin5_bin5;
$noty .= sprintf($mlang_bin5_bin5['info_part'][$G_lang],
$tg_br, $tg_hr, $tg_bo, $tg_bc,
$win_name,
- $fri_name);
+ $fri_name,
+ $old_tourn_pts);
if ($old_pnt == 120) {
$noty .= sprintf($mlang_bin5_bin5['info_capp'][$G_lang],
$tg_br, $tg_hr, $tg_bo, $tg_bc );
else {
$noty .= sprintf($mlang_bin5_bin5['info_alon'][$G_lang],
$tg_br, $tg_hr, $tg_bo, $tg_bc,
- $win_name);
+ $win_name,
+ $old_tourn_pts);
if ($old_pnt == 120) {
$noty .= sprintf($mlang_bin5_bin5['info_acap'][$G_lang],
$tg_br, $tg_hr, $tg_bo, $tg_bc);