X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=9c20af1f3a87874f0cac641953ab63846e08510c;hb=e115b9ba20f9a2f08dffd806eb8b6ebc77ddb6cf;hp=0c335914da48e4f1c1d99420b8e6b68571f53558;hpb=302c97f7ac81dfcc6fc8d8d44359f4f432e4618a;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index 0c33591..9c20af1 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -59,7 +59,7 @@ define('EXPIRE_TIME_SMAMMA', 360);
define('EXPIRE_TIME_WAG', 10);
define('WAKEUP_TIME', 12);
// BAN_TIME da allineare anche in commons.js
-define('BAN_TIME', 3600);
+define('BAN_TIME', 900);
define('GARBAGE_TIMEOUT', 5);
define('NICKSERV', "BriskServ");
@@ -153,10 +153,10 @@ $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 = "5.2.1";
+$G_brisk_version = "5.6.0";
/* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': puoi creare la tua rete di amicizie con /info, vedere cosa pensano i tuoi amici degli altri utenti e ci sono i nuovi tavoli riservati per registrati e apprendisti, corretti alcuni errori.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': dati dai client via web-socket.',
'Se vuoi iscriverti alla Mailing List, cliccala!' ),
'en' => array ( 'EN Brisk (Ver. '.$G_brisk_version.'), NOVITA\': puoi creare la tua rete di amicizie con /info,',
'vedere cosa pensano i tuoi amici degli altri utenti e tavoli riservati per registrati e apprendisti.',
@@ -183,7 +183,7 @@ Durante la partita, se vorrete ricaricare la pagina, usate l\'apposito bottone \
Dopo che è iniziata una partita per uscirne dovete chiedere agli altri giocatori di sbloccarla cliccando sul lucchetto. Se non si segue questa prassi, una volta usciti, non vi potrete sedere a nessun tavolo per '.floor(BAN_TIME/60).' minuti.
- 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\\", \\"presente\\" oppure \\"sigaretta\\"
- /cont <id partita> - quando si è a un tavolo per garantiti, permette di proseguire una partita giocata in precedenza con gli stessi giocatori
@@ -938,7 +938,7 @@ class Client_prefs {
function user_load($user)
{
- fprintf(STDERR, "QQ %s: %x\n", __FUNCTION__, $user->flags);
+ // fprintf(STDERR, "QQ %s: %x\n", __FUNCTION__, $user->flags);
$this->listen = ($user->flags & USER_FLAG_MAP_AUTH) >> 2;
if ($user->rec != FALSE) {
$this->supp_comp = $user->rec->supp_comp_get();
@@ -947,7 +947,7 @@ class Client_prefs {
$this->supp_comp = "000000000000";
}
- fprintf(STDERR, "QQ %s: LISTEN: %d\n", __FUNCTION__, $this->listen);
+ // fprintf(STDERR, "QQ %s: LISTEN: %d\n", __FUNCTION__, $this->listen);
}
function json_load($json_s)
@@ -987,11 +987,11 @@ class Client_prefs {
function store($user, $is_save)
{
// save into DB
- fprintf(STDERR, "QQ %s::%s PRE: %x\n", __CLASS__, __FUNCTION__,
- $user->flags & (~USER_FLAG_S_ALL & ~USER_FLAG_AUTH));
+ // fprintf(STDERR, "QQ %s::%s PRE: %x\n", __CLASS__, __FUNCTION__,
+ // $user->flags & (~USER_FLAG_S_ALL & ~USER_FLAG_AUTH));
$user->flags_set(($this->listen << 2), USER_FLAG_MAP_AUTH);
- fprintf(STDERR, "QQ %s::%s %x\n", __CLASS__, __FUNCTION__,
- $user->flags);
+ // fprintf(STDERR, "QQ %s::%s %x\n", __CLASS__, __FUNCTION__,
+ // $user->flags);
if ($user->is_supp_custom()) {
$user->rec->supp_comp_set($this->supp_comp);
}
@@ -1226,10 +1226,15 @@ class Brisk
function users_cleanup()
{
+ $curtime = time();
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
$user_cur = $this->user[$i];
- if ($user_cur->the_end) {
+ if ($user_cur->the_end
+ && (($user_cur->rd_toflush == FALSE
+ && $user_cur->rd_step == $user_cur->step)
+ || $user_cur->rd_endtime_is_expired($curtime))
+ ) {
$user_cur->reset(); // users_cleanup, OK
}
}
@@ -1928,7 +1933,7 @@ class Brisk
GLOBAL $G_base, $G_alarm_passwd, $mlang_brisk, $G_lang;
$only_you = FALSE;
- fprintf(STDERR, "WE ARE HERE: [%s]\n", $mesg);
+ // fprintf(STDERR, "WE ARE HERE: [%s]\n", $mesg);
// common settings
$msg = mb_substr($mesg, 6, 128, "UTF-8");
@@ -2446,6 +2451,14 @@ class Brisk
}
else {
$login_exists = $bdb->login_exists(strtolower($name_new));
+/*
+TO ENABLE USER-LOGIN ONLY
+- $login_exists = $bdb->login_exists(strtolower($name_new));
++ // $login_exists = $bdb->login_exists(strtolower($name_new));
++ // Force access with login and password
++ $idx = -3;
++ return (FALSE);
+*/
}
}
else {
@@ -2553,7 +2566,7 @@ class Brisk
$this->user[$idx]->flags |= USER_FLAG_LISTAUTH;
if (isset($cookie['CO_list'])) {
- fprintf(STDERR, "QQ: %s CO_list: [%s]\n", __FUNCTION__, $cookie['CO_list']);
+ // fprintf(STDERR, "QQ: %s CO_list: [%s]\n", __FUNCTION__, $cookie['CO_list']);
if (strcmp($cookie['CO_list'], "auth") == 0) {
$this->user[$idx]->flags &= ~USER_FLAG_MAP_AUTH;
$this->user[$idx]->flags |= USER_FLAG_LISTAUTH;
@@ -2567,11 +2580,11 @@ class Brisk
}
}
}
- else {
- fprintf(STDERR, "QQ: CO_list not set flags: %x\n", __FUNCTION__, $this->user[$idx]->flags);
- }
+ // else {
+ // fprintf(STDERR, "QQ: CO_list not set flags: %x\n", __FUNCTION__, $this->user[$idx]->flags);
+ // }
}
- fprintf(STDERR, "QQ %s: flag %x\n", __FUNCTION__, $this->user[$idx]->flags);
+ // fprintf(STDERR, "QQ %s: flag %x\n", __FUNCTION__, $this->user[$idx]->flags);
if ($ghost > -1) {
log_main("ghost: rename!");
$ghost_user = $this->user[$ghost];
@@ -2745,12 +2758,12 @@ class Brisk
{
GLOBAL $G_ban_list, $G_black_list, $G_cloud_smasher;
- printf("NEW_SOCKET (root): %d PATH [%s]\n", intval($new_socket), $path);
+ // printf("NEW_SOCKET (root): %d PATH [%s]\n", intval($new_socket), $path);
- fprintf(STDERR, "\n\n\n PRE_BLACK [%s]\n\n\n", $addr);
+ // fprintf(STDERR, "\n\n\n PRE_BLACK [%s]\n\n\n", $addr);
if ($this->black_check($addr)) {
// TODO: waiting async 5 sec before close
- fprintf(STDERR, "\n\n\n BLACK CHECK\n\n\n");
+ // fprintf(STDERR, "\n\n\n BLACK CHECK\n\n\n");
return (FALSE);
}
if ($path != "" && $path != "index.php") {
@@ -2825,7 +2838,7 @@ class Brisk
if (($prev = $user->rd_socket_get()) != NULL) {
$s_a_p->socks_unset($user->rd_socket_get());
fclose($user->rd_socket_get());
- printf("CLOSE AND OPEN AGAIN ON IFRA2\n");
+ // printf("CLOSE AND OPEN AGAIN ON IFRA2\n");
$user->rd_socket_set(NULL);
}
@@ -2847,7 +2860,7 @@ class Brisk
$s_a_p->socks_set($new_socket, $user, NULL);
$user->rd_socket_set($new_socket);
- printf(" - qui ci siamo - ");
+ // printf(" - qui ci siamo - ");
return TRUE;
} while (FALSE);
@@ -3436,9 +3449,9 @@ function validate_name($name)
return (FALSE);
}
-function playsound($filename)
+function playsound($name)
{
- return (sprintf('playsound("flasou", "%s");', $filename));
+ return (sprintf('g_jukebox.play("%s");', $name));
}
function secstoword($secs)