$G_lng = langtolng($G_lang);
$G_all_points = array( 11,10,4,3,2, 0,0,0,0,0 );
-$G_brisk_version = "4.12.0";
+$G_brisk_version = "4.12.4";
/* MLANG: ALL THE INFO STRINGS IN brisk.phh */
-$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: aggiunta la gestione automatica dei termini del servizio, comando /guar per info sul garante di un utente.',
+$root_wellarr = array( 'it' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NOVITA\'</b>: potenziato il sistema di debug.',
'Se vuoi iscriverti alla <a target="_blank" href="mailto:ml-briscola+subscribe@milug.org">Mailing List</a>, cliccala!' ),
- 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NEWS</b>: automatic management of terms of services added, new /guar command to ask info about a user guarantee.',
+ 'en' => array ( 'Brisk (Ver. '.$G_brisk_version.'), <b>NEWS</b>: empowered logging system.',
'If you want to subscribe our <a target="_blank" href="ml-briscola+subscribe@milug.org">Mailing List</a>, click it!' ) );
$G_room_help = array( 'it' => '
return ($this->player_n - 1);
}
- function user_rem($room, $user)
+ function user_rem($brisk, $user)
{
$tabpos = $user->table_pos;
/* verifico la consistenza dei dati */
- if ($room->user[$this->player[$tabpos]] == $user) {
+ if ($brisk->user[$this->player[$tabpos]] == $user) {
/* aggiorna l'array dei giocatori al tavolo. */
for ($i = $tabpos ; $i < $this->player_n-1 ; $i++) {
$this->player[$i] = $this->player[$i+1];
- $user_cur = $room->user[$this->player[$i]];
+ $user_cur = $brisk->user[$this->player[$i]];
$user_cur->table_pos = $i;
}
$this->player_n--;
}
-class Room
+class Brisk
{
static $delta_t;
var $delay_mgr;
- function Room ($crystal_filename) {
+ public static $sess_cur;
+
+ function Brisk($crystal_filename) {
$this->crystal_filename = $crystal_filename;
$this->user = array();
$this->table = array();
$this->shm_sz = SHM_DIMS_MIN;
$this->delay_mgr = new Delay_Manager(1.5);
+
+ static::$sess_cur = FALSE;
}
function garbage_manager($force)
$no_recovery = FALSE;
if (isset($this->match[$table_idx])) {
- $bri = $this->match[$table_idx];
+ $bin5 = $this->match[$table_idx];
- if ($table_cur->table_token != $bri->table_token) {
- log_main("ERROR: not matching table_token. Room: ".$table_cur->table_token." Table: ".$bri->table_token);
- log_main("ERROR: not matching table_start. Room: ".$table_cur->table_start." Table: ".$bri->table_start);
+ if ($table_cur->table_token != $bin5->table_token) {
+ log_main("ERROR: not matching table_token. Brisk: ".$table_cur->table_token." Table: ".$bin5->table_token);
+ log_main("ERROR: not matching table_start. Brisk: ".$table_cur->table_start." Table: ".$bin5->table_start);
$no_recovery = TRUE;
- $bri = FALSE;
+ $bin5 = FALSE;
}
- if ($bri != FALSE) {
+ if ($bin5 != FALSE) {
//
// SPAWN: JOIN
//
log_main("garbage_manager: bri loaded successfully.");
- $bri->garbage_manager(TRUE);
+ $bin5->garbage_manager(TRUE);
- $bri_table = $bri->table[0];
+ $bin5_table = $bin5->table[0];
// is the end of the table
- if ($bri->the_end == TRUE) {
+ if ($bin5->the_end == TRUE) {
/*
* DESTROY OF FINISHED TABLE && MOVE PLAYER TO ROOM AGAIN
*/
$plist .= '|'.$this->user[$table_cur->player[$i]]->sess;
}
- for ($i = 0 ; $i < $bri_table->player_n ; $i++) {
+ for ($i = 0 ; $i < $bin5_table->player_n ; $i++) {
// stat must be "table" by definition
$user_cur = $this->user[$table_cur->player[$i]];
- $bri_user = $bri->user[$i];
+ $bin5_user = $bin5->user[$i];
- $user_cur->subst = $bri_user->subst;
- $user_cur->step = $bri_user->step;
- $user_cur->lacc = $bri_user->lacc;
- $user_cur->laccwr = $bri_user->lacc;
- $user_cur->bantime = $bri_user->bantime;
+ $user_cur->subst = $bin5_user->subst;
+ $user_cur->step = $bin5_user->step;
+ $user_cur->lacc = $bin5_user->lacc;
+ $user_cur->laccwr = $bin5_user->lacc;
+ $user_cur->bantime = $bin5_user->bantime;
}
log_legal($curtime, $user_cur->ip, $user_cur, "STAT:DESTROY_GAME", $plist);
else {
log_main("gm:: save_data");
- for ($i = 0 ; $i < $bri_table->player_n ; $i++) {
- $this->user[$table_cur->player[$i]]->lacc = $bri->user[$i]->lacc;
+ for ($i = 0 ; $i < $bin5_table->player_n ; $i++) {
+ $this->user[$table_cur->player[$i]]->lacc = $bin5->user[$i]->lacc;
}
}
- } // if ($bri == FALSE
+ } // if ($bin5 == FALSE
else if ($no_recovery == FALSE) {
log_crit("ERROR: table ".$table_idx." unrecoverable join");
// Before all align times with table timeout
for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) {
if (isset($this->match[$table_idx])) {
- $bri = $this->match[$table_idx];
+ $bin5 = $this->match[$table_idx];
- $bri_table = $bri->table[0];
- for ($i = 0 ; $i < $bri_table->player_n ; $i++) {
+ $bin5_table = $bin5->table[0];
+ for ($i = 0 ; $i < $bin5_table->player_n ; $i++) {
// stat must be "table" by definition
- $bri_user = $bri->user[$i];
+ $bin5_user = $bin5->user[$i];
- if ($target != "" && $bri_user->name != $target)
+ if ($target != "" && $bin5_user->name != $target)
continue;
log_main("writa: ".$user_mesg);
- $bri_user->comm[$bri_user->step % COMM_N] = "gst.st = ".($bri_user->step+1)."; ";
- $bri_user->comm[$bri_user->step % COMM_N] .= $to_tabl;
- $bri_user->step_inc();
+ $bin5_user->comm[$bin5_user->step % COMM_N] = "gst.st = ".($bin5_user->step+1)."; ";
+ $bin5_user->comm[$bin5_user->step % COMM_N] .= $to_tabl;
+ $bin5_user->step_inc();
}
} // if (isset($this->match
} // for ($table_idx = 0 ; $table_idx < TABLES_N ; $table_idx++) {
}
/*
- * function add_user(&$room, &$sess, &$idx, $name, $pass, $ip)
+ * function add_user(&$brisk, &$sess, &$idx, $name, $pass, $ip)
*
* RETURN VALUE:
* if ($idx > -1 && ret == FALSE) => duplicated nick
if ($ghost_user->stat == "table" && $this->table[$table_idx]->player_n == PLAYERS_N) {
require_once("${G_base}briskin5/Obj/briskin5.phh");
if (isset($this->match[$table_idx])) {
- $bri = $this->match[$table_idx];
+ $bin5 = $this->match[$table_idx];
- if ($bri->the_end != TRUE) {
- $bri->user[$ghost_user->table_pos]->comm[$bri->user[$ghost_user->table_pos]->step % COMM_N] = "";
- $bri->user[$ghost_user->table_pos]->step_inc();
- $bri->user[$ghost_user->table_pos]->sess = $sess;
+ if ($bin5->the_end != TRUE) {
+ $bin5->user[$ghost_user->table_pos]->comm[$bin5->user[$ghost_user->table_pos]->step % COMM_N] = "";
+ $bin5->user[$ghost_user->table_pos]->step_inc();
+ $bin5->user[$ghost_user->table_pos]->sess = $sess;
}
}
}
// Static functions
static function create($crystal_filename)
{
- if (($room_ser = @file_get_contents($crystal_filename)) == FALSE ||
- ($room = unserialize($room_ser)) == FALSE) {
+ if (($brisk_ser = @file_get_contents($crystal_filename)) == FALSE ||
+ ($brisk = unserialize($brisk_ser)) == FALSE) {
fprintf(STDERR, "NEW ROOM\n");
- $room = new Room($crystal_filename);
+ $brisk = new Brisk($crystal_filename);
}
else {
fprintf(STDERR, "ROOM FROM FILE\n");
rename($crystal_filename, $crystal_filename.".old");
}
- return $room;
+ return $brisk;
}
$shm_sz = SHM_DIMS_MIN;
if ($shm = shm_attach($tok, $shm_sz)) {
- $room = @shm_get_var($shm, $tok); // CHECKED BELOW
+ $brisk = @shm_get_var($shm, $tok); // CHECKED BELOW
- log_only("bri == ".($room == FALSE ? "FALSE" : "TRUE")." bri === ".($room === FALSE ? "FALSE" : "TRUE")." bri isset ".(isset($room) ? "TRUE" : "FALSE"));
- if (isset($room))
- log_only("bri count ".count($room));
+ log_only("bri == ".($brisk == FALSE ? "FALSE" : "TRUE")." bri === ".($brisk === FALSE ? "FALSE" : "TRUE")." bri isset ".(isset($brisk) ? "TRUE" : "FALSE"));
+ if (isset($brisk))
+ log_only("bri count ".count($brisk));
- if ($room == FALSE) {
+ if ($brisk == FALSE) {
log_only("INIT MAIN DATA");
shm_detach($shm);
- $room = Room::create();
+ $brisk = Brisk::create();
- log_shme("Room::create");
+ log_shme("Brisk::create");
- if (Room::save_data($room) == FALSE)
+ if (Brisk::save_data($brisk) == FALSE)
return FALSE;
- return $room;
+ return $brisk;
}
- $room->shm_sz = $shm_sz;
+ $brisk->shm_sz = $shm_sz;
shm_detach($shm);
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- if (($room->user[$i] = User::load_data($i, FALSE)) == FALSE) {
+ if (($brisk->user[$i] = User::load_data($i, FALSE)) == FALSE) {
log_crit("User::load_data failed");
break;
}
//
// SHSPLIT: load users from the shared memory
//
- return ($room);
+ return ($brisk);
} while (0);
return (FALSE);
}
- function save_data_orig($room)
+ function save_data_orig($brisk)
{
GLOBAL $sess;
$shm = FALSE;
- // var_dump($room);
+ // var_dump($brisk);
if (($tok = @ftok(FTOK_PATH."/main", "C")) == -1)
return (FALSE);
- while ($room->shm_sz < SHM_DIMS_MAX) {
- if (($shm = shm_attach($tok, $room->shm_sz)) == FALSE)
+ while ($brisk->shm_sz < SHM_DIMS_MAX) {
+ if (($shm = shm_attach($tok, $brisk->shm_sz)) == FALSE)
break;
- // log_only("PUT_VAR DI ".strlen(serialize($room)));
- if (@shm_put_var($shm, $tok, $room) != FALSE) {
+ // log_only("PUT_VAR DI ".strlen(serialize($brisk)));
+ if (@shm_put_var($shm, $tok, $brisk) != FALSE) {
shm_detach($shm);
return (TRUE);
}
break;
}
shm_detach($shm);
- $room->shm_sz += SHM_DIMS_DLT;
+ $brisk->shm_sz += SHM_DIMS_DLT;
}
if ($shm)
}
function dump_data()
{
- $room_ser = serialize($this);
- $room_ser_len = mb_strlen($room_ser, "ASCII");
- if (file_put_contents($this->crystal_filename, $room_ser) == $room_ser_len) {
+ $brisk_ser = serialize($this);
+ $brisk_ser_len = mb_strlen($brisk_ser, "ASCII");
+ if (file_put_contents($this->crystal_filename, $brisk_ser) == $brisk_ser_len) {
return (TRUE);
}
return (FALSE);
}
- function save_data($room)
+ function save_data($brisk)
{
GLOBAL $sess;
if (($tok = @ftok(FTOK_PATH."/main", "C")) == -1)
return (FALSE);
- // SHSPLIT: before save the $room you must save users,
+ // SHSPLIT: before save the $brisk you must save users,
// detach from main struct and (then) reattach
$user_park = array();
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
- $user_park[$i] = $room->user[$i];
- $room->user[$i] = FALSE;
+ $user_park[$i] = $brisk->user[$i];
+ $brisk->user[$i] = FALSE;
}
- while ($room->shm_sz < SHM_DIMS_MAX) {
- if (($shm = shm_attach($tok, $room->shm_sz)) == FALSE)
+ while ($brisk->shm_sz < SHM_DIMS_MAX) {
+ if (($shm = shm_attach($tok, $brisk->shm_sz)) == FALSE)
break;
- // log_only("PUT_VAR DI ".strlen(serialize($room)));
- if (@shm_put_var($shm, $tok, $room) != FALSE) {
- log_shme("Room::save_data");
+ // log_only("PUT_VAR DI ".strlen(serialize($brisk)));
+ if (@shm_put_var($shm, $tok, $brisk) != FALSE) {
+ log_shme("Brisk::save_data");
$ret = TRUE;
break;
}
break;
}
shm_detach($shm);
- $room->shm_sz += SHM_DIMS_DLT;
+ $brisk->shm_sz += SHM_DIMS_DLT;
}
if ($shm)
// SHSPLIT: reattach users to the room class
for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
User::save_data($user_park[$i], $i);
- $room->user[$i] = $user_park[$i];
+ $brisk->user[$i] = $user_park[$i];
}
log_load("FINISH: ".($ret == TRUE ? "TRUE" : "FALSE"));
break;
}
+ $this->sess_cur_set($user->sess);
// close a previous opened index_read_ifra socket, if exists
if (($prev = $user->rd_socket_get()) != NULL) {
$s_a_p->socks_unset($user->rd_socket_get());
}
return NULL;
}
+ function sess_cur_set($sess)
+ {
+ static::$sess_cur = $sess;
+ }
-} // end class Room
+ static function sess_cur_get()
+ {
+ return(static::$sess_cur);
+ }
+} // end class Brisk
function make_seed()
{
function log_mop($step, $log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_LMOP) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_only2($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_ONL2) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_crit($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_CRIT) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_only($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_ONLY) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_main($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_MAIN) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_rd($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_READ) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_rd2($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_REA2) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_send($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_SEND) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_lock($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_LOCK) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_wr($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_WRIT) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_load($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_LOAD) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
function log_shme($log)
{
- GLOBAL $sess, $PHP_SELF;
+ GLOBAL $PHP_SELF;
if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_SHME) == 0)
return;
+ $sess = Brisk::sess_cur_get();
if (isset($sess) == FALSE)
$ssess = "XXXX";
else
$this->main_loop = TRUE;
while ($this->main_loop) {
+ $this->app->sess_cur_set(FALSE);
$this->curtime = time();
fprintf(STDERR, "IN LOOP: Current opened: %d pending_pages: %d\n", count($this->socks), count($this->pending_pages));
);
class User {
- var $room; // reference to the room where the user is registered
+ var $brisk; // reference to the room where the user is registered
var $idx; // index in the room users array when you are in game
var $idx_orig; // index in the room table users array when you aren't in game
var $code; // authentication code
function User() {
}
- static function create(&$room, $idx, $name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
+ static function create(&$brisk, $idx, $name, $sess, $stat = "", $subst = "", $table = -1, $ip="0.0.0.0") {
if (($thiz = new User()) == FALSE)
return (FALSE);
- $thiz->room = &$room;
+ $thiz->room = &$brisk;
$thiz->idx = $idx;
$thiz->idx_orig = $idx;
$thiz->code = -1;
log_rd2("NEWSTAT: ".$this->stat);
} /* if ($this->rd_step == -1) { */
else {
- /* $sem = Room::lock_data(FALSE); */
+ /* $sem = Brisk::lock_data(FALSE); */
$S_load_stat['rU_heavy']++;
if ($this->rd_step < $this->step) {
if ($this->rd_step + COMM_N < $this->step) {
if (($this->rd_stat != $this->stat)) {
$to_stat = $this->stat;
- /* Room::unlock_data($sem); */
+ /* Brisk::unlock_data($sem); */
log_load("RESYNC");
printf("xXx USER::MAINCHECK2 [%s]\n", get_class($this));
return ($this->page_sync($this->sess, ($to_stat == "table" ? "briskin5/index.php" : "index.php"), $this->table, $this->table_token));
} /* if ($this->the_end == TRUE) { ... */
} /* if ($this->rd_step < $this->step) { */
- /* Room::unlock_data($sem); */
+ /* Brisk::unlock_data($sem); */
} /* else of if ($this->rd_step == -1) { */
return ($ret);
- } // function maincheck (...
+ } // function maincheck(...
public static function stream_fini($transp, $init_string, $is_unrecoverable)
{
$pre_main = gettimeofday(TRUE);
- $old_stat = $this->rd_stat;
- $old_subst = $this->rd_subst;
- $old_step = $this->rd_step;
printf("xXx PRE : rd_step %d\n", $this->rd_step);
- if (($ret = $this->maincheck($old_stat, $old_subst, $old_step, $get, $post, $cookie)) != FALSE) {
+ if (($ret = $this->maincheck($get, $post, $cookie)) != FALSE) {
$body .= $this->rd_transp->chunk( $this->rd_scristp++, $ret);
log_rd2(0, 'index_rd.php: after mop_flush (begin: '.sprintf("%f", $pre_main).')');
}
*
*/
+* {
+ font-family: verdana, helvetica, arial, sans-serif;
+ font-size: 13px;
+ line-height: 120%;
+}
+
+/* TRICK TO REMOVE EXCESS OF PADDING INSIDE INPUT BUTTONS WITH FIREFOX */
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+ margin-top:-2px;
+ margin-bottom: -2px;
+}
+
body {
- background-image: url('img/snowy.jpg');
+ background-image: url('img/happysunbg.png');
background-color: #fafafa;
background-repeat: no-repeat;
background-position: center center;
margin:0px;
- font-size: 12px;
padding: 0px;
align: center;
}
div {
- font-size: 12px;
+ font-size: 100%;
}
td {
- font-size: 12px;
+ font-size: 100%;
}
img {
input.button {
border: 1px solid gray;
margin: 1px;
- padding: 0px;
+ padding: 2px;
color: black;
background-color: RGB(246,246,246);
vertical-align: middle;
text-decoration: none;
font-size: 100%;
cursor: pointer;
- height: 20px ! important;
- max-height: 20px ! important;
- min-height: 20px ! important;
display: inline;
}
$this->rd_step = $this->step;
} /* if ($this->rd_step == -1) { */
else {
- /* $sem = Room::lock_data(FALSE); */
+ /* $sem = Brisk::lock_data(FALSE); */
$S_load_stat['rU_heavy']++;
if ($this->rd_step < $this->step) {
if ($this->rd_step + COMM_N < $this->step) {
if ($this->rd_stat != $this->stat) {
$to_stat = $this->stat;
- /* Room::unlock_data($sem); */
+ /* Brisk::unlock_data($sem); */
log_load("RESYNC");
printf("xXx BIN5_USER::MAINCHECK\n");
return ($this->page_sync($this->sess, ($to_stat == "table" ? "index.php" : "../index.php"), $this->table, $this->table_token));
} /* if ($this->the_end == TRUE) { ... */
} /* if ($this->rd_step < $this->step) { */
- /* Room::unlock_data($sem); */
+ /* Brisk::unlock_data($sem); */
} /* else of if ($this->rd_step == -1) { */
return ($ret);
- } // function maincheck (...
+ } // function maincheck(...
function continue_set($match_code)
{
class Bin5 {
static $delta_t = array();
+ var $brisk;// room object reference
var $user;
var $table;
var $delay_mgr;
- function Bin5 ($room, $table_idx, $table_token, $get, $post, $cookie) {
+ function Bin5($brisk, $table_idx, $table_token, $get, $post, $cookie) {
$this->user = array();
$this->table = array();
exit;
}
- $user = $room->user;
- $table = $room->table[$table_idx];
-
+ $this->brisk = $brisk;
+ $user = $brisk->user;
+ $table = $brisk->table[$table_idx];
log_wr("Bin5 constructor");
for ($i = 0 ; $i < $table->player_n ; $i++) {
break;
case "index_wr.php":
- // FIXME $content can be unset
if (isset($table_idx) && isset($table_token)) {
if (($bri = $s_a_p->app->match_get($table_idx, $table_token)) != FALSE) {
ob_start();
return TRUE;
break;
}
+ $bri->brisk->sess_cur_set($user->sess);
+
// close a previous opened index_read_ifra socket, if exists
if (($prev = $user->rd_socket_get()) != NULL) {
$s_a_p->socks_unset($user->rd_socket_get());
background-image: none;
background-color: #fafafa;
text-align: center;
-/* inherit from brisk.css
- background-repeat: no-repeat;
- background-position: top center;
- margin:0px;
-
- font-size: 12px;
- padding: 0px;
-
- align: center;
-*/
}
.chattshort {
border: 1px solid gray;
vertical-align: text-bottom;
text-align: left;
- /* font-size: 10pt;*/
}
table.chattshort_table {
}
.txtt {
- /* font-size: 10pt;*/
}
img.tableinfo {
img.astacard {
position: absolute;
- /* visibility: visible; */
border-width: 0px;
}
}
.chooseed {
- /* background-color: yellow; */
visibility: hidden;
position:absolute;
width: 200px;
}
.asta {
- /* background-color: yellow; */
visibility: hidden;
position: absolute;
width: 200px;
}
.points {
- /* position: relative; */
-
margin-top: 8px;
padding: 8px;
margin-left:auto;
width: 68;
height: 50;
margin-top: 4px;
- /*
- border-style: solid;
- border-width: 1px;
- border-color: blu;
- */
align: center;
text-align: center;
}
.puntifield {
- /* position: absolute; */
align: center;
text-align: center;
}
.pubinfo {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.pubinfo_iscalling {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.public {
- /* background-color: red; */
visibility: hidden;
position: absolute;
display: table;
}
.public_we {
- /* background-color: red; */
visibility: hidden;
position: absolute;
top: 250px;
}
.pubinfo_nw {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.pubinfo_nw_iscalling {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.public_nw {
- /* background-color: red; */
visibility: hidden;
position: absolute;
top: 125px;
}
.pubinfo_ne {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.pubinfo_ne_iscalling {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.public_ne {
- /* background-color: red; */
visibility: hidden;
position: absolute;
top: 125px;
}
.pubinfo_ea {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.pubinfo_ea_iscalling {
- /* background-color: red; */
color: gray;
visibility: visible;
position: absolute;
}
.public_ea {
- /* background-color: red; */
visibility: hidden;
position: absolute;
top: 250px;
.vert_midfloat {
position: relative;
-#position: absolute;
+ #position: absolute;
_top: 50%;
left: 0px;
width: 100%;
}
.vert_innfloat {
-#position: relative;
-#top: -50%;
+ #position: relative;
+ #top: -50%;
text-align: center;
}
.vert_innfloat_so {
- /* border-style: solid;
- border-width: 1px;
- border-color: black;
-
- background-color: white; */
#position: relative;
#top: -50%;
text-align: center;
}
.callerinfo {
- /* background-color: red; */
- /* visibility: visible; */
position: absolute;
- /* font-size: 10pt;*/
left: 5px;
top: 55px;
width: 115px;
var gst = new globst();
gst.st = <?php
- log_load("bin5/index.php");
+ log_load("bin5/index.php");
if (isset($laststate) == false) {
$laststate = -1;
/*
* MAIN
*/
-function bin5_index_wr_main(&$bri, $remote_addr_full, $get, $post, $cookie)
+function bin5_index_wr_main(&$bin5, $remote_addr_full, $get, $post, $cookie)
{
GLOBAL $G_base, $G_dbasetype, $G_black_list;
}
$curtime = time();
- if ($bri == NULL) {
+ if ($bin5 == NULL) {
return FALSE;
}
log_wr(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg));
- if (($user = &$bri->get_user($sess, &$idx)) == FALSE) {
+ if (($user = &$bin5->get_user($sess, &$idx)) == FALSE) {
echo "Get User Error";
log_wr("Get User Error");
return FALSE;
}
-
+ $bin5->brisk->sess_cur_set($user->sess);
if (array_search($user->ip, $G_black_list) !== FALSE) {
// TODO: waiting async 5 sec before close
return (FALSE);
log_rd2("bin5/index_wr.php: AUTO LOGOUT.");
if ($user->stat == 'table') {
- $bri->table_wakeup($user);
+ $bin5->table_wakeup($user);
// to force the logout
$user->lacc = 0;
}
*********************/
else if ($user->stat == 'table') {
$user->laccwr = time();
- $table = $bri->table[$user->table];
+ $table = $bin5->table[$user->table];
if ($argz[0] == 'tableinfo') {
log_wr("PER DI TABLEINFO");
$user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
- $user->comm[$user->step % COMM_N] .= show_table_info(&$bri, &$table, $user->table_pos);
+ $user->comm[$user->step % COMM_N] .= show_table_info(&$bin5, &$table, $user->table_pos);
log_wr($user->comm[$user->step % COMM_N]);
$user->step_inc();
}
else if ($argz[0] == 'chatt') {
- $bri->chatt_send(&$user,$mesg);
+ $bin5->chatt_send(&$user,$mesg);
}
else if ($argz[0] == 'preferences_update') {
log_wr("PER DI PREFERENCES_UPDATE");
$logout_cont = TRUE;
if ($remcalc >= 3) {
- $lockcalc = $table->exitlock_calc(&$bri->user, $user->table_pos);
+ $lockcalc = $table->exitlock_calc(&$bin5->user, $user->table_pos);
if ($lockcalc < 3) {
$user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
- $user->comm[$user->step % COMM_N] .= $table->exitlock_show(&$bri->user, $user->table_pos);
+ $user->comm[$user->step % COMM_N] .= $table->exitlock_show(&$bin5->user, $user->table_pos);
$user->comm[$user->step % COMM_N] .= show_notify("<br>I dati presenti sul server non erano allineati con quelli inviati dal tuo browser, adesso lo sono. Riprova ora.", 2000, "torna alla partita.", 400, 100);
log_wr($user->comm[$user->step % COMM_N]);
// $user->bantime = $user->laccwr + BAN_TIME;
if ($logout_cont == TRUE) {
- $bri->table_wakeup(&$user);
+ $bin5->table_wakeup(&$user);
}
}
else if ($argz[0] == 'exitlock') {
if ($user->exitislock == TRUE) {
$user->exitislock = ($user->exitislock == TRUE ? FALSE : TRUE);
for ($ct = 0, $i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur[$i] = &$bri->user[$table->player[$i]];
+ $user_cur[$i] = &$bin5->user[$table->player[$i]];
if ($user_cur[$i]->exitislock == FALSE)
$ct++;
}
/* log_points($curtime, $user, "STAT:BRISKIN5:FINISH_GAME", $plist); */
/* } */
- /* $table->game_init(&$bri->user); */
+ /* $table->game_init(&$bin5->user); */
- if ($table->rules_engine(&$bri, $curtime, BIN5_RULES_ABANDON, $user)) {
+ if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_ABANDON, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$ret = sprintf('gst.st = %d;', $user_cur->step+1);
- $ret .= show_table(&$bri,&$user_cur,$user_cur->step+1, TRUE, TRUE);
+ $ret .= show_table(&$bin5,&$user_cur,$user_cur->step+1, TRUE, TRUE);
$user_cur->comm[$user_cur->step % COMM_N] = $ret;
$user_cur->step_inc();
}
/* next step */
$showst = "show_astat(";
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$showst .= sprintf("%s%d", ($i == 0 ? "" : ", "),
($user_cur->asta_card < 9 ? $user_cur->asta_card : $user_cur->asta_pnt));
}
$maxcard = -2;
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
if ($maxcard < $user_cur->asta_card)
$maxcard = $user_cur->asta_card;
}
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$ret = sprintf('gst.st = %d; %s', $user_cur->step+1, $showst);
if ($user_cur->table_pos == ($table->gstart % BIN5_PLAYERS_N))
$ret .= sprintf('dispose_asta(%d,%d, %s); remark_on();',
else if ($table->asta_pla_n == 0) {
log_wr("PASSANO TUTTI!");
- if ($table->rules_engine(&$bri, $curtime, BIN5_RULES_ALLPASS, $user)) {
+ if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_ALLPASS, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$ret = sprintf('gst.st = %d;', $user_cur->step+1);
- $ret .= show_table(&$bri,&$user_cur,$user_cur->step+1, TRUE, TRUE);
+ $ret .= show_table(&$bin5,&$user_cur,$user_cur->step+1, TRUE, TRUE);
$user_cur->comm[$user_cur->step % COMM_N] = $ret;
$user_cur->step_inc();
}
$table->asta_win = $chooser;
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$ret = sprintf('gst.st = %d; %s dispose_asta(%d, %d, false);', $user_cur->step+1, $showst,
$table->asta_card + 1,-($table->asta_pnt));
log_wr("Setta la briscola a ".$a_brisco);
$chooser = $table->asta_win;
- $user_chooser = &$bri->user[$table->player[$chooser]];
+ $user_chooser = &$bin5->user[$table->player[$chooser]];
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$user_cur->subst = 'game';
$ret = sprintf('gst.st = %d; subst = "game";', $user_cur->step+1);
$ret .= sprintf('document.title = "Brisk - Tavolo %d";', $user->table_orig);
/* bg of caller cell */
- $ret .= briscola_show($bri, $table, $user_cur);
+ $ret .= briscola_show($bin5, $table, $user_cur);
/* first gamer */
if ($i == ($table->gstart % BIN5_PLAYERS_N))
$table->gstart = $winner;
$turn_nex = ($table->gstart + $table->turn) % BIN5_PLAYERS_N;
- log_wr(sprintf("The winner is: [%d] [%s]", $winner, $bri->user[$table->player[$winner]]->name));
+ log_wr(sprintf("The winner is: [%d] [%s]", $winner, $bin5->user[$table->player[$winner]]->name));
$card_take = sprintf("sleep(gst,2000);|cards_take(%d);|", $winner);
$player_cur = "remark_off();" . $card_take;
if ($turn_cur != $turn_nex)
log_wr(sprintf("Turn Cur %d Turn Nex %d",$turn_cur, $turn_nex));
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$ret = sprintf('gst.st = %d; ', $user_cur->step+1);
if ($table->turn == (BIN5_PLAYERS_N * BIN5_CARD_HAND)) { /* game finished */
log_wr(sprintf("GIOCO FINITO !!!"));
- if ($table->rules_engine(&$bri, $curtime, BIN5_RULES_FINISH, $user)) {
+ if ($table->rules_engine(&$bin5, $curtime, BIN5_RULES_FINISH, $user)) {
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
- $retar[$i] .= show_table(&$bri,&$user_cur,$user_cur->step+1,TRUE, TRUE);
+ $user_cur = &$bin5->user[$table->player[$i]];
+ $retar[$i] .= show_table(&$bin5,&$user_cur,$user_cur->step+1,TRUE, TRUE);
}
}
}
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
- $user_cur = &$bri->user[$table->player[$i]];
+ $user_cur = &$bin5->user[$table->player[$i]];
$user_cur->comm[$user_cur->step % COMM_N] = $retar[$i];
$user_cur->step_inc();
fprintf($fpexp, "<tr>");
for ($u = 0 ; $u < BIN5_PLAYERS_N ; $u++) {
$tot_sql = sprintf("
-SELECT SUM(p.pts) AS pts FROM %sbin5_matches AS m, %sbin5_games AS g, %sbin5_points AS p, %susers AS u WHERE m.code = g.mcode AND g.code = p.gcode AND u.code = p.ucode AND m.code = %d AND u.code = %d", $G_dbpfx, $G_dbpfx, $G_dbpfx, $G_dbpfx,
+SELECT SUM(p.pts) AS pts FROM %sbin5_matches AS m, %sbin5_games AS g, %sbin5_points AS p, %susers AS u
+WHERE m.code = g.mcode AND g.code = p.gcode AND u.code = p.ucode AND ( (u.type & (CAST (X'00ff0000' as integer))) <> (CAST (X'00800000' as integer)) ) AND m.code = %d AND u.code = %d", $G_dbpfx, $G_dbpfx, $G_dbpfx, $G_dbpfx,
$tmt_obj->code, $users[$u]['code']);
if (($tot_pg = pg_query($bdb->dbconn->db(), $tot_sql)) == FALSE ) {
break;
}
}
-function index_main(&$room, $transp_type, &$header_out, $addr, $get, $post, $cookie)
+function index_main(&$brisk, $transp_type, &$header_out, $addr, $get, $post, $cookie)
{
GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all;
GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local;
if (isset($BRISK_SHOWHTML) == FALSE) {
$is_table = FALSE;
- log_main("lock Room");
+ log_main("lock Brisk");
$curtime = time();
/* Actions */
if (validate_sess($sess)) {
log_main("pre garbage_manager UNO");
- $room->garbage_manager(TRUE);
+ $brisk->garbage_manager(TRUE);
log_main("post garbage_manager");
- if (($user = &$room->get_user($sess, &$idx)) != FALSE) {
+ if (($user = &$brisk->get_user($sess, &$idx)) != FALSE) {
+ $brisk->sess_cur_set($user->sess);
log_main("user stat: ".$user->stat);
if ($user->stat == "table") {
$cookies = new Cookies();
$pass_private = FALSE;
}
- $room->garbage_manager(TRUE);
+ $brisk->garbage_manager(TRUE);
/* try login */
$ipv4addr = addrtoipv4($addr);
- if (($user = $room->add_user(&$sess, &$idx, $name, $pass_private, $ipv4addr, $cookie)) != FALSE) {
+ if (($user = $brisk->add_user(&$sess, &$idx, $name, $pass_private, $ipv4addr, $cookie)) != FALSE) {
+ $brisk->sess_cur_set($user->sess);
$ACTION = "room";
if ($idx < 0) {
$idx = -$idx - 1;
}
// setcookie ("sess", "", time() + 180);
- $room->standup_update(&$user);
+ $brisk->standup_update(&$user);
}
else {
/* Login Rendering */
-
-
- $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
+ /* NOTE: Brisk donate or donate fake if local */
+ if (!$G_is_local)
+ $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
+ else
+ $brisk_donate = '<div style="background-color: #ff0; height: 27px; margin-top: 4px;">BRISK_DONATE</div>';
+
if ($brisk_donate == FALSE)
$brisk_donate = "";
'.$altout_support_big.'
</div>
<a style="/* position: absolute; top: 40px; left: 6px;" */ target="_blank" href="http://it-it.facebook.com/group.php?gid=59742820791"><img class="nobo" id="btn_facebook" src="img/facebook_btn.png" title="unisciti al gruppo \'quelli della brisk\'"></a>
-<br>
-<div id="proflashext" class="proflashext"><div id="proflash" class="proflash">
-</div><br><br></div>
+' . ( /* NOTE: here facebook or fake facebook */
+! $G_is_local ?
+'<div class="fb-like" style="margin-top: 4px;" data-href="https://www.facebook.com/pages/Brisk-briscola-chiamata-in-salsa-ajax/716026558416911" data-share="false" data-send="true" data-width="70" data-show-faces="false" data-colorscheme="dark" layout="button_count"></div>
+' : '<div style="margin-top: 4px; height: 20px; background-color: #00f;">FACEBOOK HERE</div>
+' ) . '<div id="proflashext" class="proflashext"><div id="proflash" class="proflash"></div></div>
+<img id="stm_stat" class="nobo" style="margin-top: 4px;" src="img/line-status_b.png">
%s
%s
-<br>
-<img id="stm_stat" class="nobo" src="img/line-status_b.png"></div>';
+</div>';
/* Templates. */
if ($ACTION == 'login') {
//-->
</SCRIPT>
</head>
+<?php
+ if (!$G_is_local) {
+?>
<!-- if myconsole <body onunload="deconsole();"> -->
+<body xmlns:fb="http://ogp.me/ns/fb#">
+<div id="fb-root"></div>
+<script>(function(d, s, id) {
+ var js, fjs = d.getElementsByTagName(s)[0];
+ if (d.getElementById(id)) return;
+ js = d.createElement(s); js.id = id;
+ js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
+ fjs.parentNode.insertBefore(js, fjs);
+}(document, 'script', 'facebook-jssdk'));</script>
+<?php
+ }
+ else {
+?>
<body>
+<?php
+ }
+?>
<?php
printf($brisk_header_form);
printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
if ($G_with_sidebanner) {
printf("%s", $G_sidebanner);
- if ($G_with_sidebanner2) {
- printf("<br>");
- }
}
?>
<!-- =========== tables =========== -->
-<?php
+<?php
/* MLANG: "Digita il tuo nickname per accedere ai tavoli della briscola.", "entra", "Se non hai ancora una password, lascia il campo in bianco ed entra." ,"(se usi firefox e qualcosa non funziona prova a ricaricare la pagina con Ctrl + F5)" */
echo "$body"; ?>
//-->
</SCRIPT>
</head>
+<?php
+ if (!$G_is_local) {
+?>
<!-- if myconsole <body onunload="deconsole();"> -->
+<body xmlns:fb="http://ogp.me/ns/fb#">
+<div id="fb-root"></div>
+<script>(function(d, s, id) {
+ var js, fjs = d.getElementsByTagName(s)[0];
+ if (d.getElementById(id)) return;
+ js = d.createElement(s); js.id = id;
+ js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
+ fjs.parentNode.insertBefore(js, fjs);
+}(document, 'script', 'facebook-jssdk'));</script>
+<?php
+ }
+ else {
+?>
<body>
+<?php
+ }
+?>
<?php
printf($brisk_header_form);
printf("<table class=\"floaty\"><tr><td class=\"floatyleft\">\n");
- /* printf($brisk_vertical_menu, '<input type="button" class="button" name="xhelp" value="Help." onclick="act_help();"><br><!-- <br><input type="button" class="button" name="xabout" value="About." onclick="act_about();">--><br><br><br>',
- $brisk_donate);
- printf($brisk_vertical_menu, '<input type="button" class="button" name="xhelp" value="Help." onclick="act_help();"><br><!-- <br><input type="button" class="button" name="xabout" value="About." onclick="act_about();">--><br>',
- $brisk_donate);*/
- printf($brisk_vertical_menu, '<!-- <br><input type="button" class="button" name="xabout" value="About." onclick="act_about();">--><br>',
- $brisk_donate);
+ printf($brisk_vertical_menu, '', $brisk_donate);
if ($G_with_sidebanner xor $G_with_sidebanner2) {
if ($G_with_sidebanner) {
printf("%s", $G_sidebanner);
- if ($G_with_sidebanner2) {
- printf("<br>");
- }
}
define('LICMGR_CHO_REFUSE', 1);
define('LICMGR_CHO_AFTER', 2);
-function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie)
+function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie)
{
GLOBAL $G_shutdown, $G_black_list, $G_lang, $G_room_help, $G_room_about, $G_room_passwdhowto, $mlang_indwr;
GLOBAL $G_tos_vers;
$curtime = time();
$dt = date("H:i ", $curtime);
- if (($user = $room->get_user($sess, &$idx)) == FALSE) {
+ if (($user = $brisk->get_user($sess, &$idx)) == FALSE) {
$argz = explode('|', xcapemesg($mesg));
if ($argz[0] == 'getchallenge') {
return FALSE;
}
return TRUE;
- }
+ } // end if (($user = $brisk->get_user($sess, ... == FALSE) {
+ $brisk->sess_cur_set($user->sess);
$argz = explode('|', xcapemesg($mesg));
log_wr('POSTSPLIT: '.$argz[0]);
if ($argz[1] == 'save') {
if ($user->stat == 'room' && $user->subst == 'standup') {
- $room->standup_update($user);
+ $brisk->standup_update($user);
}
else if ($user->stat == 'room' && $user->subst == 'sitdown') {
log_main("chatt_send pre table update");
- $room->table_update($user);
+ $brisk->table_update($user);
log_main("chatt_send post table update");
}
}
log_rd2("AUTO LOGOUT.");
if ($user->subst == 'sitdown' || $user->stat == 'table')
- $room->room_wakeup($user);
+ $brisk->room_wakeup($user);
else if ($user->subst == 'standup')
- $room->room_outstandup(&$user);
+ $brisk->room_outstandup(&$user);
else {
log_rd2("SHUTDOWN FROM WHAT ???");
}
}
else if ($argz[0] == 'chatt') {
- $room->chatt_send(&$user, xcapemesg($mesg));
+ $brisk->chatt_send(&$user, xcapemesg($mesg));
}
else if ($argz[0] == 'tosmgr') {
// check IF is authnticated user, both terms of service versions matches
// Take parameters
$table_idx = (int)$argz[1];
- $table = &$room->table[$table_idx];
+ $table = &$brisk->table[$table_idx];
$not_allowed_msg = "";
if ($G_shutdown) {
//
// Create new spawned table
- // $bri_sem = Bin5::lock_data(TRUE, $table_idx);
+ // $bin5_sem = Bin5::lock_data(TRUE, $table_idx);
$table_token = uniqid("");
- $room->table[$table_idx]->table_token = $table_token;
- $room->table[$table_idx]->table_start = $curtime;
+ $brisk->table[$table_idx]->table_token = $table_token;
+ $brisk->table[$table_idx]->table_start = $curtime;
$plist = "$table_token|$user->table|$table->player_n";
for ($i = 0 ; $i < $table->player_n ; $i++) {
- $plist .= '|'.$room->user[$table->player[$i]]->sess;
+ $plist .= '|'.$brisk->user[$table->player[$i]]->sess;
}
log_legal($curtime, $user->ip, $user, "STAT:CREATE_GAME", $plist);
log_wr("pre new Bin5");
- if (($bri = new Bin5($room, $table_idx, $table_token, $get, $post, $cookie)) == FALSE)
+ if (($bin5 = new Bin5($brisk, $table_idx, $table_token, $get, $post, $cookie)) == FALSE)
log_wr("bri create: FALSE");
else
- log_wr("bri create: ".serialize($bri));
+ log_wr("bri create: ".serialize($bin5));
log_wr("pre init table");
// init table
- $bri_table = $bri->table[0];
- $bri_table->init($bri->user);
- $bri_table->game_init($bri->user);
+ $bin5_table = $bin5->table[0];
+ $bin5_table->init($bin5->user);
+ $bin5_table->game_init($bin5->user);
//
// Init spawned users.
//
//
log_wr("game_init after");
for ($i = 0 ; $i < $table->player_n ; $i++) {
- $bri_user_cur = $bri->user[$i];
- $user_cur = $room->user[$table->player[$i]];
+ $bin5_user_cur = $bin5->user[$i];
+ $user_cur = $brisk->user[$table->player[$i]];
- $bri_user_cur->laccwr = $curtime;
- $bri_user_cur->trans_step = $user_cur->step + 1;
- $bri_user_cur->comm[$bri_user_cur->step % COMM_N] = "";
- $bri_user_cur->step_inc();
- $bri_user_cur->comm[$bri_user_cur->step % COMM_N] = show_table(&$bri,&$bri_user_cur,$bri_user_cur->step+1,TRUE, FALSE);
- $bri_user_cur->step_inc();
+ $bin5_user_cur->laccwr = $curtime;
+ $bin5_user_cur->trans_step = $user_cur->step + 1;
+ $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = "";
+ $bin5_user_cur->step_inc();
+ $bin5_user_cur->comm[$bin5_user_cur->step % COMM_N] = show_table(&$bin5,&$bin5_user_cur,$bin5_user_cur->step+1,TRUE, FALSE);
+ $bin5_user_cur->step_inc();
- log_wr("TRY PRESAVE: ".$bri_user_cur->step." TRANS STEP: ".$bri_user_cur->trans_step);
+ log_wr("TRY PRESAVE: ".$bin5_user_cur->step." TRANS STEP: ".$bin5_user_cur->trans_step);
log_wr("Pre if!");
$user_cur->step_inc();
}
log_wr("presave bri");
- $room->match_add($table_idx, $bri);
+ $brisk->match_add($table_idx, $bin5);
log_wr("postsave bri");
}
// change room
- $room->room_sitdown($user, $table_idx);
+ $brisk->room_sitdown($user, $table_idx);
log_wr("MOP finish");
}
**********************/
else if ($user->subst == 'sitdown') {
if ($argz[0] == 'wakeup') {
- $room->room_wakeup($user);
+ $brisk->room_wakeup($user);
}
else if ($argz[0] == 'logout') {
- $room->room_wakeup($user);
+ $brisk->room_wakeup($user);
$user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; ";
$user->comm[$user->step % COMM_N] .= 'postact_logout();';
$user->the_end = TRUE;
}
}
log_wr("before save data");
- // Room::save_data($room);
+ // Brisk::save_data($brisk);
log_wr($user->step, 'index_wr.php: after save_data()');
-/* Room::unlock_data($sem); */
+/* Brisk::unlock_data($sem); */
/* exit; */
return (FALSE);
}
}
div.container {
- /* border:1px solid gray; */
position: relative;
width:100%;
margin:0px;
}
div.header {
- /* border: 1px solid yellow; */
align: center;
text-align: center;
- font-size: 12px;
+ font-size: 100%;
clear:left;
}
div.topmenu {
- /* border: 1px solid red; */
width:94px;
margin:0;
text-align: center;
align: center;
- font-size: 10px;
- padding:2px;
+ font-size: 85%;
+ padding: 2px 2px 0 2px;
}
div.proflash {
- /* border: 1px solid red; */
border: 1px solid gray;
background-color: RGB(246,246,246);
text-align: center;
align: center;
- font-size: 10px;
+ font-size: 85%;
padding:4px;
}
div.tables {
- /* border: 1px solid gray; */
margin-left:100px;
padding:4px;
}
div.bottom {
- /* border: 1px solid green; */
position: relative;
top: -13px;
align: center:
align: left;
text-align: left;
margin: 0px;
- /* background-color: orange; */
- /* clip: auto; */
- /* overflow: hidden; */
}
span.room_titin {
table.floaty {
width: 100%;
- /* border: 1px solid red; */
border-collapse: collapse;
border-spacing: 0px;
padding: 0px;
}
table.floaty td {
- /* border: 1px solid orange; */
align: center;
text-align: center;
vertical-align: top;
}
table.placings {
-/* border: 1px solid red; */
-/* border-collapse: collapse; */
border-spacing: 8px;
margin: 0px;
width: 100%;
}
table.macro {
- /* border: 1px solid orange; */
border-spacing: 0px;
align: center;
width: 100%;
}
table.macro td {
- /* border: 1px solid green; */
align: center;
text-align: center;
}
div.room_tab {
- /* border: 1px solid blue; */
- /* background-color: green; */
height: 346px;
margin-left: auto;
margin-right: auto;
table.room_tab {
width: 100%;
- /* border: 0px solid red; */
border-collapse: separate;
border-spacing: 4px;
border-style: none;
}
table.room_tab td {
- /* background-color: yellow; */
width: 25%;
- height: 110px;
+ height: 120px;
vertical-align: top;
border: 1px solid gray;
}
div.room_div {
- /* background-color: orange; */
position: relative;
}
div.room_standup {
position: absolute;
vertical-align: "top";
- /* align: left; */
top: 26px;
width: 100%;
height: 80px;
padding: 0px;
margin: 0px;
- /* background-color: orange; */
overflow: auto;
clip: auto;
}
table.room_standup {
position: relative;
- /* margin-left: 4px; */
width: 100%;
border: 1px solid gray;
border-spacing: 0px;
}
table.room_standup td {
- /* background-color: yellow; */
position: relative;
border: 0px none gray;
vertical-align: top;
}
table.table_standup {
- /* background-color: red; */
-
border-spacing: 0px;
width: 100%;
margin: 0px;
}
table.table_standup td {
- /* background-color: green; */
- /* border: 1px solid red; */
width: 25%;
text-align: center;
align: center;
height: 100px;
overflow: auto;
border: 1px solid gray;
- /* padding: 2px; */
vertical-align: text-bottom;
}
.txtt {
- /* font-size: 10pt;*/
position: relative;
-
top: 2px;
- /* rows: 1; */
}
.urgmsg {
width: 100%;
align: center;
text-align: center;
- /* background-color: green; */
}
.webstart_hilite {
text-decoration: none;
}
-.topbanner {
+.sidebanner {
+ /* Top Right Bottom Left */
+ margin: 4px auto 0px auto;
+ position: relative;
+ align: center;
+ text-align:center;
+ background-color: #f8f8f8;
+ padding: 4px;
+ border: 1px solid #000000;
+}
+
+.topbanner {
position: relative;
align: center;
text-align:center;
width: 0px;
height: 50px;
z-index: 10;
- /*background-color: #ff00ff;
- clip: auto;
- overflow: hidden; */
}
.wagon {
cursor: pointer;
left: 0px;
top: 2px;
- font-size: 10px;
+ font-size: 85%;
font-weight: bold;
padding: 4px;
z-index: 10;
- /* visibility: hidden; */
}
.wagon_disable {
cursor: default;
left: 0px;
top: 2px;
- font-size: 10px;
+ font-size: 85%;
font-weight: bold;
font-color: #999999;
padding: 4px;
- /*z-index: -1;*/
- /* visibility: hidden; */
}
.wagon_disable2 {
border: 1px solid green;
left: 0px;
top: 2px;
- font-size: 10px;
+ font-size: 85%;
font-color: #333333;
padding: 4px;
- /* z-index: -1; */
- /* visibility: hidden; */
}
.notebox {
padding: 4px;
position: absolute;
visibility: hidden;
- /* z-index: 15px; */
}
.room_standup_orig {
width: 0px;
text-align: left;
vertical-align: top;
- /* background-color: red; */
padding: 0px;
}
{
pid_save();
do {
- if (($room = Room::create(LEGAL_PATH."/brisk-crystal.data")) == FALSE) {
- log_crit("room::create failed");
+ if (($brisk = Brisk::create(LEGAL_PATH."/brisk-crystal.data")) == FALSE) {
+ log_crit("Brisk::create failed");
$ret = 1;
break;
}
- if (($s_a_p = Sac_a_push::create($room, USOCK_PATH, 0, 0, $argv)) === FALSE) {
+ if (($s_a_p = Sac_a_push::create($brisk, USOCK_PATH, 0, 0, $argv)) === FALSE) {
$ret = 2;
break;
}
//
function transport_ws(doc, xynt_streaming, page)
{
+ this.name = "WebSocket";
this.ctx_new = "";
var self = this;
transport_ws.prototype = {
doc: null,
+ name: null,
xynt_streaming: "ready",
ws: null,
stopped: true,
//
function transport_xhr(doc, xynt_streaming, page)
{
+ this.name = "XHR";
this.doc = doc;
this.xynt_streaming = xynt_streaming;
this.xhr = createXMLHttpRequest();
transport_xhr.prototype = {
doc: null,
+ name: null,
xynt_streaming: "ready",
xhr: null,
stopped: true,
//
function transport_htmlfile(doc, xynt_streaming, page)
{
+ this.name = "HTMLFile";
this.doc = doc;
this.xynt_streaming = xynt_streaming;
this.transfdoc = new ActiveXObject("htmlfile");
transport_htmlfile.prototype = {
doc: null,
+ name: null,
xynt_streaming: null,
stopped: true,
ifra: null,
//
function transport_iframe(doc, xynt_streaming, page)
{
+ this.name = "IFRAME";
this.doc = doc;
this.xynt_streaming = xynt_streaming;
this.ifra = doc.createElement("iframe");
transport_iframe.prototype = {
doc: null,
+ name: null,
xynt_streaming: null,
stopped: true,
ifra: null,
var ctx_new_len;
if (this.sandbox != null) {
- // from old: var zug = "POLL sess = "+sess+" stat = "+stat+" subst = "+subst+" step = "+this.gst.st+" step_loc = "+this.gst.st_loc+" step_loc_new = "+this.gst.st_loc_new+" STOP: "+this.stopped;
- var zug = "WATCHDOG sess = ["+this.sess+"] step = "+this.gst.st+" step_loc = "+this.gst.st_loc+" step_loc_new = "+this.gst.st_loc_new;
+ var zug = "WATCHDOG sess = ["+this.sess+"] step = "+this.gst.st+" step_loc = "+this.gst.st_loc+" step_loc_new = "+this.gst.st_loc_new+"Transport: "+this.transp.name;
if (zug != this.sandbox.innerHTML)
this.sandbox.innerHTML = zug;
}