X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fuser.phh;h=924047464a0dc68d54c8785d47eb9806b29289b0;hb=64fd2be16978dab5d777388423a9d1d74d620cf8;hp=a4e6e10a074da16f93c29047819e019d722985f4;hpb=cb2f40283ece5cd3c855e74281773e5722996f23;p=brisk.git diff --git a/web/Obj/user.phh b/web/Obj/user.phh index a4e6e10..9240474 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -186,6 +186,8 @@ class User { var $chat_dlt; // Delta t for ban var $shm_sz; + const BASE = ""; // basepath for absolute web references + function User() { } @@ -645,22 +647,23 @@ class User { } // FIXME TO SUPPORT iframe - static function page_sync($sess, $page, $table_idx, $table_token) + protected function page_sync($sess, $page, $table_idx, $table_token) { GLOBAL $is_page_streaming; - log_rd2("page_sync:".var_export(debug_backtrace())); + // log_rd2("page_sync:".var_export(debug_backtrace())); $is_page_streaming = TRUE; log_rd2("PAGE_SYNC"); + printf("xXx USER::PAGE_SYNC [%s]\n", get_class($this)); return (sprintf('createCookie("table_idx", %d, 24*365, cookiepath); createCookie("table_token", "%s", 24*365, cookiepath); hstm.stop(); window.onunload = null; window.onbeforeunload = null; document.location.assign("%s");', $table_idx, $table_token, $page)); } - function maincheck($cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_subst, &$new_step, $splashdate) + protected function maincheck($cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_subst, &$new_step, $splashdate, $table_idx, $table_token) { GLOBAL $G_lang, $mlang_indrd, $is_page_streaming; // GLOBAL $first_loop; @@ -676,22 +679,22 @@ class User { $ret = FALSE; $curtime = time(); - if ((($curtime - $this->lacc) > STREAM_TIMEOUT) || Room::garbage_time_is_expired($curtime)) { - $S_load_stat['lL_laccgarb']++; + /* if ((($curtime - $this->lacc) > STREAM_TIMEOUT) || Room::garbage_time_is_expired($curtime)) { */ + /* $S_load_stat['lL_laccgarb']++; */ - if (($curtime - $this->lacc) >= STREAM_TIMEOUT) { - $S_load_stat['wU_lacc_upd']++; - $this->lacc = $curtime; - } + /* if (($curtime - $this->lacc) >= STREAM_TIMEOUT) { */ + /* $S_load_stat['wU_lacc_upd']++; */ + /* $this->lacc = $curtime; */ + /* } */ - if (Room::garbage_time_is_expired($curtime)) { - log_only("F"); + /* if (Room::garbage_time_is_expired($curtime)) { */ + /* log_only("F"); */ - $S_load_stat['wR_garbage']++; - log_main("pre garbage_manager TRE"); - $this->room->garbage_manager(FALSE); - } - } + /* $S_load_stat['wR_garbage']++; */ + /* log_main("pre garbage_manager TRE"); */ + /* $this->room->garbage_manager(FALSE); */ + /* } */ + /* } */ /* Nothing changed, return. */ if ($cur_step == $this->step) @@ -756,7 +759,9 @@ class User { ***************/ else if ($this->stat == 'table') { log_load("RESYNC"); - return (self::page_sync($this->sess, "briskin5/index.php", $this->table, $this->table_token)); + printf("xXx USER::MAINCHECK1 [%s]\n", get_class($this)); + + return ($this->page_sync($this->sess, "briskin5/index.php", $this->table, $this->table_token)); } log_rd2("NEWSTAT: ".$this->stat); } /* if ($cur_step == -1) { */ @@ -771,7 +776,8 @@ class User { $to_stat = $this->stat; /* Room::unlock_data($sem); */ log_load("RESYNC"); - return (self::page_sync($this->sess, ($to_stat == "table" ? "briskin5/index.php" : "index.php"), $this->table, $this->table_token)); + printf("xXx USER::MAINCHECK2 [%s]\n", get_class($this)); + return ($this->page_sync($this->sess, ($to_stat == "table" ? "briskin5/index.php" : "index.php"), $this->table, $this->table_token)); } log_rd2("lost history, refresh from scratch"); $new_step = -1; @@ -824,10 +830,10 @@ static function stream_fini($is_unrecoverable) $body = ""; $body .= sprintf(" - - + + @@ -859,6 +865,8 @@ function stream_init(&$header_out, &$body, $get, $post, $cookie) $curtime = time(); + printf("CLASS: [%s] base: [%s]\n", get_class($this), self::base_get()); + $is_page_streaming = FALSE; // (webservers_exceeded() || stristr($HTTP_USER_AGENT, "Mozilla/5.0 (Windows NT 6.1; rv:5.0)") || stristr($HTTP_USER_AGENT, "MSIE") || stristr($HTTP_USER_AGENT, "CHROME") ? TRUE : FALSE); $header_out['Cache-Control'] = 'no-cache, must-revalidate'; // HTTP/1.1 @@ -877,13 +885,14 @@ function stream_init(&$header_out, &$body, $get, $post, $cookie) unset($step); $this->rd_data_set($curtime, $stat, $subst, $step, $from); + $cc = get_called_class(); $body .= sprintf(" - - + + ", $this->rd_scristp++)); + +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - + static function base_get() + { + $c = get_called_class(); + printf("CALLED_CLASS: [%s]\n", $c); + return $c::BASE; + } } // end class User