X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=853430e5e0f6176eb00c5474823d3ec5348efd5d;hb=c282f022712c52d8df7d6e4053e10d0259bb9b6f;hp=19bae1d909e80929ef41f2d95eb14739a43e40b6;hpb=461259aa77611a333c703802cb905a829ef40f81;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 19bae1d..853430e 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -27,7 +27,7 @@ define(BRISK_CONF, "brisk.conf.pho"); define(FTOK_PATH, "/var/lib/brisk"); define(LEGAL_PATH, "/tmp/legal_brisk"); define(PROXY_PATH, "/var/lib/brisk_proxy"); -define(TABLES_N, 32); +define(TABLES_N, 36); define(PLAYERS_N, 3); define(MAX_POINTS, 5); define(MAX_PLAYERS, (20 + (PLAYERS_N * TABLES_N))); @@ -80,10 +80,10 @@ $G_lng = ""; // $G_lng = "_en"; $G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 ); -$G_brisk_version = "2.1.6 - trusty"; +$G_brisk_version = "2.1.9 - trusty"; /* MLANG: ALL THE INFO STRINGS IN brisk.phh */ -$root_wellarr = Array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': menu comandi e filtro sui non autenticati.', +$root_wellarr = Array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': sondaggi, direct messages quando segnalate.', 'Se vuoi iscriverti alla Mailing List, cliccala!' ); $G_room_help= ' @@ -112,12 +112,44 @@ Dopo che è iniziata una partita per uscirne dovete chiedere agli altri gi
/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
/mesgtoadm - se si è autenticati permette di lasciare un messaggio all\'amministratore del sito -
/listen <all|auth> - se si è autenticati permette leggere solo i messaggi degli altri autenticati (auth) o di tutti (all) +
/listen <all or auth> - se si è autenticati permette leggere solo i messaggi degli altri autenticati (auth) o di tutti (all) '; // +$G_room_passwdhowto= '

Come registrarsi su Brisk

+
+Attualmente ci sono due metodi per ottenere una password sul sito:

+ +
  • Facendosi garantire da un utente di Brisk che già possidede una password

    +
  • Auto-garantendosi utilizzando uno dei seguenti sistemi di identificazione digitale:

    + +
  • Carta Regionale dei Servizi della Lombardia (la tessera sanitaria) +
  • Carta Regionale dei Servizi del Friuli Venezia Giulia (la tessera sanitaria) +
  • +
    +Per auto-garantisi occorre possedere:

    + +
  • il codice PIN della propria carta +
  • il lettore di smart-card per collegare la carta al PC (acquistabile di solito presso le edicole) +
  • +
    +Per effettuare la registrazione collegarsi al sito:

    +
    +
    https://brisk.mine.nu +
    +

    +Se sei in possesso di una carta che permette l\'identificazione via internet che non è nell\'elenco qui sopra +fai una segnalazione. + +
  • +
    +'; +/* +
    Seguendo la procedura di auto-garanzia all\'url: https://brisk.mine.nu +'; +*/ $G_room_about= '
    @@ -128,6 +160,33 @@ $G_room_about= '
    Copyright 2006-2008 Matteo Nastasi (aka mop)

    '; +function csplitter($in, $sep) +{ + $st = 0; + $id = 0; + $out = array(); + + for ($i = 0 ; $i < strlen($in) ; $i++) { + if ($st == 0) { + if ($in{$i} == '\\') + $st = 1; + else if ($in{$i} == $sep) { + $id++; + } + else { + $out[$id] .= $in{$i}; + } + } + else if ($st == 1) { + $out[$id] .= $in{$i}; + $st = 0; + } + } + + return ($out); +} + + function xcape($s) { $from = array ( '\\', '@', '|' ); @@ -144,6 +203,14 @@ function xcapelt($s) return (str_replace($from, $to, $s)); } +function xcapemesg($s) +{ + $from = array ( "\n"); + $to = array ( "\\n"); + + return (str_replace($from, $to, $s)); +} + class Table { var $idx; @@ -691,7 +758,7 @@ class Room { $this->table[$i]->auth_only = FALSE; } */ - if ($i < 16) + if ($i < 12) $this->table[$i]->auth_only = TRUE; else $this->table[$i]->auth_only = FALSE; @@ -709,6 +776,9 @@ class Room { $curtime = time(); if ($force || $this->garbage_timeout < $curtime) { + // FIXME BRISK4: include for each kind of table + require_once("briskin5/Obj/briskin5.phh"); + // Before all align times with table timeout for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) { $table_cur =& $this->table[$table_idx]; @@ -1481,6 +1551,8 @@ class Room { } if ($to_tabl) { + // FIXME BRISK4: include for each kind of table + require_once("briskin5/Obj/briskin5.phh"); // Before all align times with table timeout for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) { $table_cur =& $this->table[$table_idx]; @@ -1656,6 +1728,8 @@ class Room { // If user at the table we need to update the table data too $table_idx = $ghost_user->table; if ($ghost_user->stat == "table" && $this->table[$table_idx]->player_n == PLAYERS_N) { + // FIXME BRISK4: include for each kind of table + require_once("briskin5/Obj/briskin5.phh"); if (($brisem = Briskin5::lock_data($table_idx)) != FALSE) { if (($bri = &Briskin5::load_data($table_idx)) != FALSE) { if ($bri->the_end != TRUE) { @@ -2413,7 +2487,7 @@ class Warrant { return (FALSE); } if (sem_acquire($res)) { - log_lock("LOCK room"); + log_lock("LOCK warrant"); return ($res); } else @@ -2424,11 +2498,40 @@ class Warrant { { GLOBAL $sess; - log_lock("UNLOCK room"); + log_lock("UNLOCK warrant"); return (sem_release($res)); } +} +class Poll { + function lock_data() + { + GLOBAL $sess; + + if (($tok = @ftok(FTOK_PATH."/poll", "B")) == -1) { + return (FALSE); + } + // echo "FTOK ".$tok."
    "; + if (($res = sem_get($tok)) == FALSE) { + return (FALSE); + } + if (sem_acquire($res)) { + log_lock("LOCK poll"); + return ($res); + } + else + return (FALSE); + } + function unlock_data($res) + { + GLOBAL $sess; + + log_lock("UNLOCK poll"); + + return (sem_release($res)); + } } + ?>