X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=aeb839a614a515502d6590277f3859cf217603e4;hb=dd16d683733bebd22757ec97dc7af1aa046e78e5;hp=7728e1a71e6ac302af10acb3ea88be8063e344d5;hpb=01e9f212c0c1da9b5dd879c82344d5817210a773;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index 7728e1a..aeb839a 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -64,7 +64,8 @@ define(DBG_LOAD, 0x0100);
define(DBG_AUTH, 0x0200);
define(DBG_CRIT, 0x0400);
-define(BRISK_DEBUG, 0);
+// NOTE: BRISK DEBUG must be a numerical constant, not the result of operations on symbols
+define(BRISK_DEBUG, 0xffffffff);
define(BRISK_SINGLE_DEBUG,0);
define(BRISK_SINGLE_SESS, "");
@@ -75,9 +76,10 @@ require_once("$DOCUMENT_ROOT/Etc/".BRISK_CONF);
$G_false = FALSE;
$G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
-$G_brisk_version = "2.1.3 - trusty";
+$G_brisk_version = "2.1.4 - trusty";
-$root_wellarr = Array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': Garanzia dal sito e stato degli utenti (guarda l\'help).',
+/* MLANG: ALL THE INFO STRINGS IN brisk.phh */
+$root_wellarr = Array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': Aggiunto un watchdog per la rete e il tasto "reload" in room.',
'Se vuoi iscriverti alla Mailing List, cliccala!' );
$table_wellarr = Array ( 'Benvenuto al tavolo. Se almeno tre giocatori non sbloccano l\'uscita cliccando il lucchetto, chi esce non può risedersi a un qualunque tavolo per '.floor(BAN_TIME/60).' minuti.');
@@ -105,7 +107,7 @@ Dopo che è iniziata una partita per uscirne dovete chiedere agli altri gi
Comandi della chat
/nick <nuovo_nickname> - cambio di nickname
/tav <frase di invito> - invito per gli altri giocatori al tavolo dove si è seduti
-/st <stato> - cambia l\'icona associata al tuo user; stato può valere: \\"normale\\", \\"fuori\\", \\"pausa\\", \\"cibo\\", \\"cane\\", \\"lavoro\\" oppure \\"sigaretta\\"
+/st <stato> - cambia l\'icona associata al tuo user; stato può valere: \\"normale\\", \\"fuori\\", \\"pausa\\", \\"cibo\\", \\"cane\\", \\"lavoro\\", \\"presente\\" oppure \\"sigaretta\\"
/garante - se si è autenticati permette di garantire per un utente fidato
@@ -610,6 +612,7 @@ define(USER_FLAG_S_DOG, 0x300); // done
define(USER_FLAG_S_EAT, 0x400); // done
define(USER_FLAG_S_WRK, 0x500); // done
define(USER_FLAG_S_SMK, 0x600); // done
+define(USER_FLAG_S_EYE, 0x700); // done
define(USER_FLAG_S_ALL, 0xf00); // done
@@ -828,7 +831,7 @@ class User {
function reset() {
$curtime = time();
- log_legal($curtime, $this->sess, $this->name, "STAT:LOGOUT", '');
+ log_legal($curtime, $this, "STAT:LOGOUT", '');
$tmp_sess = $this->sess;
$this->sess = "";
@@ -977,7 +980,7 @@ class Room {
$user_cur->bantime = $bri_user->bantime;
}
- log_legal($curtime, $user_cur->sess, $user_cur->name, "STAT:DESTROY_GAME", $plist);
+ log_legal($curtime, $user_cur, "STAT:DESTROY_GAME", $plist);
$this->room_join_wakeup(&$user_cur, FALSE, 0);
$table_cur->table_token = "";
@@ -1013,7 +1016,7 @@ class Room {
for ($i = 0 ; $i < $table_cur->player_n ; $i++) {
$plist .= '|'.$this->user[$table_cur->player[$i]]->sess;
}
- log_legal($curtime, $user_cur->sess, $user_cur->name, "STAT:DESTROY_GAME(RECOVERY)", $plist);
+ log_legal($curtime, $user_cur, "STAT:DESTROY_GAME(RECOVERY)", $plist);
$this->room_join_wakeup(&$user_cur, TRUE, -2);
$table_cur->table_token = "";
@@ -1057,6 +1060,7 @@ class Room {
if ($user_cur->stat == 'room' && $user_cur->subst == 'sitdown') {
$this->room_wakeup(&$user_cur);
$user_cur->comm[$user_cur->step % COMM_N] = "gst.st = ".($user_cur->step+1)."; ";
+ /* MLANG:
Sei stato inattivo per ".(EXPIRE_TIME_SMAMMA/60.0)." minuti.
Quindi ritorni tra i Giocatori in piedi.", "torna ai tavoli" */
$user_cur->comm[$user_cur->step % COMM_N] .= show_notify("
Sei stato inattivo per ".(EXPIRE_TIME_SMAMMA/60.0)." minuti.
Quindi ritorni tra i Giocatori in piedi.", 0, "torna ai tavoli", 400, 100);
$user_cur->step_inc();
}
@@ -1417,6 +1421,7 @@ class Room {
strncmp($msg, "/tav ", 5) == 0) {
do {
if ($user->stat != 'room' || $user->subst != 'sitdown') {
+ /* MLANG: "
Per attivare il messaggio di segnalazione del tavolo occorre essere seduti.
", "
Il messaggio di segnalazione del tavolo è già attivato.
", "
Il messaggio di segnalazione del tavolo
è disattivato ancora per %d second%s.
" */
$msg = "
Per attivare il messaggio di segnalazione del tavolo occorre essere seduti.
";
$to_user = show_notify($msg, 0, "chiudi", 400, 100);
@@ -1462,18 +1467,21 @@ class Room {
}
do {
if (strncmp($msg, $alarm_check, strlen($alarm_check)) != 0) {
+ /* MLANG: "
La password digitata non è corretta.
" */
$msg = "
La password digitata non è corretta.
";
$to_user = show_notify($msg, 0, "chiudi", 400, 100);
break;
}
+ /* MLANG: "Alarm %s inviato a %s." */
$to_user = sprintf('chatt_sub("%s", [2, "%s"],"Alarm %s inviato a %s.");',
$dt, NICKSERV, xcape(substr($msg, strlen($alarm_check))),
($target == "" ? "tutti" : xcape($target)) );
$msg = sprintf("
%s
%s
",
$dt.NICKSERV, xcape(substr($msg, strlen($alarm_check))));
+ /* MLANG: "chiudi" */
$to_all = show_notify($msg, 0, "chiudi", 400, 120);
} while (0);
} // /alarm chat command
@@ -1482,6 +1490,7 @@ class Room {
$to_user = sprintf('authbox(300,200);');
}
else {
+ /* MLANG: "Per autenticare qualcuno devi a tua volta essere autenticato.", "Il nickname deve contenere almeno una lettera dell\'alfabeto o una cifra.", "Nickname %s già in uso." */
$to_user = sprintf('chatt_sub("%s", [2, "%s"],"Per autenticare qualcuno devi a tua volta essere autenticato.");', $dt, NICKSERV);
}
}
@@ -1508,6 +1517,7 @@ class Room {
break;
}
+ /* MLANG: "Non puoi cambiare nick a un tavolo per soli autenticati.", "Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN." */
if ($user->flags & USER_FLAG_AUTH) {
if (strcasecmp($user->name,$name_new) != 0) {
if ($user->subst == 'standup' || ($user->subst != 'standup' && $this->table[$user->table]->auth_only == FALSE)) {
@@ -1523,10 +1533,10 @@ class Room {
}
}
$user->name = $name_new; // OK - nick changed
-
/* se nome gia' in uso, segnala cosa potrebbe capitare */
if (($user->flags & USER_FLAG_AUTH) == 0) {
$userdb = new LoginDB();
+ /* MLANG: "Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN." */
if ($userdb->login_exists($name_new)) {
$to_user .= sprintf('chatt_sub("%s", [2, "%s"],"Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN.");', $dt, NICKSERV, xcape($name_new));
}
@@ -1565,7 +1575,11 @@ class Room {
else if (strcasecmp($st_str, "sigaretta") == 0) {
$st = USER_FLAG_S_SMK;
}
+ else if (strcasecmp($st_str, "presente") == 0) {
+ $st = USER_FLAG_S_EYE;
+ }
else {
+ /* MLANG: "Questo stato non esiste." */
$to_user = sprintf('chatt_sub("%s", [2,"%s"],"Questo stato non esiste.");', $dt, NICKSERV);
break;
}
@@ -1607,7 +1621,7 @@ class Room {
$to_room = $to_user;
}
- log_legal($curtime, $user->sess, $user->name,
+ log_legal($curtime, $user,
($user->stat == 'room' ? 'room' : 'table '.$user->table),$msg);
$user->chat_lst = "$msg";
@@ -2031,13 +2045,11 @@ class Room {
// echo "LOCK: ".FTOK_PATH."/main";
// exit;
if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1) {
- echo "FTOK FAILED";
- exit;
+ return (FALSE);
}
// echo "FTOK ".$tok."
";
if (($res = sem_get($tok)) == FALSE) {
- echo "SEM_GET FAILED";
- exit;
+ return (FALSE);
}
if (sem_acquire($res)) {
log_lock("LOCK room");
@@ -2393,13 +2405,16 @@ function log_auth($sess, $log) {
}
-function log_legal($curtime, $sess, $name, $where, $mesg)
+// function log_legal($curtime, $sess, $name, $where, $mesg)
+function log_legal($curtime, &$user, $where, $mesg)
{
GLOBAL $_SERVER;
if (($fp = @fopen(LEGAL_PATH."/legal.log", 'a')) != FALSE) {
/* Unix time | session | nickname | IP | where was | mesg */
- fwrite($fp, sprintf("%ld|%s|%s|%s|%s|%s|\n", $curtime, $sess, $name, $_SERVER['REMOTE_ADDR'], $where , $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);
}
}
@@ -2573,6 +2588,7 @@ function show_table_info(&$room, &$table, $table_pos)
$wol = game_result($table->old_asta_pnt, $table->old_pnt);
if ($win != $fri) {
+ /* MLANG: "
Nell'ultima mano ha chiamato %s, il socio era %s,
", "hanno fatto cappotto EBBRAVI!.
", "dovevano fare %s punti e ne hanno fatti %d: hanno %s.
", "
Nell'ultima mano %s si è chiamato in mano,
", "ha fatto cappotto EBBRAVO!.
", "doveva fare %s punti e ne ha fatti %d: ha %s.
", ($table->old_asta_pnt > 61 ? "almeno ".$table->old_asta_pnt : 'più di 60'), $table->old_pnt, ($wol == 1 ? "vinto" : ($wol == 0 ? "pareggiato" : "perso" */
$noty .= sprintf("
Nell'ultima mano ha chiamato %s, il socio era %s,
",
xcape($room->user[$win]->name),
xcape($room->user[$fri]->name));
@@ -2600,6 +2616,7 @@ function show_table_info(&$room, &$table, $table_pos)
}
}
}
+ /* MLANG: "Fai tu il mazzo,", "Il mazzo a $unam," */
if ($table->mazzo == $table_pos)
$noty .= "Fai tu il mazzo,";
else {
@@ -2617,7 +2634,7 @@ function show_table_info(&$room, &$table, $table_pos)
$curplayer = ($table->gstart + $table->turn) % PLAYERS_N;
}
-
+ /* MLANG: " tocca a te giocare.", " tocca a $unam giocare.", " La partita vale %s.", "torna alla partita" */
if ($curplayer == $table_pos) {
$noty .= " tocca a te giocare.";
}
@@ -2691,8 +2708,7 @@ function show_table(&$room, &$user, $sendstep, $is_transition, $is_again)
$ret .= sprintf( 'gst.st = %d; stat = "%s"; subst = "%s"; table_pos = %d;',
$sendstep, $user->stat, $user->subst, $table_pos);
- log_rd(sprintf( 'SHOW_TABLE: gst.st = %d; stat = "%s"; subst = "%s"; table_pos = %d;',
- $sendstep, $user->stat, $user->subst, $table_pos));
+ log_rd(sprintf( 'SHOW_TABLE: gst.st = %d; stat = "%s"; subst = "%s"; table_pos = %d;', $sendstep, $user->stat, $user->subst, $table_pos));
/* BACKGROUND */
$ret .= "background_set();";
@@ -3026,13 +3042,11 @@ class Warrant {
GLOBAL $sess;
if (($tok = @ftok(FTOK_PATH."/warrant", "B")) == -1) {
- echo "FTOK FAILED";
- exit;
+ return (FALSE);
}
// echo "FTOK ".$tok."
";
if (($res = sem_get($tok)) == FALSE) {
- echo "SEM_GET FAILED";
- exit;
+ return (FALSE);
}
if (sem_acquire($res)) {
log_lock("LOCK room");