*
*/
-require_once("brisk.phh");
+require_once("Obj/brisk.phh");
log_load($sess, "LOAD: index_rd.php ".$QUERY_STRING);
$ret = FALSE;
$room = FALSE;
- log_rd2($sess, "M");
+ // log_rd2($sess, "M");
/* Sync check (read only without modifications */
ignore_user_abort(TRUE);
if (($sem = Room::lock_data()) != FALSE) {
}
if ($room == FALSE) {
- ignore_user_abort(TRUE);
- if (($sem = Room::lock_data()) != FALSE) {
+ do {
+ ignore_user_abort(TRUE);
+ if (($sem = Room::lock_data()) == FALSE)
+ break;
+
log_only($sess, "P");
- $room = &Room::load_data();
+ if (($room = &Room::load_data()) == FALSE)
+ break;
+ } while (0);
+
+ if ($sem != FALSE)
Room::unlock_data($sem);
- ignore_user_abort(FALSE);
- }
- else {
+
+ ignore_user_abort(FALSE);
+ if ($room == FALSE)
return (FALSE);
- }
}
if (($user = &$room->get_user($sess, $idx)) == FALSE) {
}
if ($cur_step == -1) {
- log_rd2($sess, "PRE-NEWSTAT.");
+ log_rd2($sess, "PRE-NEWSTAT: ".$user->stat);
if ($user->stat == 'room') {
log_rd($sess, "roomma");
$ret .= show_room(&$room, &$user);
+
+ /* NOTE the sets went common */
+ $new_stat = $user->stat;
+ $new_subst = $user->subst;
+ $new_step = $user->step;
}
/***************
* *
* *
***************/
else if ($user->stat == 'table') {
- $ret = show_table(&$room,&$user,$user->step,FALSE,FALSE);
+ /* FIXME we need to decide what do in this case
+
+ if ($user->subst != "shutdowned" && $user->subst != "shutdowner")
+ $ret = show_table(&$room,&$user,$user->step,FALSE,FALSE);
log_rd2($sess, "SENDED TO THE STREAM: ".$ret);
+
+
+ $new_stat = $user->stat;
+ $new_subst = $user->subst;
+ $new_step = $user->step;
+ */
+ log_rd2($sess, "ALL COMMENTED: ".$ret);
+
+
}
log_rd2($sess, "NEWSTAT: ".$user->stat);
- $new_stat = $user->stat;
- $new_subst = $user->subst;
- $new_step = $user->step;
}
else {
ignore_user_abort(TRUE);
$to_stat = $user->stat;
Room::unlock_data($sem);
ignore_user_abort(FALSE);
+ log_load($user->sess, "RESYNC");
return (page_sync($user->sess, $to_stat == "table" ? "table.php" : "index.php"));
}
log_rd2($sess, "lost history, refresh from scratch");
$user->name = "";
$user->the_end = FALSE;
- if ($user->subst == 'sitdown')
+ if ($user->subst == 'sitdown') {
+ log_load($user->sess, "ROOM WAKEUP");
$room->room_wakeup(&$user);
+ }
else if ($user->subst == 'standup')
$room->room_outstandup(&$user);
else
*/
$is_page_streaming = ((stristr($HTTP_USER_AGENT, "linux") &&
- stristr($HTTP_USER_AGENT, "firefox")) ? FALSE : TRUE);
+ (stristr($HTTP_USER_AGENT, "firefox") || stristr($HTTP_USER_AGENT, "iceweasel"))) ? FALSE : TRUE);
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1