$G_lng = langtolng($G_lang);
$G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
-$G_brisk_version = "4.8.1";
+$G_brisk_version = "4.10.1";
/* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: prova il nuovo azioni->preferenze, aggiunto stato utente ONLYFIRST.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: aggiunto il comando /cont per proseguire le partite.',
'Se vuoi iscriverti alla <a target="_blank" href="mailto:ml-briscola+subscribe@milug.org">Mailing List</a>, cliccala!' ),
- 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NEWS</b>: server-side infrastructure to manage user preferences added and S customization added.',
+ 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NEWS</b>: added /cont command to continue matches.',
'If you want to subscribe our <a target="_blank" href="ml-briscola+subscribe@milug.org">Mailing List</a>, click it!' ) );
$G_room_help = array( 'it' => '
<dd><b>/nick <i><nuovo_nickname></i></b> - cambio di nickname
<dd><b>/tav <i><frase di invito></i></b> - invito per gli altri giocatori al tavolo dove si è seduti
<dd><b>/st <i><stato></i></b> - cambia l\'icona associata al tuo user; <i>stato</i> può valere: \\"normale\\", \\"fuori\\", \\"pausa\\", \\"cibo\\", \\"cane\\", \\"lavoro\\", \\"presente\\" oppure \\"sigaretta\\"
+<dd><b>/cont <i><id partita></i></b> - quando si รจ a un tavolo per garantiti, permette di proseguire una partita giocata in precedenza con gli stessi giocatori
<dd><b>/authreq</b> - se si è autenticati permette di garantire per un utente fidato
<dd><b>/mesgtoadm</b> - se si è autenticati permette di lasciare un messaggio all\'amministratore del sito
<dd><b>/listen <all or auth></b> - se si è autenticati permette leggere solo i messaggi degli altri autenticati (auth) o di tutti (all)
<br><b>version '.$G_brisk_version.'</b><br><br>
Copyright 2006-2012 <a href=\\"mailto:brisk@alternativeoutput.it\\">Matteo Nastasi</a> (aka mop)<br><br>');
+// return values
+// -1 v1 < v2
+// 0 equal
+// 1 v1 > v2
+function versions_cmp($v1, $v2)
+{
+ // printf("V1: [%s]\nV2: [%s]\n", $v1, $v2);
+ if ($v1 == $v2)
+ return 0;
+
+ $v1_ar = split('\.', $v1);
+ $v2_ar = split('\.', $v2);
+
+ $v2_ct = count($v2_ar);
+
+ for ($i = 0 ; $i < count($v1_ar) ; $i++) {
+ if (($v2_ct - 1) < $i) {
+ break;
+ }
+ // printf("here [%s] [%s]\n", $v1_ar[$i], $v2_ar[$i]);
+ if ($v1_ar[$i] != $v2_ar[$i]) {
+ if (strval($v1_ar[$i]) < strval($v2_ar[$i]))
+ return -1;
+ else
+ return 1;
+ }
+ }
+ return 0;
+}
+
function addrtoipv4($addr)
{
$ipv4addr_arr = explode(':' , $addr);
function esclfhtml($s)
{
- return str_replace("\n", "<br>\n", htmlentities($s));
+ return str_replace("\n", "<br>", htmlspecialchars($s));
}
-
function langtolng($lang)
{
GLOBAL $G_lang;
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;
+ $this->supp_comp = $user->rec->supp_comp_get();
}
else {
$this->supp_comp = "000000000000";
fprintf(STDERR, "QQ %s::%s %x\n", __CLASS__, __FUNCTION__,
$user->flags);
if ($user->is_supp_custom()) {
- $user->rec->supp_comp = $this->supp_comp;
+ $user->rec->supp_comp_set($this->supp_comp);
}
if ($is_save)
- $user->store_set();
+ $user->prefs_store();
}
}
// sql record exists AND last donate > 2013-01-01
if ($this->user[$i]->is_supp_custom()) {
- $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp);
+ $supp_comp_s = sprintf(', "%s"', $this->user[$i]->rec->supp_comp_get());
}
else {
$supp_comp_s = '';
log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx));
if ($user_cur->is_supp_custom())
- $supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp);
+ $supp_comp_s = sprintf(', "%s"', $user_cur->rec->supp_comp_get());
else
$supp_comp_s = '';
return TRUE;
break;
- case "index_rd_ifra.php":
+ case "index_rd.php":
+ if (($transp = gpcs_var('transp', $get, $post, $cookie)) === FALSE)
+ $transp = "iframe";
+ if ($transp == 'websocket')
+ $enc = 'plain';
+
do {
if (!isset($cookie['sess'])
|| (($user = $this->get_user($cookie['sess'], $idx)) == FALSE)) {
- if (($transp = gpcs_var('transp', $get, $post, $cookie)) === FALSE)
- $transp = "iframe";
$content = User::stream_fini($transp, $s_a_p->rndstr, TRUE);
}
$content = "";
- $user->stream_init($s_a_p->rndstr, $enc, $header_out, $content, $get, $post, $cookie);
-
- $response = headers_render($header_out, -1).chunked_content($user->rd_zls_get(), $content);
+ $user->stream_init($s_a_p->rndstr, $enc, $header, $header_out, $content, $get, $post, $cookie);
+ $response = headers_render($header_out, -1).$user->chunked_content($content);
$response_l = mb_strlen($response, "ASCII");
$wret = @fwrite($new_socket, $response, $response_l);
return sprintf('var noti = new notify_ex(gst,"%s",%d,"%s",%d,%d, %s, %d);', $text, $tout, $butt, $w, $h, ($is_opaque ? "true" : "false"), $block_time);
}
+function show_notify_document($text, $tout, $butt_arr, $confirm_func, $w, $h, $is_opaque, $block_time)
+{
+ log_main("SHOW_NOTIFY OPAQUE: ".$text);
+
+ $butts = "";
+ for ($i = 0 ; $i < count($butt_arr) ; $i++) {
+ $butts .= sprintf("%s'%s'", ($i == 0 ? "" : ","), $butt_arr[$i]);
+ }
+
+ return sprintf('g_nd = new notify_document(gst, "%s", %d, [ %s ], %s, %d, %d, %s, %d);|',
+ escpush($text), $tout, $butts, ($confirm_func == NULL ? "null" : $confirm_func), $w, $h, ($is_opaque ? "true" : "false"), $block_time);
+}
+
function root_welcome($user)
{