define(FTOK_PATH, "/var/lib/brisk");
define(LEGAL_PATH, "/tmp/legal_brisk");
define(PROXY_PATH, "/var/lib/brisk_proxy");
-define(TABLES_N, 32);
+define(TABLES_N, 12);
define(PLAYERS_N, 3);
define(MAX_POINTS, 5);
define(MAX_PLAYERS, (20 + (PLAYERS_N * TABLES_N)));
$ret .= sprintf('$("myname").innerHTML = "<b>%s</b>";', xcape($user->name));
for ($i = 0 ; $i < TABLES_N ; $i++) {
$ret .= $this->table_content($user, $i);
- $act_content = table_act_content(($user->subst == 'standup'),
+ $ret .= table_act_content(($user->subst == 'standup'),
$this->table[$i]->player_n, $i, $user->table);
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $i, $act_content);
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $i, $act_content);
if ($this->table[$i]->wag_own != NULL)
$ret .= sprintf('tra.add(%d, "%s: %s"); ', $i, $this->table[$i]->wag_own->name, $this->table[$i]->wag_com);
else
$ret .= $this->table_content($user_cur, $table_idx);
$ret .= $this->standup_content($user_cur);
- $act_content = table_act_content(FALSE, 0, $table_idx, $user->table);
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
+ $ret .= table_act_content(FALSE, 0, $table_idx, $user->table);
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
if ($user_cur == $user) {
$ret .= 'subst = "standup"; tra.show(); ';
// clean the action buttons in other tables
for ($e = 0 ; $e < TABLES_N ; $e++) {
- if ($this->table[$e]->player_n < PLAYERS_N)
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $e, table_act_content(TRUE, 0, $e, $user->table));
+ if ($this->table[$e]->player_n < PLAYERS_N) {
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $e, table_act_content(TRUE, 0, $e, $user->table));
+ $ret .= table_act_content(TRUE, 0, $e, $user->table);
+ }
}
}
else {
- $act_content = table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table);
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
+ $ret .= table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table);
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
}
}
log_wr("ROOM_WAKEUP: ".$ret);
$ret .= $this->table_content($user_cur, $table_idx);
$ret .= $this->standup_content($user_cur);
- $act_content = table_act_content(FALSE, 0, $table_idx, $user_cur->table);
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
+ $ret .= table_act_content(FALSE, 0, $table_idx, $user_cur->table);
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
for ($tab_idx = 0 ; $tab_idx < $user_tab_n ; $tab_idx++)
if ($user_cur == $user_tab[$tab_idx])
log_main("JOIN_WAKEUP wup_idx ".$wup_idx." wup_n ".$user_wup_n);
log_main("JOIN_WAKEUP more");
- $act_content = table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table);
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
+ $ret .= table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table);
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
log_main("JOIN_WAKEUP end more");
}
log_wr("ROOM_JOIN_WAKEUP: ".$ret);
$ret .= 'subst = "sitdown"; tra.hide(); ';
// clean the action buttons in other tables
for ($e = 0 ; $e < TABLES_N ; $e++) {
- $act_content = table_act_content(FALSE, 0, $e, $user_cur->table);
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $e, $act_content);
+ $ret .= table_act_content(FALSE, 0, $e, $user_cur->table);
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $e, $act_content);
}
}
else if ($table_idx > -1) {
if ($table->player_n == PLAYERS_N) {
- $act_content = table_act_content(($user_cur->subst == 'standup'), PLAYERS_N, $table_idx, $user_cur->table);
- $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
+ $ret .= table_act_content(($user_cur->subst == 'standup'), PLAYERS_N, $table_idx, $user_cur->table);
+ // $ret .= sprintf('$("table_act%d").innerHTML = "%s";', $table_idx, $act_content);
}
}
$user_cur->comm[$user_cur->step % COMM_N] = $ret;
{
GLOBAL $sess;
- $ret = FALSE;
$shm = FALSE;
// var_dump($room);
if ($shm)
shm_detach($shm);
- return ($ret);
+ return (FALSE);
}
function lock_data()
return (sem_release($res));
}
- function standup_content($user)
+ function standup_content_old($user)
{
$ret = "";
$content = "";
return ($ret);
}
+
+
+
+ function standup_content($user)
+ {
+ $ret = "";
+ $content = "";
+
+ if ($user->stat != 'room')
+ return;
+
+ for ($e = 0 , $ct = 0 ; $ct < 4 && $e < MAX_PLAYERS ; $e++) {
+ if ($this->user[$e]->sess == "" || $this->user[$e]->stat != "room" || $this->user[$e]->name == "")
+ continue;
+ $ct++;
+ }
+
+ // $content .= sprintf('<table cols=\\"%d\\" class=\\"table_standup\\">', $ct);
+
+ $content = ' j_stand_cont( [ ';
+
+ for ($e = 0 , $ct = 0 ; $e < MAX_PLAYERS ; $e++) {
+ if ($this->user[$e]->sess == "" || $this->user[$e]->stat != "room" || $this->user[$e]->name == "")
+ continue;
+
+ $flags = 0;
+
+ if ($this->user[$e]->subst == "standup") {
+ if ($this->user[$e] == $user)
+ {
+ $flags |= 1;
+ }
+
+ $content .= sprintf('%s[ %d, \'%s\' ]',($ct > 0 ? ', ' : ''), $flags, xcape($this->user[$e]->name));
+ $ct++;
+ }
+ }
+ $content .= ' ]);';
+
+ // $content2 = '<input class=\\"button\\" name=\\"logout\\" value=\\"Esco.\\" onclick=\\"window.onunload = null; act_logout();\\" type=\\"button\\">';
+ // $ret .= sprintf('$("standup").innerHTML = "%s"; $("esco").innerHTML = "%s";',
+ // $content, $content2);
+
+ return ($content);
+ }
- function table_content($user, $table_idx)
+ function table_content_old($user, $table_idx)
{
$content = "";
$ret = "";
}
+ function table_content($user, $table_idx)
+ {
+ $content = "";
+ $ret = "";
+ // TODO
+ //
+ // Si possono usare i dati nella classe table
+ //
+
+ $sess = $user->sess;
+ $table = &$this->table[$table_idx];
+
+ if ($user->stat != 'room')
+ return;
+
+ $content = "[ ";
+ for ($i = 0 ; $i < $table->player_n ; $i++) {
+ $user_cur = &$this->user[$table->player[$i]];
+
+ $flags = 0;
+
+ if ($user_cur == $user)
+ $flags = 1;
+
+ log_main($user_cur->name. sprintf(" IN TABLE [%d]", $table_idx));
+
+ $content .= sprintf('%s[ %d, \'%s\' ]',($i == 0 ? '' : ', '), $flags, xcape($user_cur->name));
+ }
+
+ $content .= ' ]';
+
+ $ret .= sprintf('j_tab_cont(%d, %s);', $table_idx, $content);
+
+ return ($ret);
+ }
+
} // end class Room
function make_seed()
return (sem_release($res));
}
-function table_act_content($isstanding, $sitted, $table, $cur_table)
+function table_act_content_old($isstanding, $sitted, $table, $cur_table)
{
$ret = "";
return ($ret);
}
+function table_act_content($isstanding, $sitted, $table, $cur_table)
+{
+ $ret = "";
+
+ if ($isstanding) {
+ if ($sitted < PLAYERS_N) {
+ $act = 'sit';
+ }
+ }
+ else {
+ if ($table == $cur_table)
+ $act = 'wake';
+ else
+ $act = 'none';
+ }
+
+ if ($act != '')
+ $ret = sprintf('j_tab_act_cont(%d, \'%s\');', $table, $act);
+
+ return ($ret);
+}
function show_notify($text, $tout, $butt, $w, $h)
{
var g_preload_img_arr = new Array(
"briskin5/img/brisk_table_sand0.jpg", "briskin5/img/brisk_table_sand4.jpg",
"briskin5/img/brisk_table_sand1.jpg", "briskin5/img/brisk_table_sand3.jpg",
- "briskin5/img/brisk_table_sand2.jpg", "img/bg_spawn2.jpg",
+ "briskin5/img/brisk_table_sand2.jpg", "img/scighera_big.png",
"briskin5/img/brisk_caller_sand4.png", "briskin5/img/brisk_caller_sand0.png",
"briskin5/img/brisk_caller_sand2.png", "briskin5/img/brisk_caller_sand1.png",
"briskin5/img/brisk_caller_sand3.png", "img/virtualsky_big.png",
- "img/brichi_big.png", "img/forumolimpia_big.png",
- "briskin5/img/33_ea.png", "briskin5/img/33_we.png",
- "briskin5/img/31_we.png", "img/dynamica_big.png",
- "briskin5/img/35_ea.png", "briskin5/img/35_we.png",
- "briskin5/img/31_ea.png", "briskin5/img/23_ea.png",
- "briskin5/img/33.png", "briskin5/img/23_we.png",
- "briskin5/img/31.png", "briskin5/img/35.png",
- "briskin5/img/13_ea.png", "briskin5/img/23.png",
- "briskin5/img/13_we.png", "briskin5/img/cover_ea.png",
- "briskin5/img/cover_we.png", "briskin5/img/cover.png",
- "briskin5/img/32_ea.png", "briskin5/img/32_we.png",
- "briskin5/img/13.png", "briskin5/img/32.png",
- "briskin5/img/10_we.png", "briskin5/img/10_ea.png",
- "briskin5/img/27_we.png", "briskin5/img/27_ea.png",
- "briskin5/img/30_we.png", "briskin5/img/34_we.png",
- "briskin5/img/10.png", "briskin5/img/30_ea.png",
- "briskin5/img/36_we.png", "briskin5/img/36_ea.png",
- "briskin5/img/34_ea.png", "briskin5/img/30.png",
- "briskin5/img/37_we.png", "briskin5/img/38_we.png",
- "briskin5/img/36.png", "briskin5/img/37_ea.png",
- "briskin5/img/38_ea.png", "briskin5/img/38.png",
+ "img/bcm_tor080517.gif", "img/brichi_big.png",
+ "img/forumolimpia_big.png", "img/brisk_meetingbig150.png",
+ "img/brisk_half.png", "briskin5/img/33_ea.png",
+ "briskin5/img/33_we.png", "briskin5/img/31_we.png",
+ "img/dynamica_big.png", "briskin5/img/35_ea.png",
+ "briskin5/img/35_we.png", "briskin5/img/31_ea.png",
+ "briskin5/img/23_ea.png", "briskin5/img/33.png",
+ "briskin5/img/23_we.png", "briskin5/img/31.png",
+ "briskin5/img/35.png", "briskin5/img/13_ea.png",
+ "briskin5/img/23.png", "briskin5/img/13_we.png",
+ "briskin5/img/cover_ea.png", "briskin5/img/cover_we.png",
+ "briskin5/img/cover.png", "briskin5/img/32_ea.png",
+ "briskin5/img/32_we.png", "briskin5/img/13.png",
+ "briskin5/img/32.png", "briskin5/img/10_we.png",
+ "briskin5/img/10_ea.png", "briskin5/img/27_we.png",
+ "briskin5/img/27_ea.png", "briskin5/img/30_we.png",
+ "briskin5/img/34_we.png", "briskin5/img/10.png",
+ "briskin5/img/30_ea.png", "briskin5/img/36_we.png",
+ "briskin5/img/36_ea.png", "briskin5/img/34_ea.png",
+ "briskin5/img/30.png", "briskin5/img/37_we.png",
+ "briskin5/img/38_we.png", "briskin5/img/36.png",
+ "briskin5/img/37_ea.png", "briskin5/img/38_ea.png",
+ "briskin5/img/38.png", "img/bug_bannerbig80.png",
"briskin5/img/27.png", "briskin5/img/34.png",
"briskin5/img/37.png", "img/virtualsky80x15a.gif",
"briskin5/img/39_we.png", "briskin5/img/03_we.png",
"briskin5/img/18.png", "briskin5/img/15_ea.png",
"briskin5/img/15_we.png", "briskin5/img/29_we.png",
"briskin5/img/29_ea.png", "briskin5/img/29.png",
- "briskin5/img/15.png", "img/brisk_logo64.png",
- "img/download_now_flash.gif", "briskin5/img/asta3.png",
+ "briskin5/img/15.png", "img/brisk_meeting_title_hi.png",
+ "img/bug_bannermid.png", "img/brisk_meeting_title_low.png",
+ "img/brisk_logo64.png", "img/brisk_meeting60.png",
+ "img/bug_bannersmall.png", "img/download_now_flash.gif",
+ "briskin5/img/asta3.png", "img/brisk_meeting60_foto.gif",
"briskin5/img/asta8.png", "briskin5/img/asta7.png",
"briskin5/img/asta4.png", "briskin5/img/astapasso.png",
"briskin5/img/asta3_ro.png", "briskin5/img/asta8_ro.png",
"briskin5/img/exitlock0n.png", "briskin5/img/exitlock3y.png",
"briskin5/img/exitlock2y.png", "briskin5/img/exitlock0y.png",
"img/brisk_start.png", "img/noimg.png",
- "img/brisk_ico.png");
+ "img/brisk_ico.png", "img/train.png",
+ "img/brisk_item6.png");
var g_preload_imgsz_arr = new Array(
- "5.0", "10.1", "15.1", "20.2", "25.2", "27.9", "29.6", "31.2",
- "32.9", "34.5", "36.1", "37.7", "38.9", "39.9", "40.4", "40.9",
- "41.4", "42.0", "42.5", "43.0", "43.5", "44.0", "44.5", "45.1",
- "45.6", "46.1", "46.6", "47.1", "47.6", "48.1", "48.6", "49.1",
- "49.6", "50.1", "50.5", "51.0", "51.5", "52.0", "52.5", "53.0",
- "53.4", "53.9", "54.4", "54.9", "55.3", "55.8", "56.3", "56.8",
- "57.2", "57.7", "58.2", "58.7", "59.1", "59.6", "60.1", "60.5",
- "61.0", "61.5", "61.9", "62.4", "62.9", "63.3", "63.8", "64.2",
- "64.7", "65.1", "65.6", "66.0", "66.5", "66.9", "67.3", "67.8",
- "68.2", "68.7", "69.1", "69.6", "70.0", "70.4", "70.9", "71.3",
- "71.7", "72.2", "72.6", "73.1", "73.5", "73.9", "74.4", "74.8",
- "75.2", "75.6", "76.1", "76.5", "76.9", "77.4", "77.8", "78.2",
- "78.6", "79.0", "79.4", "79.8", "80.2", "80.7", "81.1", "81.5",
- "81.9", "82.2", "82.6", "83.0", "83.4", "83.8", "84.2", "84.6",
- "85.0", "85.4", "85.7", "86.1", "86.5", "86.9", "87.3", "87.6",
- "88.0", "88.4", "88.8", "89.1", "89.5", "89.9", "90.3", "90.6",
- "91.0", "91.4", "91.7", "92.1", "92.5", "92.8", "93.2", "93.5",
- "93.9", "94.2", "94.6", "94.8", "95.0", "95.2", "95.4", "95.6",
- "95.7", "95.9", "96.1", "96.2", "96.4", "96.5", "96.7", "96.8",
- "97.0", "97.1", "97.2", "97.4", "97.5", "97.6", "97.7", "97.9",
- "98.0", "98.1", "98.2", "98.3", "98.4", "98.6", "98.7", "98.8",
- "98.9", "99.0", "99.0", "99.1", "99.2", "99.3", "99.3", "99.4",
- "99.5", "99.5", "99.6", "99.7", "99.7", "99.8", "99.9", "99.9",
- "100.0");
+ "4.8", "9.6", "14.4", "19.2", "24.0", "26.6", "28.1", "29.7",
+ "31.3", "32.8", "34.4", "35.9", "37.2", "38.4", "39.3", "40.1",
+ "40.8", "41.3", "41.8", "42.3", "42.8", "43.3", "43.8", "44.3",
+ "44.8", "45.3", "45.8", "46.2", "46.7", "47.2", "47.7", "48.2",
+ "48.6", "49.1", "49.6", "50.0", "50.5", "51.0", "51.4", "51.9",
+ "52.4", "52.8", "53.3", "53.7", "54.2", "54.6", "55.1", "55.5",
+ "56.0", "56.5", "56.9", "57.4", "57.8", "58.3", "58.7", "59.1",
+ "59.6", "60.0", "60.5", "60.9", "61.4", "61.8", "62.3", "62.7",
+ "63.1", "63.6", "64.0", "64.4", "64.9", "65.3", "65.7", "66.1",
+ "66.6", "67.0", "67.4", "67.8", "68.2", "68.7", "69.1", "69.5",
+ "69.9", "70.3", "70.8", "71.2", "71.6", "72.0", "72.4", "72.8",
+ "73.2", "73.7", "74.1", "74.5", "74.9", "75.3", "75.7", "76.1",
+ "76.5", "76.9", "77.3", "77.7", "78.1", "78.5", "78.9", "79.3",
+ "79.7", "80.1", "80.4", "80.8", "81.2", "81.6", "81.9", "82.3",
+ "82.7", "83.1", "83.4", "83.8", "84.2", "84.5", "84.9", "85.3",
+ "85.6", "86.0", "86.3", "86.7", "87.1", "87.4", "87.8", "88.1",
+ "88.5", "88.8", "89.2", "89.5", "89.9", "90.2", "90.6", "90.9",
+ "91.3", "91.6", "91.9", "92.3", "92.6", "92.9", "93.3", "93.6",
+ "93.9", "94.2", "94.5", "94.7", "94.9", "95.1", "95.2", "95.4",
+ "95.6", "95.7", "95.9", "96.1", "96.2", "96.4", "96.5", "96.7",
+ "96.8", "96.9", "97.1", "97.2", "97.3", "97.5", "97.6", "97.7",
+ "97.8", "97.9", "98.0", "98.2", "98.3", "98.4", "98.5", "98.6",
+ "98.7", "98.8", "98.9", "99.0", "99.1", "99.1", "99.2", "99.3",
+ "99.3", "99.4", "99.5", "99.5", "99.6", "99.7", "99.7", "99.8",
+ "99.8", "99.9", "99.9", "99.9", "100.0");