From: Matteo Nastasi (mop) Date: Sat, 17 Dec 2011 15:54:01 +0000 (+0100) Subject: milestone 1 to move to an http_streaming object X-Git-Tag: pre-sac~5 X-Git-Url: http://mop.ddnsfree.com/gitweb/?p=brisk.git;a=commitdiff_plain;h=54faeacf123066d257566a533da7107c8425785f milestone 1 to move to an http_streaming object --- diff --git a/INSTALL.sh b/INSTALL.sh index 70ba680..134d2fb 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -313,7 +313,7 @@ sed -i "s@define *( *BRISK_CONF,[^)]*)@define(BRISK_CONF, \"$brisk_conf\")@g" ${ sed -i "s@define *( *BRISK_AUTH_CONF,[^)]*)@define(BRISK_AUTH_CONF, \"$brisk_auth_conf\")@g" ${web_path}__/Obj/auth.phh -sed -i "s@var \+xhr_rd_cookiepath \+= \+\"[^\"]*\";@var xhr_rd_cookiepath = \"$cookie_path\";@g" ${web_path}__/xhr.js +sed -i "s@\( \+xhr_rd_cookiepath *: *\)\"[^\"]*\" *,@\1 \"$cookie_path\",@g" ${web_path}__/xhr.js sed -i "s@var \+cookiepath \+= \+\"[^\"]*\";@var cookiepath = \"$cookie_path\";@g" ${web_path}__/commons.js if [ -d ${web_path} ]; then diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 1aac984..2465f79 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -1416,7 +1416,7 @@ class Room { $ret = "gst.st = ".($user_cur->step+1)."; ".($remove_wagon ? sprintf("tra.rem(%d);",$table_idx) : ""); if ($from_table && ($user_cur->table == $table_idx || $user->idx_get() == $i)) { - $ret .= 'gst.st_loc++; the_end=true; window.onunload = null; window.onbeforeunload = null; document.location.assign("index.php");|'; + $ret .= 'gst.st_loc++; hstm.the_end=true; window.onunload = null; window.onbeforeunload = null; document.location.assign("index.php");|'; // $ret .= 'gst.st_loc++; document.location.assign("index.php");|'; log_main("DOCUMENT.index.php: from table"); } diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index 41cacfd..115f279 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -1153,7 +1153,7 @@ class Bin5 { $user_cur->laccwr = $curtime; $ret = "gst.st = ".($user_cur->step+1)."; "; - $ret .= 'gst.st_loc++; the_end=true; window.onbeforeunload = null; window.onunload = null; document.location.assign("../index.php");|'; + $ret .= 'gst.st_loc++; hstm.the_end=true; window.onbeforeunload = null; window.onunload = null; document.location.assign("../index.php");|'; log_wr($user_cur->sess." BIN5_WAKEUP: ".$ret); $user_cur->comm[$user_cur->step % COMM_N] = $ret; diff --git a/web/briskin5/index.php b/web/briskin5/index.php index 3d7f2ec..4010c9a 100644 --- a/web/briskin5/index.php +++ b/web/briskin5/index.php @@ -64,7 +64,8 @@ header('Content-type: text/html; charset="utf-8"',true); diff --git a/web/briskin5/index_rd.php b/web/briskin5/index_rd.php index a571704..defa83c 100644 --- a/web/briskin5/index_rd.php +++ b/web/briskin5/index_rd.php @@ -64,7 +64,7 @@ function blocking_error($is_unrecoverable) $is_page_streaming = TRUE; log_rd2("BLOCKING_ERROR UNREC: ".($is_unrecoverable ? "TRUE" : "FALSE")); - return (sprintf(($is_unrecoverable ? 'the_end=true; ' : '').'window.onbeforeunload = null; window.onunload = null; document.location.assign("../index.php");')); + return (sprintf(($is_unrecoverable ? 'hstm.the_end=true; ' : '').'window.onbeforeunload = null; window.onunload = null; document.location.assign("../index.php");')); } function page_sync($sess, $page) @@ -73,7 +73,7 @@ function page_sync($sess, $page) $is_page_streaming = TRUE; log_rd2("PAGE_SYNC"); - return (sprintf('the_end=true; window.onbeforeunload = null; window.onunload = null; document.location.assign("%s");', $page)); + return (sprintf('hstm.the_end=true; window.onbeforeunload = null; window.onunload = null; document.location.assign("%s");', $page)); } function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_subst, &$new_step, $table_idx, $table_token) @@ -100,7 +100,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if (($sem = Bin5::lock_data(FALSE, $table_idx)) == FALSE) { // wait 20 secs, then restart the xhr ignore_user_abort(FALSE); - return ("sleep(gst,20000);|xhr_rd_abort(xhr_rd);"); + return ("sleep(gst,20000);|hstm.xhr_rd_abort();"); } if (($user = Bin5_user::load_data($table_idx, $proxy_step['i'], $sess)) == FALSE) { @@ -119,7 +119,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su if (($sem = Bin5::lock_data(TRUE, $table_idx)) == FALSE) { // wait 20 secs, then restart the xhr ignore_user_abort(FALSE); - return ("sleep(gst,20000);|xhr_rd_abort(xhr_rd);"); + return ("sleep(gst,20000);|hstm.xhr_rd_abort();"); } $S_load_stat['lL_laccgarb']++; @@ -196,7 +196,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su // else { // ignore_user_abort(FALSE); -// return ("sleep(gst,20000);|xhr_rd_abort(xhr_rd);"); +// return ("sleep(gst,20000);|hstm.xhr_rd_abort();"); // } // $first_loop = FALSE; diff --git a/web/commons.js b/web/commons.js index 77be887..70859fe 100644 --- a/web/commons.js +++ b/web/commons.js @@ -425,7 +425,7 @@ function postact_logout() { // alert("postact_logout"); try { - xhr_rd.abort(); + hstm.abort(); } catch (e) {} // eraseCookie("sess"); @@ -854,54 +854,20 @@ function eraseCookie(name) { createCookie(name,"",-1); } -var onunload_times = 0; - - function onbeforeunload_cb () { return(""); } -function onunload_cb_old () { - var u = 0; - - // if (nonunload == true) - // return true; - - if (onunload_times == 0) { - // MLANG " Vuoi veramente abbandonare la briscola ?\n(clicca annulla o cancel se vuoi ricaricare la briscola)" - var res = window.confirm(mlang_commons['brileav'][g_lang]); - if (res == true) { - the_end = true; - act_shutdown(); - // while (1) - // u++; - } - else { - try { - document.location.href = self.location; // = self.location; - // alert ("passiamo di qui"+self.location); - return (false); - } catch (e) { - // MLANG "Ripristino della briscola fallito, per non perdere la sessione ricaricare la pagina manualmente." - alert(mlang_commons['brireco'][g_lang]); - } - } - onunload_times++; - } - - return(false); -} - function onunload_cb () { - the_end = true; + if (typeof(hstm) != "undefined") + hstm.the_end = true; act_shutdown(); return(false); } - function room_checkspace(emme,tables,inpe) { nome = ""; diff --git a/web/index.php b/web/index.php index ee5942e..916f11e 100644 --- a/web/index.php +++ b/web/index.php @@ -870,17 +870,17 @@ supported by:
Brisk + + - - @@ -895,6 +895,7 @@ supported by:
var gst = new globst(); var topbanner_sfx, topbanner_dx; var g_brow = null; + var hstm = null; var sess = "not_connected"; var spo_slide, sup_slide; @@ -1003,21 +1004,21 @@ echo "$body"; ?> Brisk + + - -