X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=942a90c2ea6dd01de2d36dc21ee890ee68e7e9a9;hb=3610477b5c8d4a8e1e9996014a81e257ba33c075;hp=af2a9012c57b6309e879eb4bca324ae9b2eaad5c;hpb=b6f3d93f02fbf3adf376f9fbaad8cc739b8d3145;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index af2a901..942a90c 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -45,10 +45,13 @@ define('COMM_GEN_N', 50); define('CHAT_N', 3); define('CHAT_ILL_TIME', 6); +define('CHAT_ENABLED', TRUE); define('SESS_LEN', 13); define('STREAM_TIMEOUT', 60); /* FIXME: move to sac-a-push .phh */ +/* TIME_RD define the server-side timeout, after half of it a ping request + is sent to client, after this time the client is log out */ define('EXPIRE_TIME_RD', 180); define('EXPIRE_TIME_SMAMMA', 360); define('EXPIRE_TIME_WAG', 10); @@ -1478,7 +1481,7 @@ class Room { else { // normal chat line $is_normchat = TRUE; - if ($curtime < ($user->chat_ban + $user->chat_dlt)) { + if (CHAT_ENABLED && $curtime < ($user->chat_ban + $user->chat_dlt)) { $only_you = TRUE; $user->chat_dlt = $user->chat_dlt * 2; if ($user->chat_dlt > 120) @@ -1486,7 +1489,7 @@ class Room { } else if ($user->chat_lst == $msg) $only_you = TRUE; - else if ($curtime - $user->chattime[($user->chat_cur + 1) % CHAT_N] < CHAT_ILL_TIME) { + else if (CHAT_ENABLED && $curtime - $user->chattime[($user->chat_cur + 1) % CHAT_N] < CHAT_ILL_TIME) { $user->chat_ban = $curtime; $user->chat_dlt = 5; $only_you = TRUE; @@ -1652,9 +1655,9 @@ class Room { * if ($idx == -$idx && ret == user) => SUCCESS (but the login exists in the auth db) */ - function add_user(&$sess, &$idx, $name, $pass, $ip) + function add_user(&$sess, &$idx, $name, $pass, $ip, $cookie) { - GLOBAL $G_base, $CO_list; + GLOBAL $G_base; $idx = 0; @@ -1794,12 +1797,12 @@ class Room { $this->user[$idx]->code = $authenticate->code_get(); $this->user[$idx]->flags |= USER_FLAG_LISTAUTH; - if (isset($CO_list)) { - if (strcmp($CO_list, "auth") == 0) { + if (isset($cookie['CO_list'])) { + if (strcmp($cookie['CO_list'], "auth") == 0) { $this->user[$idx]->flags &= ~USER_FLAG_MAP_AUTH; $this->user[$idx]->flags |= USER_FLAG_LISTAUTH; } - if (strcmp($CO_list, "isolation") == 0) { + if (strcmp($cookie['CO_list'], "isolation") == 0) { $this->user[$idx]->flags &= ~USER_FLAG_MAP_AUTH; $this->user[$idx]->flags |= USER_FLAG_ISOLAUTH; } @@ -2178,6 +2181,8 @@ class Room { { printf("NEW_SOCKET (root): %d\n", intval($new_socket)); + force_no_cache($header_out); + switch ($path) { case "": case "index.php": @@ -2186,8 +2191,6 @@ class Room { $content = ob_get_contents(); ob_end_clean(); - force_no_cache($header_out); - $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content); return TRUE; @@ -2198,8 +2201,6 @@ class Room { $content = ob_get_contents(); ob_end_clean(); - force_no_cache($header_out); - $s_a_p->pgflush_try_add($new_socket, 20, $header_out, $content); return TRUE;