sed -i "s@\( \+cookiepath *: *\)\"[^\"]*\" *,@\1 \"$prefix_path\",@g" ${web_path}__/xynt-streaming.js
document_root="$(grep DocumentRoot "${apache_conf}" | grep -v '^[ ]*#' | awk '{ print $2 }')"
-sed -i "s@^\(\$DOCUMENT_ROOT *= *[\"']\)[^\"']*\([\"']\)@\1$document_root\2@g" ${web_path}__/spush/*.ph*
+sed -i "s@^\(\$DOCUMENT_ROOT *= *[\"']\)[^\"']*\([\"']\)@\1$document_root\2@g" ${web_path}__/spush/*.ph* ${web_path}__/donometer.php
if [ -d ../brisk-img ]; then
cd ../brisk-img
function users_cleanup()
{
+ $curtime = time();
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
$user_cur = $this->user[$i];
- if ($user_cur->the_end) {
+ if ($user_cur->the_end
+ && (($user_cur->rd_toflush == FALSE
+ && $user_cur->rd_step == $user_cur->step)
+ || $user_cur->rd_endtime_is_expired($curtime))
+ ) {
$user_cur->reset(); // users_cleanup, OK
}
}
foreach ($this->socks as $k => $sock) {
$id = intval($sock);
if (isset($this->s2u[$id])) {
- if ($this->s2u[$id]->the_end) {
- if ($this->s2u[$id]->rd_socket_get() != NULL) {
- $this->s2u[$id]->rd_socket_set(NULL);
+ $user = $this->s2u[$id];
+ if ($user->the_end) {
+ if (($user->rd_toflush == FALSE && $user->rd_step == $user->step)
+ || $user->rd_endtime_is_expired($this->curtime)) {
+ if ($user->rd_socket_get() != NULL) {
+ $user->rd_socket_set(NULL);
+ }
+ unset($this->socks[$id]);
+ unset($this->s2u[$id]);
+ fclose($sock);
+ printf("CLOSE ON GARBAGE MANAGER\n");
}
- unset($this->socks[$id]);
- unset($this->s2u[$id]);
- fclose($sock);
- printf("CLOSE ON GARBAGE MANAGER\n");
}
}
}
*/
$G_base = "";
+$DOCUMENT_ROOT="";
require_once("Obj/brisk.phh");
}
else if ($argz[0] == 'logout') {
$brisk->ghost_sess->push($curtime, $user->sess, GHOST_SESS_REAS_LOUT);
+
$user->the_end = TRUE;
+ $brisk->room_outstandup($user);
- if ($user->subst == 'sitdown') {
- log_load("ROOM WAKEUP");
- $brisk->room_wakeup($user);
- }
- else if ($user->subst == 'standup')
- $brisk->room_outstandup($user);
- else
- log_rd2("LOGOUT FROM WHAT ???");
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+ $user->comm[$user->step % COMM_N] .= sprintf('gst.st_loc++; xstm.stop(); window.onbeforeunload = null; window.onunload = null; document.location.assign("index.php");');
+ $user->step_inc();
}
}
/**********************
}
else if ($argz[0] == 'logout') {
$brisk->ghost_sess->push($curtime, $user->sess, GHOST_SESS_REAS_LOUT);
- $user->the_end = TRUE;
+ $user->the_end = TRUE;
$brisk->room_wakeup($user);
+
+ $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
+ $user->comm[$user->step % COMM_N] .= sprintf('gst.st_loc++; xstm.stop(); window.onbeforeunload = null; window.onunload = null; document.location.assign("index.php");');
+ $user->step_inc();
}
}
}