X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbriskin5%2FObj%2Fbriskin5.phh;h=3e5c6859d669e9a3378a63134dd5189f8e308c86;hb=07070d61b51e6521b1a93ecedeb2e694467d9c60;hp=205a1220afc37e16d2ecd5588815deca029d6ff2;hpb=a2a413e82ec27127d9b27b03afbb7da14228cf5d;p=brisk.git diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index 205a122..3e5c685 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -2,7 +2,7 @@ /* * brisk - briskin5.phh * - * Copyright (C) 2006-2009 Matteo Nastasi + * Copyright (C) 2006-2011 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -20,8 +20,6 @@ * not, write to the Free Software Foundation, Inc, 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. * - * $Id$ - * */ define(BRISKIN5_PLAYERS_N, 3); define(BRISKIN5_MAX_PLAYERS, BRISKIN5_PLAYERS_N); @@ -577,7 +575,8 @@ class Briskin5 { function garbage_manager($force) { - + GLOBAL $G_base; + /* Garbage collector degli utenti in timeout */ $ismod = FALSE; $curtime = time(); @@ -605,6 +604,15 @@ class Briskin5 { */ + /* se gli altri utenti non erano d'accordo questo utente viene bannato */ + $remcalc = $this->table[0]->exitlock_calc(&$this->user, $user_cur->table_pos); + if ($remcalc < 3) { + require_once("${G_base}Obj/hardban.phh"); + Hardbans::add(($user_cur->flags & USER_FLAG_AUTH ? $user_cur->name : FALSE), + $user_cur->ip, $user_cur->sess, $user_cur->laccwr + BAN_TIME); + } + // $user->bantime = $user->laccwr + BAN_TIME; + $this->table_wakeup(&$user_cur); } } @@ -1251,7 +1259,7 @@ function show_table(&$room, &$user, $sendstep, $is_transition, $is_again) else $ret .= "remark_off();"; - /* WHO CALL AND WATH */ + /* WHO CALL AND WHAT */ $ret .= briscola_show($room, $table, $user); } @@ -1456,6 +1464,7 @@ function briscola_show($room, $table, $user) $ret .= sprintf($prestr, xcape($room->user[$table->player[$table->asta_win]]->name), $ptnadd); } + $ret .= sprintf('set_iscalling(%d);', ($table->asta_win - $user->table_pos + BRISKIN5_PLAYERS_N) % BRISKIN5_PLAYERS_N); $ret .= sprintf('$("caller").style.backgroundImage = \'url("img/brisk_caller_sand%d.png")\';', $table->asta_win); @@ -1488,4 +1497,17 @@ function game_result($asta_pnt, $pnt) } } +function log_points($curtime, &$user, $where, $mesg) +{ + GLOBAL $_SERVER; + + if (($fp = @fopen(LEGAL_PATH."/points.log", 'a')) != FALSE) { + /* Unix time | session | nickname | IP | where was | mesg */ + fwrite($fp, sprintf("%ld|%s|%s|%s|%s|%s|%s|\n", $curtime, $user->sess, + ($user->flags & USER_FLAG_AUTH ? 'A' : 'N'), + $user->name, $_SERVER['REMOTE_ADDR'], $where , $mesg)); + fclose($fp); + } +} + ?>