Merge branch 'together-for-fun' into nginx
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 16 Jul 2017 15:44:27 +0000 (17:44 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 16 Jul 2017 15:44:27 +0000 (17:44 +0200)
INSTALL.sh
web/Obj/brisk.phh
web/Obj/sac-a-push.phh
web/briskin5/index_wr.php
web/donometer.php
web/index_wr.php

index 1966c41..5391cae 100755 (executable)
@@ -431,7 +431,7 @@ sed -i "s@var \+cookiepath \+= \+\"[^\"]*\";@var cookiepath = \"$prefix_path\";@
 sed -i "s@\( \+cookiepath *: *\)\"[^\"]*\" *,@\1 \"$prefix_path\",@g" ${web_path}__/xynt-streaming.js
 
 document_root="$(grep DocumentRoot "${apache_conf}"  | grep -v '^[     ]*#' | awk '{ print $2 }')"
-sed -i "s@^\(\$DOCUMENT_ROOT *= *[\"']\)[^\"']*\([\"']\)@\1$document_root\2@g" ${web_path}__/spush/*.ph*
+sed -i "s@^\(\$DOCUMENT_ROOT *= *[\"']\)[^\"']*\([\"']\)@\1$document_root\2@g" ${web_path}__/spush/*.ph* ${web_path}__/donometer.php
 
 if [ -d ../brisk-img ]; then
     cd ../brisk-img
index c89d6ac..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.4.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>: potete scegliere che regole usare per giocare dal menu "Prefs" al tavolo, descrizioni più consistenti.',
+$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
             }
         }
index 46227fc..05c24ce 100644 (file)
@@ -631,14 +631,18 @@ class Sac_a_push {
         foreach ($this->socks as $k => $sock) {
             $id = intval($sock);
             if (isset($this->s2u[$id])) {
-                if ($this->s2u[$id]->the_end) {
-                    if ($this->s2u[$id]->rd_socket_get() != NULL) {
-                        $this->s2u[$id]->rd_socket_set(NULL);
+                $user = $this->s2u[$id];
+                if ($user->the_end) {
+                    if (($user->rd_toflush == FALSE && $user->rd_step == $user->step)
+                        || $user->rd_endtime_is_expired($this->curtime)) {
+                        if ($user->rd_socket_get() != NULL) {
+                            $user->rd_socket_set(NULL);
+                        }
+                        unset($this->socks[$id]);
+                        unset($this->s2u[$id]);
+                        fclose($sock);
+                        printf("CLOSE ON GARBAGE MANAGER\n");
                     }
-                    unset($this->socks[$id]);
-                    unset($this->s2u[$id]);
-                    fclose($sock);
-                    printf("CLOSE ON GARBAGE MANAGER\n");
                 }
             }
         }
index 19ac735..d188c0f 100644 (file)
@@ -189,7 +189,7 @@ function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie)
                     if ($user->table_pos != $index_cur ||
                         !$table->asta_pla[$index_cur]) {
                         // FIXME_LANG
-                        $ret_s = 'grave inconsistenza';
+                        // $ret_s = 'grave inconsistenza';
                         break;
                     }
 
index 76e5091..98a9895 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 $G_base = "";
+$DOCUMENT_ROOT="";
 
 require_once("Obj/brisk.phh");
 
index 48b3c14..002a76e 100644 (file)
@@ -956,16 +956,13 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
             }
             else if ($argz[0] == 'logout') {
                 $brisk->ghost_sess->push($curtime, $user->sess, GHOST_SESS_REAS_LOUT);
+
                 $user->the_end = TRUE;
+                $brisk->room_outstandup($user);
 
-                if ($user->subst == 'sitdown') {
-                    log_load("ROOM WAKEUP");
-                    $brisk->room_wakeup($user);
-                }
-                else if ($user->subst == 'standup')
-                    $brisk->room_outstandup($user);
-                else
-                    log_rd2("LOGOUT FROM WHAT ???");
+                $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+                $user->comm[$user->step % COMM_N] .=  sprintf('gst.st_loc++; xstm.stop(); window.onbeforeunload = null; window.onunload = null; document.location.assign("index.php");');
+                $user->step_inc();
             }
         }
         /**********************
@@ -984,9 +981,13 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
             }
             else if ($argz[0] == 'logout') {
                 $brisk->ghost_sess->push($curtime, $user->sess, GHOST_SESS_REAS_LOUT);
-                $user->the_end = TRUE;
 
+                $user->the_end = TRUE;
                 $brisk->room_wakeup($user);
+
+                $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+                $user->comm[$user->step % COMM_N] .=  sprintf('gst.st_loc++; xstm.stop(); window.onbeforeunload = null; window.onunload = null; document.location.assign("index.php");');
+                $user->step_inc();
             }
         }
     }