X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2FObj%2Fbrisk.phh;h=62946ed10a3d356c1d4468d355ad43920b67f16a;hb=b1bb4eedabda830bd520f773928cd848c5dcb11a;hp=942a90c2ea6dd01de2d36dc21ee890ee68e7e9a9;hpb=3610477b5c8d4a8e1e9996014a81e257ba33c075;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index 942a90c..62946ed 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -2,7 +2,7 @@
/*
* brisk - brisk.phh
*
- * Copyright (C) 2006-2011 Matteo Nastasi
+ * Copyright (C) 2006-2012 Matteo Nastasi
* mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
@@ -286,7 +286,7 @@ Copyright 2006-2012 Matteo Nasta
declaration briscola in ajax sauce (Beta)
version '.$G_brisk_version.'
-Copyright 2006-2009 Matteo Nastasi (aka mop)
');
+Copyright 2006-2012 Matteo Nastasi (aka mop)
');
function mop_flush()
{
@@ -680,7 +680,7 @@ class Room {
var $match;
var $comm; // commands for many people
var $step; // current step of the comm array
- // externalized var $garbage_timeout;
+ var $garbage_timeout;
var $shm_sz;
function Room () {
@@ -709,8 +709,7 @@ class Room {
else
$this->table[$i]->auth_only = FALSE;
}
- // externalized $this->garbage_timeout = 0;
- Room::garbage_time_expire_set(0);
+ $this->garbage_timeout = 0;
$this->shm_sz = SHM_DIMS_MIN;
}
@@ -725,8 +724,7 @@ class Room {
/* Garbage collector degli utenti in timeout */
$curtime = time();
- // externalized if ($force || $this->garbage_timeout < $curtime) {
- if (!$force && !Room::garbage_time_is_expired($curtime)) {
+ if (!$force && !($this->garbage_timeout < $curtime)) {
return ($ismod);
}
@@ -874,8 +872,7 @@ class Room {
}
log_rd2("GARBAGE UPDATED!");
- // externalized $this->garbage_timeout = time() + GARBAGE_TIMEOUT;
- Room::garbage_time_expire_set($curtime + GARBAGE_TIMEOUT);
+ $this->garbage_timeout = $curtime + GARBAGE_TIMEOUT;
$ismod = TRUE;
return ($ismod);
@@ -2135,48 +2132,6 @@ class Room {
return ($ret);
}
- static function garbage_time_is_expired($tm)
- {
- $ret = TRUE;
- $fp = FALSE;
- do {
- if (file_exists(PROXY_PATH) == FALSE)
- mkdir(PROXY_PATH, 0775, TRUE);
- if (($fp = @fopen(PROXY_PATH."/garbage_time.expired", 'rb')) == FALSE)
- break;
- if (($s = fread($fp, 4)) == FALSE)
- break;
- if (mb_strlen($s, "ASCII") != 4)
- break;
- $arr = unpack('Le', $s);
- if ($arr['e'] > $tm)
- $ret = FALSE;
- } while (0);
-
- if ($fp != FALSE)
- fclose($fp);
-
- log_rd2("END: return ".($ret ? "TRUE" : "FALSE"));
-
- return ($ret);
- }
-
- static function garbage_time_expire_set($tm)
- {
- do {
- if (file_exists(PROXY_PATH) == FALSE)
- mkdir(PROXY_PATH, 0775, TRUE);
- if (($fp = @fopen(PROXY_PATH."/garbage_time.expired", 'wb')) == FALSE)
- break;
- fwrite($fp, pack("L",$tm));
- fclose($fp);
-
- return (TRUE);
- } while (0);
-
- return (FALSE);
- }
-
function request_mgr(&$s_a_p, &$header_out, &$new_socket, $path, $addr, $get, $post, $cookie)
{
printf("NEW_SOCKET (root): %d\n", intval($new_socket));