MAJOR |
-------+
- - BUG: pari + 72 non fa 4x ma attualmente fa 3x, da correggere
- BUG: some connection to the named socket fails
- log_legal address fix
DONE |
------+
+ TEST - BUG: pari + 72 non fa 4x ma attualmente fa 3x, da correggere
+ TEST - BUG: lurker are logged out (and remain a pending socket opened (look the spush log)
DONE - save/restore database
DONE - centralize all '<script ...' incapsulation to allow multiple transport system.
DONE - BUG: access with password from 2 diff browsers the second go in strange "page not found"
DONE - BUG: access with password from 2 diff browsers place the first in a strict loop (the
problem was a call to a static parent method instead of the overrided child method,
substitute self:: with the dynamically get class::)
- TEST - BUG: lurker are logged out (and remain a pending socket opened (look the spush log)
- TEST - garbage management
+ DONE - garbage management
DONE/FROZEN - problem with getpeer (HOSTADDR)
$G_lng = langtolng($G_lang);
$G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
-$G_brisk_version = "4.2.0";
+$G_brisk_version = "4.2.1";
/* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: adottato sac-a-push come motore per l\'invio dei dati in tempo reale, nuovo trasporto httpfile per explorer, tanti bug fixati, freeze su disco.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: adottato sac-a-push come motore per l\'invio dei dati in tempo reale, nuovo trasporto httpfile per explorer, tanti bug fixati, freeze su disco, fix del calcolo dei punti.',
'Se vuoi iscriverti alla <a target="_blank" href="mailto:ml-briscola+subscribe@milug.org">Mailing List</a>, cliccala!' ),
'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NEWS</b>: usage of reader/writer locking instead of generic exclusive locking.',
'If you want to subscribe our <a target="_blank" href="ml-briscola+subscribe@milug.org">Mailing List</a>, click it!' ) );
$thiz->asta_pla_n= -1;
$thiz->asta_card = -1;
$thiz->asta_pnt = -1;
- $thiz->mult = 1;
+ $thiz->mult = 0;
$thiz->points = array( );
$thiz->points_n = 0;
$thiz->bunch_create();
$thiz->mazzo = rand(0,PLAYERS_N-1);
$thiz->points_n = 0;
- $thiz->mult = 1;
+ $thiz->mult = 0;
$thiz->old_win = -1;
$thiz->old_reason = "";
return ($thiz);
}
+ function asta2mult($asta_pnt)
+ {
+ if ($asta_pnt > 110)
+ return (5);
+ else if ($asta_pnt > 100)
+ return (4);
+ else if ($asta_pnt > 90)
+ return (3);
+ else if ($asta_pnt > 80)
+ return (2);
+ else if ($asta_pnt > 70)
+ return (1);
+ else
+ return (0);
+ }
+
+ function multer($is_new)
+ {
+ if ($is_new) {
+ return (pow(2, $this->mult) * $this->asta2mult($this->asta_pnt));
+ }
+ else {
+ return (pow(2, $this->old_mult) * $this->asta2mult($this->old_asta_pnt));
+ }
+ }
+
// function bunch_create_old() function AND
// {
/* MOVED INTO SPAWN
$this->mazzo = rand(0,PLAYERS_N-1);
$this->points_n = 0;
- $this->mult = 1;
+ $this->mult = 0;
$this->old_win = -1;
$this->old_reason = "";
*/
}
-function asta2mult($asta_pnt)
-{
- if ($asta_pnt > 110)
- return (5);
- else if ($asta_pnt > 100)
- return (4);
- else if ($asta_pnt > 90)
- return (3);
- else if ($asta_pnt > 80)
- return (2);
- else if ($asta_pnt > 70)
- return (1);
- else
- return (0);
-}
// rendiamo qui l'elenco dei punti come return della func
function calculate_points(&$table)
$table->old_asta_pnt = $table->asta_pnt;
$table->old_mult = $table->mult;
+ // count points for the temporary 2 teams
for ($i = 0 ; $i < (BIN5_PLAYERS_N == 5 ? 40 : 24) ; $i++) {
// for ($i = 0 ; $i < 40 ; $i++) {
$ctt = $table->card[$i]->value % 10;
log_wr(sprintf("PRO: [%d]", $pro));
-
- if ($table->asta_pnt == 61 && $pro == 60) { // PATTA !
+ // PATTA case !
+ if ($table->asta_pnt == 61 && $pro == 60) {
$table->points[$table->points_n % MAX_POINTS] = array();
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
$table->points[$table->points_n % MAX_POINTS][$i] = 0;
else
$sig = -1;
- $gamult = asta2mult($table->asta_pnt);
-
$table->points[$table->points_n % MAX_POINTS] = array();
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
if ($i == $table->asta_win)
log_wr(sprintf("PRO: pt[%d][%d] = %d", $table->points_n % MAX_POINTS, $i, $pt));
- $pt = $pt * $sig * ($gamult + $table->mult) * ($pro == 120 ? 2 : 1);
+ $pt = $pt * $sig * $table->multer(TRUE) * ($pro == 120 ? 2 : 1);
- log_wr(sprintf("PRO:[%d][%d][%d]", $sig, $table->mult, ($pro == 120 ? 2 : 1)));
+ log_wr(sprintf("PRO:[%d][%d][%d]", $sig, $table->multer(TRUE), ($pro == 120 ? 2 : 1)));
$table->points[$table->points_n % MAX_POINTS][$i] = $pt;
$table->total[$i] += $pt;
}
$table->points_n++;
$table->old_pnt = $pro;
- $table->mult = 1;
+ $table->mult = 0;
return($ret);
}
($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])));
}
}
- if (($table->old_mult + asta2mult($table->old_asta_pnt)) > 1) {
- $noty .= sprintf($mlang_bin5_bin5['info_omul'][$G_lang], multoval($table->old_mult + asta2mult($table->old_asta_pnt)));
+ $old_multer = $table->multer(FALSE);
+ if ($old_multer > 1) {
+ $noty .= sprintf($mlang_bin5_bin5['info_omul'][$G_lang], $old_multer);
}
$noty .= "<hr><br>";
}
$noty .= sprintf($mlang_bin5_bin5['info_turn'][$G_lang], $unam);
}
- if (($table->mult + asta2mult($table->asta_pnt)) > 1) {
- $noty .= sprintf($mlang_bin5_bin5['info_mult'][$G_lang], multoval($table->mult + asta2mult($table->asta_pnt)));
+ $multer = $table->multer(TRUE);
+ if ($multer > 1) {
+ $noty .= sprintf($mlang_bin5_bin5['info_mult'][$G_lang], $multer );
}
$noty .= "<hr><br>";
$ret .= show_notify($noty, 3000, $mlang_bin5_bin5['btn_bkgame'][$G_lang], 500, 400);