X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fbriskin5%2FObj%2Fbriskin5.phh;h=94d0788f4a49bc12561a89e480beea986f88eede;hb=d74b7138ed4d14834b26355a7f5d9350bc96ee44;hp=7988b8af951644b8f0c2ad7b7aed853ed7dab389;hpb=46feebd77c3d3ae776b5b517aeefebee37c5e42a;p=brisk.git
diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh
index 7988b8a..94d0788 100644
--- a/web/briskin5/Obj/briskin5.phh
+++ b/web/briskin5/Obj/briskin5.phh
@@ -37,8 +37,13 @@ define('BIN5_RULES_ALLPASS', 2);
$mlang_bin5_bin5 = array(
// br, hr, b, /b, win, fri
- 'info_part' => array( 'it' => 'Nell\'ultima mano ha chiamato %3$s%5$s%4$s, il socio era %3$s%6$s%4$s,%1$s',
- 'en' => 'In the last hand the declarer was %3$s%5$s%4$s, the partner was %3$s%6$s%4$s,%1$s'),
+ 'info_last' => array( 'it' => '%3$sultima mano%4$s',
+ 'en' => '%3$slast hand%4$s'),
+ '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'),
// 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'),
@@ -57,8 +62,8 @@ $mlang_bin5_bin5 = array(
'en' => 'lost'),
// br, hr, b, /b, win_name
- 'info_alon' => array( 'it' => 'Nell\'ultima partita %3$s%5$s%4$s si è chiamato in mano,%1$s',
- 'en' => 'In the last hand %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,%1$s',
+ 'en' => '%3$s%5$s%4$s play alone against each other,%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'),
@@ -628,8 +633,12 @@ class Bin5_table extends Table {
$this->old_friend = $this->friend;
$this->old_reason = game_description($action, 'html', $this->old_mult,
- $this->old_asta_win, $bri->user[$this->player[$this->old_asta_win]]->name,
- $this->old_friend, $bri->user[$this->player[$this->old_friend]]->name,
+ $this->old_asta_win,
+ ($this->old_asta_win != -1 ?
+ $bri->user[$this->player[$this->old_asta_win]]->name : ""),
+ $this->old_friend,
+ ($this->old_friend != -1 ?
+ $bri->user[$this->player[$this->old_friend]]->name : ""),
$this->old_pnt, $this->old_asta_pnt);
@@ -1001,13 +1010,11 @@ class Bin5_user extends User {
return (sprintf('xstm.stop(); window.onbeforeunload = null; window.onunload = null; document.location.assign("%s");', $page));
}
- protected function maincheck($cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_subst, &$new_step, $splashdate, $table_idx, $table_token)
+ protected function maincheck($get, $post, $cookie)
{
- GLOBAL $G_lang, $mlang_indrd;
+ GLOBAL $G_lang;
GLOBAL $G_with_splash, $G_splash_content, $G_splash_interval, $G_splash_idx;
GLOBAL $G_splash_w, $G_splash_h, $G_splash_timeout;
- $CO_splashdate = "CO_splashdate".$G_splash_idx;
- $$CO_splashdate = $splashdate;
GLOBAL $S_load_stat;
@@ -1017,14 +1024,14 @@ class Bin5_user extends User {
$curtime = time();
/* Nothing changed, return. */
- if ($cur_step == $this->step)
+ if ($this->rd_step == $this->step)
return (FALSE);
- log_rd2("do other cur_stat[".$cur_stat."] user->stat[".$this->stat."] cur_step[".$cur_step."] user_step[".$this->step."]");
+ log_rd2("do other cur_stat[".$this->rd_stat."] user->stat[".$this->stat."] cur_step[".$this->rd_step."] user_step[".$this->step."]");
- if ($cur_step == -1) {
+ if ($this->rd_step == -1) {
/*
- * if $cur_step == -1 load the current state from the main struct
+ * if $this->rd_step == -1 load the current state from the main struct
*/
$S_load_stat['wR_minusone']++;
@@ -1035,7 +1042,7 @@ class Bin5_user extends User {
if ($this->trans_step != -1) {
log_rd2("TRANS USATO ".$this->trans_step);
- $cur_step = $this->trans_step;
+ $this->rd_step = $this->trans_step;
$this->trans_step = -1;
}
else {
@@ -1045,7 +1052,7 @@ class Bin5_user extends User {
/* this part I suppose is read only on $this->room structure */
- if ($cur_step == -1) {
+ if ($this->rd_step == -1) {
log_rd2("PRE-NEWSTAT");
/***************
@@ -1061,33 +1068,33 @@ class Bin5_user extends User {
}
log_rd2("NEWSTAT: ".$this->stat);
- $new_stat = $this->stat;
- $new_subst = $this->subst;
- $new_step = $this->step;
- } /* if ($cur_step == -1) { */
+ $this->rd_stat = $this->stat;
+ $this->rd_subst = $this->subst;
+ $this->rd_step = $this->step;
+ } /* if ($this->rd_step == -1) { */
else {
- /* $sem = Room::lock_data(FALSE); */
+ /* $sem = Brisk::lock_data(FALSE); */
$S_load_stat['rU_heavy']++;
- if ($cur_step < $this->step) {
+ if ($this->rd_step < $this->step) {
do {
- if ($cur_step + COMM_N < $this->step) {
- if (($cur_stat != $this->stat)) {
+ if ($this->rd_step + COMM_N < $this->step) {
+ if ($this->rd_stat != $this->stat) {
$to_stat = $this->stat;
- /* Room::unlock_data($sem); */
+ /* Brisk::unlock_data($sem); */
log_load("RESYNC");
printf("xXx BIN5_USER::MAINCHECK\n");
return ($this->page_sync($this->sess, ($to_stat == "table" ? "index.php" : "../index.php"), $this->table, $this->table_token));
}
log_rd2("lost history, refresh from scratch");
printf("xXx LOST HISTORY!\n");
- $new_step = -1;
+ $this->rd_step = -1;
break;
}
- for ($i = $cur_step ; $i < $this->step ; $i++) {
+ for ($i = $this->rd_step ; $i < $this->step ; $i++) {
$ii = $i % COMM_N;
if ($this->comm[$ii] == "") {
- if ($i == $cur_step)
+ if ($i == $this->rd_step)
continue;
else
break;
@@ -1095,9 +1102,9 @@ class Bin5_user extends User {
log_rd2("ADDED TO THE STREAM: ".$this->comm[$ii]);
$ret .= $this->comm[$ii];
}
- $new_stat = $this->stat;
- $new_subst = $this->subst;
- $new_step = $this->step;
+ $this->rd_stat = $this->stat;
+ $this->rd_subst = $this->subst;
+ $this->rd_step = $this->step;
} while (0);
log_rd2($this->step, 'index_rd.php: after ret set');
@@ -1121,14 +1128,14 @@ class Bin5_user extends User {
} /* if ($this->the_end == TRUE) { ... */
} /* if ($this->the_end == TRUE) { ... */
- } /* if ($cur_step < $this->step) { */
+ } /* if ($this->rd_step < $this->step) { */
- /* Room::unlock_data($sem); */
- } /* else of if ($cur_step == -1) { */
+ /* Brisk::unlock_data($sem); */
+ } /* else of if ($this->rd_step == -1) { */
return ($ret);
- } // function maincheck (...
+ } // function maincheck(...
function continue_set($match_code)
{
@@ -1160,7 +1167,7 @@ class Bin5 {
var $delay_mgr;
- function Bin5 ($room, $table_idx, $table_token, $get, $post, $cookie) {
+ function Bin5($brisk, $table_idx, $table_token, $get, $post, $cookie) {
$this->user = array();
$this->table = array();
@@ -1171,8 +1178,8 @@ class Bin5 {
exit;
}
- $user = $room->user;
- $table = $room->table[$table_idx];
+ $user = $brisk->user;
+ $table = $brisk->table[$table_idx];
log_wr("Bin5 constructor");
@@ -1476,7 +1483,6 @@ class Bin5 {
break;
case "index_wr.php":
- // FIXME $content can be unset
if (isset($table_idx) && isset($table_token)) {
if (($bri = $s_a_p->app->match_get($table_idx, $table_token)) != FALSE) {
ob_start();
@@ -1495,7 +1501,7 @@ class Bin5 {
return TRUE;
break;
- case "index_rd_ifra.php":
+ case "index_rd.php":
if (($transp = gpcs_var('transp', $get, $post, $cookie)) === FALSE)
$transp = "iframe";
if ($transp == 'websocket')
@@ -1824,6 +1830,11 @@ function show_table_info(&$bri, &$table, $table_pos)
{
GLOBAL $G_lang, $mlang_bin5_bin5;
+ $tg_br = "
";
+ $tg_hr = "