define('BIN5_RULES_FINISH', 0);
define('BIN5_RULES_ABANDON', 1);
define('BIN5_RULES_ALLPASS', 2);
+define('BIN5_RULES_ASTA', 3);
require_once("rules_base.phh");
require_once("rules_old_rules.phh");
}
}
- function engine(&$bri, $curtime, $action, $user)
+ function rules_asta(&$bri, $curtime, $action, $user, &$ret_s, $a_card, $a_pnt) {
+ if ($a_card >= 0 && $a_card < 9 && $a_card > $this->table->asta_card)
+ return TRUE;
+ else if ($a_card == 9 && $a_pnt > ($this->table->asta_pnt >= 61 ? $this->table->asta_pnt : 60) && $a_pnt <= 120)
+ return TRUE;
+
+ return FALSE;
+ }
+
+ function engine(&$bri, $curtime, $action, $user, &$opt1 = NULL, &$opt2 = NULL, &$opt3 = NULL)
{
GLOBAL $G_all_points, $G_dbasetype;
$table = $this->table;
$pnts_sav = array();
+ if ($action == BIN5_RULES_ASTA) {
+ return ($this->rules_asta($bri, $curtime, $action, $user, &$opt1, $opt2, $opt3));
+ }
if ($action == BIN5_RULES_ALLPASS) { // return TRUE if all correct
$table->old_act = $action;
$table->old_asta_win = -1;
function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie)
{
GLOBAL $G_base, $G_dbasetype, $G_ban_list, $G_black_list;
+ GLOBAL $mlang_indwr, $G_lang;
$remote_addr = addrtoipv4($remote_addr_full);
$again = FALSE;
}
else if ($a_card <= 9) {
- if ($a_card >= 0 && $a_card < 9 && $a_card > $table->asta_card)
+ $ret_s = "";
+ if ($table->rules->engine(&$bin5, $curtime, BIN5_RULES_ASTA, $user, $ret_s, $a_card, $a_pnt)) {
$again = FALSE;
- else if ($a_card == 9 && $a_pnt > ($table->asta_pnt >= 61 ? $table->asta_pnt : 60) && $a_pnt <= 120)
- $again = FALSE;
-
+ }
if ($again == FALSE) {
log_wr("NUOVI ORZI.");
if ($again) { // Qualcosa non andato bene, rifare
$ret = sprintf('gst.st = %d; asta_pnt_set(%d);', $user->step+1,
($table->asta_pnt > 60 ? $table->asta_pnt + 1 : 61) );
+ if ($ret_s != "") {
+ $ret .= show_notify($ret_s, 0, $mlang_indwr['btn_close'][$G_lang], 400, 150);
+ }
$user->comm[$user->step % COMM_N] = $ret;
$user->step_inc();