X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=9fd938cc768bb97d93d513113e55529d8a3354d1;hb=c85b1d8abd5f5faa5f28da4931e1975e40fa26b0;hp=eeac879b7df9dd04b6fd7011ad57407d4efdbec1;hpb=b1f99ee20cc9d9bafc1811aaca227909cccba904;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index eeac879..9fd938c 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -153,12 +153,12 @@ $mlang_brisk = array( 'btn_backstand'=> array( 'it' => 'torna in piedi', $G_lng = langtolng($G_lang); $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 ); -$G_brisk_version = "4.15.0"; +$G_brisk_version = "4.17.0"; /* MLANG: ALL THE INFO STRINGS IN brisk.phh */ -$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': primo passo per rendere più robusto il sistema di notifica.', +$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': gestione accessi da sistemi di anonimizzazione, nuovi termini di utilizzo.', 'Se vuoi iscriverti alla Mailing List, cliccala!' ), - 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: new users subscription system, refactored sidebanner system.', + 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: engine refactoring and logout message.', 'If you want to subscribe our Mailing List, click it!' ) ); $G_room_help = array( 'it' => ' @@ -983,11 +983,12 @@ class Client_prefs { } } -define('GHOST_SESS_TOUT', 300); +define('GHOST_SESS_TOUT', 1800); define('GHOST_SESS_REAS_LOUT', 1); // logout define('GHOST_SESS_REAS_ANOT', 2); // another user get session define('GHOST_SESS_REAS_TOUT', 3); // room timeout define('GHOST_SESS_REAS_TTOT', 4); // table timeout +define('GHOST_SESS_REAS_ANON', 5); // anonymizer access class GhostSessEl { @@ -1805,6 +1806,68 @@ class Brisk } } + function kickuser($user, $out_reas) + { + $curtime = time(); + + fprintf(STDERR, "MOP: GHOST_SESS: %d\n", $out_reas); + + $this->ghost_sess->push($curtime, $user->sess, $out_reas); + + fprintf(STDERR, "MOP: status out: %s %s %d\n", $user->stat, $user->subst, $user->idx); + if ($user->stat == 'table' && $user->subst != 'sitdown') { + $bin5 = &$this->match[$user->table]; + $user_bin5 = &$bin5->user[$user->table_pos]; + fprintf(STDERR, "MOP: status in: %s %s %d\n", $user_bin5->stat, $user_bin5->subst, $user_bin5->idx); + $bin5->table_wakeup($user_bin5); + $user->the_end = TRUE; + $this->room_wakeup($user); + return; + } + + if ($user->stat == 'table' || $user->stat == 'room') { + $user->the_end = TRUE; + if ($user->subst == 'sitdown' || $user->stat == 'table') { + $this->room_wakeup($user); + } + else if ($user->subst == 'standup') { + fprintf(STDERR, "MOP: KICK here [%s]\n", btrace_line(debug_backtrace())); + $this->room_outstandup($user); + } + else { + log_rd2("LOGOUT FROM WHAT ???"); + } + } + } + + function kickuser_by_name($name, $out_reas) + { + for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { + $user_out = $this->user[$i]; + if (strcmp($user_out->name, $name) == 0) { + return ($this->kickuser($user_out, $out_reas)); + } + } + return FALSE; + } + + function kickuser_by_sess($sess, $out_reas) + { + for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { + $user_out = $this->user[$i]; + if (strcmp($user_out->sess, $sess) == 0) { + return ($this->kickuser($user_out, $out_reas)); + } + } + return FALSE; + } + + function kickuser_by_idx($idx, $out_reas) + { + $user_out = $this->user[$idx]; + return ($this->kickuser($user_out, $out_reas)); + } + function chatt_send($user, $mesg) { GLOBAL $G_base, $G_alarm_passwd, $mlang_brisk, $G_lang; @@ -1870,35 +1933,9 @@ class Brisk // just for development use currently else if (FALSE && strncmp($msg, "/out ", 5) == 0) { fprintf(STDERR, "MOP OUT\n"); - $target = substr($msg, 5); - for ($i = 0 ; $i < MAX_PLAYERS ; $i++) { - $user_out = $this->user[$i]; - if (!strcmp($user_out->name, $target)) { - - $user_out->the_end = TRUE; - fprintf(STDERR, "MOP: GHOST_SESS: %d\n", GHOST_SESS_REAS_LOUT); - $this->ghost_sess->push($curtime, $user_out->sess, GHOST_SESS_REAS_LOUT); - - if ($user_out->stat == 'table' || $user_out->stat == 'room') { - if ($user_out->subst == 'sitdown' || $user_out->stat == 'table') { - $this->room_wakeup($user_out); - } - else if ($user_out->subst == 'standup') { - $this->room_outstandup($user_out); - } - else { - log_rd2("LOGOUT FROM WHAT ???"); - } - } - - fprintf(STDERR, "MOP: OUT FIND [%s] step %d rd_step %d\n", $target, $user_out->step, $user_out->rd_step); - break; - } - } + $target = substr($msg, 5); + $this->kickuser_by_name($target, GHOST_SESS_REAS_ANON); } - - - else if (strncmp($msg, "/alarm ", 7) == 0) { if (strncmp($msg, "/alarm to ", 10) == 0) { $sp_pos = strpos($msg, " ", 10); @@ -2139,10 +2176,27 @@ class Brisk $to_user = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape("== chat ban ==")); } else { - $to_user = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape($msg)); - // temporary silentiation for troll (will became array check) - // if (strcasecmp($user->name,'JackRokka') != 0 && $user->sess != '47ea653f602e8') - $to_room = $to_user; + if ( TRUE && (! $user->is_auth()) ) { + $to_user = nickserv_msg($dt, xcape("Visto l'elevato numero di molestatori che ultimamente hanno preso dimora su Brisk abbiamo deciso")); + $to_user .= nickserv_msg($dt, xcape("di disattivare temporaneamente la chat in room per i non registrati, non ce ne vogliate e buone feste.")); + $aug_head = array("Tanti", "Tantissimi", "Un enormità", "Un milione", "Un' esagerazione"); + $aug_body = array("a tutti gli utenti", "a tutti gli uomini", "a tutte le donne", "a tutti gli utenti"); + $aug_tail = array("di Brisk", "del sito", "della ciurma", "della comitiva", "del gruppo"); + + $auguri = sprintf("%s auguri %s %s.", + $aug_head[mt_rand(0, count($aug_head)-1)], + $aug_body[mt_rand(0, count($aug_body)-1)], + $aug_tail[mt_rand(0, count($aug_tail)-1)]); + + $to_room = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), + xcape($auguri)); + } + else { + $to_user = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape($msg)); + // temporary silentiation for troll (will became array check) + // if (strcasecmp($user->name,'JackRokka') != 0 && $user->sess != '47ea653f602e8') + $to_room = $to_user; + } } log_legal($curtime, $user->ip, $user, @@ -2273,7 +2327,7 @@ class Brisk * if ($idx == -3 && ret == FALSE) => wrong password * if ($idx == -1 && ret == FALSE) => no space left * if ($idx == 0 && ret == user) => SUCCESS - * if ($idx == -$idx && ret == user) => SUCCESS (but the login exists in the auth db) + * if ($idx == -($idx + 1) && ret == user) => SUCCESS (but the login exists in the auth db) */ function add_user(&$sess, &$idx, $name, $pass, $ip, $header, $cookie)