X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2FObj%2Fbrisk.phh;h=799ea68bf2263bd0b3a8a9ef2d16f4f869c94fa2;hb=45fd3084c52ef5c560300fa32a2fef75edc47ca7;hp=c74c141137053accc757fcc5b93a0c17b1ac71e0;hpb=b69edecb81b57155e62fb35ff594873a43560bda;p=brisk.git
diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh
index c74c141..799ea68 100644
--- a/web/Obj/brisk.phh
+++ b/web/Obj/brisk.phh
@@ -134,12 +134,12 @@ $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 = "3.4.3";
+$G_brisk_version = "3.5.0";
/* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': versione di test per la nuova gestione dei dati volatili, rivista gestione del ticker.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NOVITA\': seconda versione di test per la nuova gestione dei dati volatili, rivista gestione del ticker.',
'Se vuoi iscriverti alla Mailing List, cliccala!' ),
- 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: test version for the new volatile data management, ticker management refactored.',
+ 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), NEWS: second test version for the new volatile data management, ticker management refactored.',
'If you want to subscribe our Mailing List, click it!' ) );
$G_room_help = array( 'it' => '
@@ -638,8 +638,6 @@ class User {
}
function create($idx, $name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
- // error_log("User::create BEGIN", 0);
-
if (($thiz = new User()) == FALSE)
return (FALSE);
@@ -816,6 +814,19 @@ class User {
{
$this->step = $step & 0x7fffffff;
+ return (TRUE);
+ }
+
+ function step_inc($delta = 1) {
+ $this->step += $delta;
+ /* modularization because unpack() not manage unsigned 32bit int correctly */
+ $this->step &= 0x7fffffff;
+
+ return TRUE;
+ }
+
+ function save_step()
+ {
do {
if (validate_sess($this->sess) == FALSE)
break;
@@ -825,7 +836,7 @@ class User {
break;
fwrite($fp, pack("LL",$this->step, $this->idx));
fclose($fp);
-
+
log_main("step_set [".$this->sess. "] [".$this->step."]");
return (TRUE);
@@ -834,27 +845,7 @@ class User {
return (FALSE);
}
- function step_inc($delta = 1) {
- $this->step += $delta;
- /* modularization because unpack() not manage unsigned 32bit int correctly */
- $this->step &= 0x7fffffff;
-
- if (validate_sess($this->sess)) {
- if (file_exists(PROXY_PATH) == FALSE)
- mkdir(PROXY_PATH);
- $fp = fopen(PROXY_PATH."/".$this->sess.".step", 'w');
- fwrite($fp, pack("LL", $this->step, $this->idx));
- fclose($fp);
-
- log_main("step_inc [".$this->sess. "] [".$this->step."]");
-
- return (TRUE);
- }
-
- return (FALSE);
- }
-
- static function step_get($sess)
+ static function load_step($sess)
{
$fp = FALSE;
do {
@@ -904,8 +895,6 @@ class User {
static function load_data($id, $sess)
{
- // error_log("User::load_data BEGIN", 0);
-
log_main("load_data: id [".$id."] sess [".($sess == FALSE ? "FALSE" : $sess)."] ");
$doexit = FALSE;
@@ -931,8 +920,6 @@ class User {
break;
}
log_only("user == ".($user == FALSE ? "FALSE" : "TRUE")." user === ".($user === FALSE ? "FALSE" : "TRUE")." user isset ".(isset($user) ? "TRUE" : "FALSE"));
- if (isset($user))
- log_only("bri count ".count($user));
if ($user == FALSE) {
log_only("INIT MAIN DATA");
@@ -944,7 +931,20 @@ class User {
log_only(serialize($user));
}
}
-
+ else {
+ if ($sess != FALSE) {
+ /*
+ * NOTE: this part is for check only, theoretically
+ * user->step anch proxy_step are set allways at the same value
+ */
+ $old_step = $user->step;
+ $arr = User::load_step($sess);
+ $user->step = $arr['s'];
+ if ($old_step != $user->step) {
+ log_crit("steps are diffetents User->step ".$user->step." Old_step: ".$old_step);
+ }
+ }
+ }
$user->shm_sz = $shm_sz;
shm_detach($shm);
@@ -969,9 +969,6 @@ class User {
$shm = FALSE;
- // var_dump($user);
- // error_log("User::save_data BEGIN", 0);
-
if (($tok = @ftok(FTOK_PATH."/user".$id, "B")) == -1) {
return (FALSE);
}
@@ -982,6 +979,8 @@ class User {
// log_only("PUT_VAR DI ".strlen(serialize($user)));
if (shm_put_var($shm, $tok, $user) != FALSE) {
shm_detach($shm);
+ if ($user->sess != "")
+ $user->save_step();
log_main("User[".$id."] saved.");
return (TRUE);
}
@@ -2030,7 +2029,6 @@ class Room {
log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE"));
if ($authenticate != FALSE) {
- // error_log(print_r(&$authenticate, TRUE),0);
$user_type = $authenticate->type_get();
}
else {
@@ -2243,8 +2241,6 @@ class Room {
GLOBAL $sess;
$doexit = FALSE;
- // error_log("Room::load_data BEGIN", 0);
-
do {
if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1) {
log_main("ftok failed");
@@ -2270,8 +2266,6 @@ class Room {
log_only("INIT MAIN DATA");
shm_detach($shm);
- // error_log("DE CHE", 0);
-
$room = Room::create();
if (Room::save_data($room) == FALSE)
@@ -2343,9 +2337,6 @@ class Room {
$ret = FALSE;
$shm = FALSE;
- // var_dump($room);
- // error_log("Room::save_data BEGIN", 0);
-
if (($tok = @ftok(FTOK_PATH."/main", "B")) == -1)
return (FALSE);
@@ -2499,7 +2490,7 @@ class Room {
do {
if (file_exists(PROXY_PATH) == FALSE)
mkdir(PROXY_PATH);
- if (($fp = @fopen(PROXY_PATH."/room_garbage_time.expired", 'rb')) == FALSE)
+ if (($fp = @fopen(PROXY_PATH."/garbage_time.expired", 'rb')) == FALSE)
break;
if (($s = fread($fp, 4)) == FALSE)
break;
@@ -2523,7 +2514,7 @@ class Room {
do {
if (file_exists(PROXY_PATH) == FALSE)
mkdir(PROXY_PATH);
- if (($fp = @fopen(PROXY_PATH."/room_garbage_time.expired", 'wb')) == FALSE)
+ if (($fp = @fopen(PROXY_PATH."/garbage_time.expired", 'wb')) == FALSE)
break;
fwrite($fp, pack("L",$tm));
fclose($fp);
@@ -2942,6 +2933,8 @@ function secstoword($secs)
{
GLOBAL $G_lang;
+ $ret = "";
+
$mins = floor($secs / 60);
$secs = $secs % 60;
if ($G_lang == 'en') {