X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=fb88f57595a996aea2a2fc39a69a3053d22e6865;hb=90c7420f07b9198d094ae0d297c391ede9adc1d9;hp=5f26a2ebc50209251973d3aa6bf5f6487df5c38f;hpb=ff3b3022f53716002c3ff856fa32723f2ecfadff;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 5f26a2e..fb88f57 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -78,7 +78,7 @@ define('BRISK_DEBUG', 0x0800); define('BRISK_SINGLE_DEBUG',0); define('BRISK_SINGLE_SESS', ""); -// define(DEBUGGING, "local"); +define('DEBUGGING', "no-debugging"); require_once("$DOCUMENT_ROOT/Etc/".BRISK_CONF); @@ -275,7 +275,7 @@ $G_room_about = array( 'it' => '
briscola chiamata in salsa ajax
version '.$G_brisk_version.'

-Copyright 2006-2009 Matteo Nastasi (aka mop)

', +Copyright 2006-2012 Matteo Nastasi (aka mop)

', 'en' => '
@@ -690,6 +690,8 @@ define('USER_FLAG_TY_SUPER', 0x020000); // done define('USER_FLAG_TY_SUSPEND', 0x400000); // done define('USER_FLAG_TY_DISABLE', 0x800000); // done +define('RD_STREAM_TIMEOUT', 4); + class User { var $idx; // index in the users array when you are in game var $idx_orig; // index in the users array when you aren't in game @@ -704,6 +706,16 @@ class User { var $subst; // substatus for each status var $step; // step of the current status var $trans_step; // step to enable transition between pages (disable == -1) + + var $rd_socket; // socket handle of push stream + var $rd_endtime; // end time for push stream + var $rd_stat; // actual status of push stream + var $rd_subst; // actual substatus of push stream + var $rd_step; // actual step of push stream + var $rd_from; // referer + var $rd_scristp; // current script step (for each session) + var $rd_tout; // if no message are sent after RD_STREAM_TIMEOUT secs we send a keepalive from server + var $comm; // commands array // var $asta_card; // // var $asta_pnt; // @@ -747,6 +759,16 @@ class User { $thiz->step = 1; $thiz->trans_step = -1; $thiz->comm = array(); + + $thiz->rd_socket = NULL; + $thiz->rd_endtime = -1; + $thiz->rd_stat = -1; + $thiz->rd_subst = ""; + $thiz->rd_step = -1; + $thiz->rd_from = ""; + $thiz->rd_scristp = -1; + $thiz->rd_tout = -1; + $thiz->asta_card = -2; $thiz->asta_pnt = -1; $thiz->handpt = -1; @@ -879,6 +901,52 @@ class User { return ($thiz); } + function rd_data_set($curtime, $stat, $subst, $step, $from) + { + $this->rd_endtime = $curtime + STREAM_TIMEOUT; + $this->rd_stat = $stat; + $this->rd_subst = $subst; + $this->rd_step = $step; + $this->rd_from = $from; + $this->rd_scristp = 0; + $this->rd_tout = $curtime + RD_STREAM_TIMEOUT; + } + + function rd_socket_get() { + return ($this->rd_socket); + } + + function rd_socket_set($sock) { + $this->rd_socket = $sock; + } + + function rd_tout_get() + { + return ($this->rd_tout); + } + + function rd_tout_set($tm) + { + $this->rd_tout = $tm; + } + + function rd_tout_is_expired($tm) + { + // printf("rd_tout %d tm %d\n", $this->rd_tout, $tm); + return ($this->rd_tout < $tm); + } + + function rd_endtime_is_expired($tm) + { + // printf("rd_endtime %d tm %d\n", $this->rd_tout, $tm); + return ($this->rd_endtime < $tm); + } + + function rd_tout_reset($tm) + { + $this->rd_tout = $tm + RD_STREAM_TIMEOUT; + } + function idx_get() { return ($this->idx); } @@ -917,6 +985,7 @@ class User { return TRUE; } + function save_step() { do { @@ -2939,7 +3008,7 @@ function log_auth($sess, $log) if (( (BRISK_DEBUG | ($sess == BRISK_SINGLE_SESS ? BRISK_SINGLE_DEBUG : 0) ) & DBG_AUTH) == 0) return; - if ((BRISK_DEBUG | ($ssess == BRISK_SINGLE_SESS ? BRISK_SINGLE_DEBUG : 0) ) & DBG_TRAC) + if ((BRISK_DEBUG | ($sess == BRISK_SINGLE_SESS ? BRISK_SINGLE_DEBUG : 0) ) & DBG_TRAC) $btrace = btrace_line(debug_backtrace()); else $btrace = ""; @@ -3104,7 +3173,7 @@ function sharedmem_sz($tok) $shm_sz = shmop_size($shm_id); shmop_close($shm_id); - log_main("shm_sz: ".$shm_sz." SHM_DIMS: ".SHM_DIMS); + // log_main("shm_sz: ".$shm_sz." SHM_DIMS: ".SHM_DIMS); return ($shm_sz); }