briscola chiamata in salsa ajax
</div>
<br><b>version '.$G_brisk_version.'</b><br><br>
-Copyright 2006-2009 <a href=\\"mailto:brisk@alternativeoutput.it\\">Matteo Nastasi</a> (aka mop)<br><br>',
+Copyright 2006-2012 <a href=\\"mailto:brisk@alternativeoutput.it\\">Matteo Nastasi</a> (aka mop)<br><br>',
'en' => '<br>
<div id=\\"header\\" class=\\"header\\">
<img class=\\"nobo\\" src=\\"img/brisk_logo64.png\\">
define('USER_FLAG_TY_SUSPEND', 0x400000); // done
define('USER_FLAG_TY_DISABLE', 0x800000); // done
+// 240 is the right value, 600 is for fwrite error test
+define('RD_ENDTIME_DELTA', 240);
+define('RD_KEEPALIVE_TOUT', 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
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_kalive; // if no message are sent after RD_KEEPALIVE_TOUT secs we send a keepalive from server
+ var $rd_cache; // store place where failed fwrite data
+
var $comm; // commands array
// var $asta_card; //
// var $asta_pnt; //
$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_kalive = -1;
+ $thiz->rd_cache = "";
+
$thiz->asta_card = -2;
$thiz->asta_pnt = -1;
$thiz->handpt = -1;
return ($thiz);
}
+ function rd_data_set($curtime, $stat, $subst, $step, $from)
+ {
+ $this->rd_endtime = $curtime + RD_ENDTIME_DELTA;
+ $this->rd_stat = $stat;
+ $this->rd_subst = $subst;
+ $this->rd_step = $step;
+ $this->rd_from = $from;
+ $this->rd_scristp = 0;
+ $this->rd_kalive = $curtime + RD_KEEPALIVE_TOUT;
+ }
+
+ function rd_socket_get() {
+ return ($this->rd_socket);
+ }
+
+ function rd_socket_set($sock) {
+ $this->rd_socket = $sock;
+ }
+
+ function rd_kalive_get()
+ {
+ return ($this->rd_kalive);
+ }
+
+ function rd_kalive_set($tm)
+ {
+ $this->rd_kalive = $tm;
+ }
+
+ function rd_kalive_is_expired($tm)
+ {
+ // printf("rd_kalive %d tm %d\n", $this->rd_kalive, $tm);
+ return ($this->rd_kalive < $tm);
+ }
+
+ function rd_endtime_is_expired($tm)
+ {
+ // printf("rd_endtime %d tm %d\n", $this->rd_kalive, $tm);
+ return ($this->rd_endtime < $tm);
+ }
+
+ function rd_kalive_reset($tm)
+ {
+ $this->rd_kalive = $tm + RD_KEEPALIVE_TOUT;
+ }
+
+ function rd_cache_get()
+ {
+ return ($this->rd_cache);
+ }
+
+ function rd_cache_set($cache)
+ {
+ $this->rd_cache = $cache;
+ }
+
function idx_get() {
return ($this->idx);
}
return TRUE;
}
+
function save_step()
{
do {
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 = "";
$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);
}