Merge branch 'together-for-fun' into nginx
[brisk.git] / web / Obj / brisk.phh
index f971277..62fc1a4 100644 (file)
@@ -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.4.2";
 
 /* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: 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.'), <b>NOVITA\'</b>: uscita piĆ¹ veloce dal sito.',
                                        'Se vuoi iscriverti alla <a target="_blank" href="mailto:ml-briscola+subscribe@milug.org">Mailing List</a>, cliccala!' ),
                        'en' => array ( 'EN Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: 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.',
@@ -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
             }
         }
@@ -2803,9 +2808,10 @@ class Brisk
 
           break;
       case "index_rd.php":
+      case "index_rd_wss.php":
           if (($transp  = gpcs_var('transp', $get, $post, $cookie)) === FALSE)
               $transp = "iframe";
-          if ($transp == 'websocket')
+          if ($transp == 'websocket' || $transp == 'websocketsec')
               $enc = 'plain';
 
           do {
@@ -2871,7 +2877,7 @@ class Brisk
           $subs = "briskin5/";
           $subs_l = strlen($subs);
           if (!strncmp($path, $subs, $subs_l)) {
-              $ret = Bin5::request_mgr(&$s_a_p, $header, &$header_out, &$new_socket, substr($path, $subs_l) , $addr, $get, $post, $cookie);
+              $ret = Bin5::request_mgr($s_a_p, $header, $header_out, $new_socket, substr($path, $subs_l) , $addr, $get, $post, $cookie);
               return ($ret);
           }
           break;