X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbriskin5%2FObj%2Fbriskin5.phh;h=ee69b35cf57fc8c4880f48f82be6eeb09f79442b;hb=8dae4c3ee7fdb23c9780191e7e51343553033a93;hp=e247e93135619ccd0cf6e2e6ab6134e625726128;hpb=2df71753e1e8eeb36d37ac21eba24df8f25a8d32;p=brisk.git diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index e247e93..ee69b35 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -567,7 +567,7 @@ class Bin5_table extends Table { log_wr(sprintf("PRO: [%d]", $pro)); // PATTA case ! - if ($this->asta_pnt == 61 && $pro == 60) { + if (game_result($this->asta_pnt, $pro) == 0) { $this->points[$this->points_n % MAX_POINTS] = array(); for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) { $this->points[$this->points_n % MAX_POINTS][$i] = 0; @@ -575,6 +575,7 @@ class Bin5_table extends Table { } $this->points_n++; $this->old_pnt = $pro; + $this->old_asta_win = $this->asta_win; $this->mult_inc(1); break; @@ -1078,7 +1079,6 @@ class Bin5_user extends User { $this->rd_step = $this->step; } /* if ($this->rd_step == -1) { */ else { - /* $sem = Brisk::lock_data(FALSE); */ $S_load_stat['rU_heavy']++; if ($this->rd_step < $this->step) { @@ -1086,7 +1086,6 @@ class Bin5_user extends User { if ($this->rd_step + COMM_N < $this->step) { if ($this->rd_stat != $this->stat) { $to_stat = $this->stat; - /* 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)); @@ -1135,7 +1134,6 @@ class Bin5_user extends User { } /* if ($this->the_end == TRUE) { ... */ } /* if ($this->rd_step < $this->step) { */ - /* Brisk::unlock_data($sem); */ } /* else of if ($this->rd_step == -1) { */ @@ -1230,7 +1228,32 @@ class Bin5 { return (FALSE); } + function banned_kickoff() + { + $is_ban = FALSE; + + for ($i = 0 ; $i < BIN5_MAX_PLAYERS ; $i++) { + $user_cur = $this->user[$i]; + + // check if the IP is blacklisted + if ($this->brisk->black_check($user_cur->ip)) { + $user_cur->lacc = 0; + $is_ban = TRUE; + continue; + } + // if authorized not check if banlisted + if ($user_cur->flags & USER_FLAG_AUTH) { + continue; + } + + if ($this->brisk->ban_check($user_cur->ip)) { + $user_cur->lacc = 0; + $is_ban = TRUE; + } + } + return ($is_ban); + } function garbage_manager($force) { @@ -1451,7 +1474,7 @@ class Bin5 { static function request_mgr(&$s_a_p, $header, &$header_out, &$new_socket, $path, $addr, $get, $post, $cookie) { - GLOBAL $G_black_list; + GLOBAL $G_ban_list, $G_black_list; printf("NEW_SOCKET (root): %d\n", intval($new_socket)); @@ -1976,10 +1999,11 @@ function briscola_show($bri, $table, $user) function game_result($asta_pnt, $pnt) { + $sixty = 60; if ($asta_pnt == 61) { - if ($pnt > 60) + if ($pnt > $sixty) return (1); - else if ($pnt == 60) + else if ($pnt == $sixty) return (0); else return (-1);