allignment pre merge in master
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sat, 8 Jan 2011 14:49:33 +0000 (15:49 +0100)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sat, 8 Jan 2011 14:49:33 +0000 (15:49 +0100)
15 files changed:
INSTALL.sh
web/Obj/auth.phh
web/Obj/brisk.phh
web/brisk.css
web/briskin5/Obj/briskin5.phh
web/briskin5/briskin5.css
web/briskin5/briskin5.js
web/briskin5/index_rd.php
web/briskin5/index_wr.php
web/briskin5/statadm.php
web/commons.js
web/index.php
web/index_rd.php
web/index_wr.php
web/room.js

index 862f27f..6b3e35c 100755 (executable)
@@ -6,7 +6,7 @@
 players_n=3
 tables_n=16
 tables_auth_n=6
-brisk_auth_conf="brisk_auth.conf.pho"
+brisk_auth_conf="brisk_auth2.conf.pho"
 brisk_debug="0xffff"
 web_path="$HOME/brisk"
 legal_path="$HOME/brisk-priv"
@@ -15,8 +15,8 @@ proxy_path="$HOME/brisk-priv/proxy"
 web_only="FALSE"
 brisk_conf="brisk.conf.pho"
 
-if [ -f $HOME/.trusty_install ]; then
-   . $HOME/.trusty_install
+if [ -f $HOME/.brisk_install ]; then
+   . $HOME/.brisk_install
 fi
 if [ "x$cookie_path" = "x" ]; then
    cookie_path=$web_path
index 5f4426d..fd209c9 100644 (file)
@@ -277,13 +277,36 @@ class LoginDBItem {
   var $login;
   var $pass;
   var $email;
+  var $type;
 
-  function LoginDBItem($login, $pass, $email)
+  function LoginDBItem($login, $pass, $email, $type)
   {
     $this->login = $login;
     $this->pass  = $pass;
     $this->email = $email;
+    $this->type  = $type;
   }
+
+  function loginget()
+  {
+      return $this->login;
+  }
+
+  function passget()
+  {
+      return $this->pass;
+  }
+
+  function emailget()
+  {
+      return $this->email;
+  }
+
+  function typeget()
+  {
+      return $this->type;
+  }
+
 }
 
 class LoginDB {
@@ -300,9 +323,9 @@ class LoginDB {
       require("$DOCUMENT_ROOT/Etc/".BRISK_AUTH_CONF);
     }
     else {
-      $this->item = array( new LoginDBItem("uno", md5("one"), "pippo@pluto.com"),
-                           new LoginDBItem("due", md5("two"), "pippo@pluto.com"),
-                           new LoginDBItem("a_b", md5("abb"), "pippo@pluto.com"),
+      $this->item = array( new LoginDBItem("uno", md5("one"),   "pippo@pluto.com"),
+                           new LoginDBItem("due", md5("two"),   "pippo@pluto.com"),
+                           new LoginDBItem("a_b", md5("abb"),   "pippo@pluto.com"),
                            new LoginDBItem("tre", md5("three"), "pippo@pluto.com") );
     }
     $this->item_n = count($this->item);
@@ -368,9 +391,25 @@ class LoginDB {
     return (FALSE);
   }
 
-  function login_verify($login, $pass)
+  function gettype($login)
   {
-    $ret = FALSE;
+    log_main("getmail");
+    
+    /* check the existence of the nick in the LoginDB */
+    for ($i = 0 ; $i < $this->item_n ; $i++) {
+      if (strcasecmp($this->item[$i]->login, $login) == 0) {
+        log_main("login[".$i."]: ".$this->item[$i]->login);
+        return ($this->item[$i]->type);
+      }
+    }
+    return (FALSE);
+  }
+
+  function &login_verify($login, $pass)
+  {
+    GLOBAL $G_false;
+
+    $ret = &$G_false;
 
     log_main("login_verify: ".$login);
         
@@ -394,7 +433,7 @@ class LoginDB {
                   log_main("login_verify SUCCESS for ".$login);
    
                   $chals->rem($login);
-                  $ret = TRUE;
+                  $ret = &$this->item[$i];
                   break;
                 }
               }
index a4b2087..bd40259 100644 (file)
@@ -65,6 +65,7 @@ define(DBG_WRIT, 0x0080);
 define(DBG_LOAD, 0x0100);
 define(DBG_AUTH, 0x0200);
 define(DBG_CRIT, 0x0400);
+define(DBG_LMOP, 0x0800);
 
 // NOTE: BRISK DEBUG must be a numerical constant, not the result of operations on symbols 
 define(BRISK_DEBUG, 0xffffffbf);
@@ -565,9 +566,17 @@ define(USER_FLAG_S_WRK,   0x500); // done
 define(USER_FLAG_S_SMK,   0x600); // done
 define(USER_FLAG_S_EYE,   0x700); // done
 define(USER_FLAG_S_RABB,  0x800); // done
+define(USER_FLAG_S_SOCC,  0x900); // done
+define(USER_FLAG_S_BABY,  0xa00); // done
+define(USER_FLAG_S_MOP,   0xb00); // done
 
 define(USER_FLAG_S_ALL,   0xf00); // done
 
+/* type of user normal, supporter etc ... */
+define(USER_FLAG_TY_ALL,   0xf0000); // done
+define(USER_FLAG_TY_NORM,  0x10000); // done
+define(USER_FLAG_TY_SUPER, 0x20000); // done
+
 class User {
   var $name;       // name of the user
   var $sess;       // session of the user
@@ -1257,7 +1266,7 @@ class Room {
       }
 
       log_main("___");
-      log_main("VALORI name: ".$user_cur->name."  tab: ".$user_cur->table." taix: ".$table_idx."  ucur: ".$user_cur."  us: ".$user);
+      log_main("VALORI name: ".$user_cur->name."  tab: ".$user_cur->table." taix: ".$table_idx);
 
       $ret = "gst.st = ".($user_cur->step+1)."; ".($remove_wagon ? sprintf("tra.rem(%d);",$table_idx) : "");
       if ($user_cur->stat == "room") {
@@ -1568,12 +1577,12 @@ class Room {
         /* MLANG: "<b>Non puoi cambiare nick a un tavolo per soli autenticati.</b>", "Il nickname <b>\'%s\'</b> &egrave; gi&agrave; registrato, <b>se il suo proprietario si autentificher&agrave; verrai rinominato d\'ufficio come ghost<i>N</i>.</b>" */
         if ($user->flags & USER_FLAG_AUTH) {
           if (strcasecmp($user->name,$name_new) != 0) {
-            if (($user->flags & USER_FLAG_MAP_AUTH != USER_FLAG_ISOLAUTH) &&
+             if (( ($user->flags & USER_FLAG_MAP_AUTH) != USER_FLAG_ISOLAUTH) &&
                 ($user->subst == 'standup' || 
                  ($user->subst != 'standup' && $this->table[$user->table]->auth_only == FALSE)
                  )
                 ) {
-              $user->flags &= ~USER_FLAG_AUTH; // Remove auth if name changed
+              $user->flags &= ~(USER_FLAG_AUTH | USER_FLAG_TY_ALL); // Remove auth if name changed
               for ($i = 0 ; $i < TABLES_N ; $i++) {
                 $to_user .= $this->table[$i]->act_content($user);
               }
@@ -1634,6 +1643,15 @@ class Room {
         else if (strcasecmp($st_str, "coniglio") == 0) {
           $st = USER_FLAG_S_RABB;
         }
+        else if (strcasecmp($st_str, "calcio") == 0) {
+          $st = USER_FLAG_S_SOCC;
+        }
+        else if (strcasecmp($st_str, "pupo") == 0) {
+          $st = USER_FLAG_S_BABY;
+        }
+        else if (strcasecmp($st_str, "pulizie") == 0) {
+          $st = USER_FLAG_S_MOP;
+        }
         else {
           /* MLANG: "Questo stato non esiste." */
           $to_user = sprintf('chatt_sub("%s", [2,"%s"],"%s");', $dt, NICKSERV, $mlang_brisk['statunkn'][$G_lang]);
@@ -1836,6 +1854,7 @@ class Room {
     $idx = 0;
 
     $authenticate = FALSE;
+    $user_type    = 0;
     $login_exists = FALSE;
     $ghost = -1;
     $ghost_auth = FALSE;
@@ -1857,11 +1876,14 @@ class Room {
     if ($pass != FALSE) {
       log_auth("XXX", "auth2");
       $authenticate = $userdb->login_verify($name_new, $pass);
-      log_auth("XXX", "authenticate: ".($authenticate == TRUE ? "TRUE" : "FALSE"));
+      log_auth("XXX", "authenticate: ".($authenticate != FALSE ? "TRUE" : "FALSE"));
       
-      if ($authenticate == FALSE) {
-        $idx = -3;
-        return ($G_false);
+      if ($authenticate != FALSE) {
+          $user_type = $authenticate->typeget();
+      }
+      else {
+          $idx = -3;
+          return ($G_false);
       }
     }
     else {
@@ -1878,14 +1900,14 @@ class Room {
         continue; // NOTE: CHECK IT !!
       }
       if (strcasecmp($this->user[$i]->name, $name_new) == 0) {
-       if ($authenticate == FALSE) {
-          $idx = $i;
-          break;
-        }
-        else {
-          $ghost = $i;
-          $ghost_auth = ($this->user[$i]->flags & USER_FLAG_AUTH);
-        }
+          if ($authenticate != FALSE) {
+              $ghost = $i;
+              $ghost_auth = ($this->user[$i]->flags & USER_FLAG_AUTH);
+          }
+          else {
+              $idx = $i;
+              break;
+          }
       }
     }
     if ($idx == -1)
@@ -1893,7 +1915,7 @@ class Room {
 
     log_auth("XXX", sprintf("TROVATO A QUESTO PUNTO [%d] sess [%s] name [%s]", $idx, $sess, $name_new));
 
-    if ($ghost > -1 && $ghost_auth && $authenticate) {
+    if ($ghost > -1 && $ghost_auth && ($authenticate != FALSE)) {
       /* swap session */
 
       $ghost_user =& $this->user[$ghost];
@@ -1947,9 +1969,12 @@ class Room {
       $this->user[$idx]->bantime = 0;
       $this->user[$idx]->ip = $ip;
 
-      $this->user[$idx]->flags = ($authenticate ? USER_FLAG_AUTH : 0x00);
+      $this->user[$idx]->flags = ($authenticate != FALSE ? USER_FLAG_AUTH : 0x00) | $user_type;
+
+      log_auth("XXX", sprintf("FLAGS: [%x]", $this->user[$idx]->flags));
+
       
-      if ($authenticate) {
+      if ($authenticate != FALSE) {
         $this->user[$idx]->flags |= USER_FLAG_LISTAUTH;
 
         if (isset($CO_list)) {
@@ -2248,8 +2273,29 @@ function make_seed()
 }
 
 
+function log_mop($step, $log) {
+  GLOBAL $sess, $PHP_SELF;
+
+  if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_LMOP) == 0)
+    return;
+
+  if (isset($sess) == FALSE)
+    $ssess = "XXXX";
+  else
+    $ssess = $sess;
+
+  if (( (BRISK_DEBUG | ($ssess == BRISK_SINGLE_SESS ? BRISK_SINGLE_DEBUG : 0) ) & DBG_LMOP) == 0)
+    return;
+
+  if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
+    fwrite($fp, sprintf("LMOP: [%f] [%05d] [%s] [%s]\n", gettimeofday(TRUE), $step, $PHP_SELF, $log));
+    fclose($fp);
+  }
+}
+
+
 function log_only2($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_ONL2) == 0)
     return;
@@ -2263,13 +2309,13 @@ function log_only2($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("ONL2: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("ONL2: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_crit($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_CRIT) == 0)
     return;
@@ -2283,13 +2329,13 @@ function log_crit($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("CRIT: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("CRIT: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_only($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_ONLY) == 0)
     return;
@@ -2303,13 +2349,13 @@ function log_only($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("ONLY: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("ONLY: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_main($log) {
-  GLOBAL $sess;
+    GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_MAIN) == 0)
     return;
@@ -2323,13 +2369,13 @@ function log_main($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("MAIN: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("MAIN: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_rd($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_READ) == 0)
     return;
@@ -2343,13 +2389,13 @@ function log_rd($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("READ: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("READ: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_rd2($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_REA2) == 0)
     return;
@@ -2363,13 +2409,13 @@ function log_rd2($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("REA2: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("REA2: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_send($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_SEND) == 0)
     return;
@@ -2383,13 +2429,13 @@ function log_send($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("SEND: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("SEND: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_lock($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_LOCK) == 0)
     return;
@@ -2403,13 +2449,13 @@ function log_lock($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("LOCK: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("LOCK: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_wr($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_WRIT) == 0)
     return;
@@ -2423,13 +2469,13 @@ function log_wr($log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("WRIT: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("WRIT: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_load($log) {
-  GLOBAL $sess;
+  GLOBAL $sess, $PHP_SELF;
 
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_LOAD) == 0)
     return;
@@ -2443,12 +2489,13 @@ function log_load($log) {
     return;
       
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("LOAD: [%s] [%s]\n", $ssess, $log));
+    fwrite($fp, sprintf("LOAD: [%s] [%s] [%s]\n", $ssess, $PHP_SELF, $log));
     fclose($fp);
   }
 }
 
 function log_auth($sess, $log) {
+    GLOBAL $PHP_SELF;
   if (BRISK_SINGLE_SESS == "" && (BRISK_DEBUG & DBG_AUTH) == 0)
     return;
 
@@ -2456,7 +2503,7 @@ function log_auth($sess, $log) {
     return;
 
   if (($fp = @fopen(LEGAL_PATH."/brisk.log", 'a')) != FALSE) {
-    fwrite($fp, sprintf("AUTH: [%s] [%d] [%s]\n", $sess, time(), $log));
+    fwrite($fp, sprintf("AUTH: [%s] [%d] [%s] [%s]\n", $sess, time(), $PHP_SELF, $log));
     fclose($fp);
   }
 }
index 0909e72..c977cd2 100644 (file)
@@ -62,6 +62,12 @@ img.nobo {
     margin: auto;
 }
 
+img.inline { 
+    position:     relative;
+    vertical-align: middle;
+    border-width: 0px;
+}
+
 img.nobohide {
     position:     absolute;
     border-width: 0px;
index 205a122..241be5b 100644 (file)
@@ -605,6 +605,15 @@ class Briskin5 {
            
             */
 
+            /* se gli altri utenti non erano d'accordo questo utente viene bannato */
+            $remcalc = $this->table[0]->exitlock_calc(&$this->user, $user_cur->table_pos);
+            if ($remcalc < 3) {
+                require_once("/var/www/webspace/trusty/Obj/hardban.phh");
+                Hardbans::add(($user_cur->flags & USER_FLAG_AUTH ? $user_cur->name : FALSE),
+                              $user_cur->ip, $user_cur->sess, $user_cur->laccwr + BAN_TIME);
+            }
+            //      $user->bantime = $user->laccwr + BAN_TIME;
+
            $this->table_wakeup(&$user_cur);
          }
        }
@@ -1251,7 +1260,7 @@ function show_table(&$room, &$user, $sendstep, $is_transition, $is_again)
     else
       $ret .= "remark_off();";
     
-    /* WHO CALL AND WATH */
+    /* WHO CALL AND WHAT */
     $ret .= briscola_show($room, $table, $user);
     
   }
@@ -1456,6 +1465,7 @@ function briscola_show($room, $table, $user)
     $ret .= sprintf($prestr, 
                    xcape($room->user[$table->player[$table->asta_win]]->name), $ptnadd);
   }
+  $ret .= sprintf('set_iscalling(%d);', ($table->asta_win - $user->table_pos + BRISKIN5_PLAYERS_N) % BRISKIN5_PLAYERS_N);
 
   $ret .= sprintf('$("caller").style.backgroundImage = \'url("img/brisk_caller_sand%d.png")\';',
                  $table->asta_win);
index 94c9ef7..cf4589a 100644 (file)
@@ -112,6 +112,7 @@ img.cover {
     height: 200px;
     top:  250px;
     left: 300px;
+    z-index: 10;
 }
 
 .asta {
@@ -122,30 +123,35 @@ img.cover {
     height: 200px;
     top:  250px;
     left: 300px;
+    z-index: 10;
 }
 
 img.seed0 {
     position:     absolute; 
     left: 0px;
     top: 55px;
+    cursor: pointer;
 }
 
 img.seed1 {
     position:     absolute; 
     left: 43px;
     top: 55px;
+    cursor: pointer;
 }
 
 img.seed2 {
     position:     absolute; 
     left: 93px;
     top: 55px;
+    cursor: pointer;
 }
 
 img.seed3 {
     position:     absolute; 
     left: 143px;
     top: 55px;
+    cursor: pointer;
 }
 
 .area {
@@ -203,7 +209,7 @@ div.table_commands {
     border-style: solid;
     border-width: 0px;
     border-color: green;
-    z-index: 0;
+    z-index: 1;
 }
 
 .remark1 { 
@@ -217,7 +223,7 @@ div.table_commands {
     border-style: solid;
     border-width: 4px;
     border-color: green;
-    z-index: 0;
+    z-index: 1;
 }
 
 .remark2 { 
@@ -231,7 +237,7 @@ div.table_commands {
     border-style: solid;
     border-width: 2px;
     border-color: green;
-    z-index: 0;
+    z-index: 1;
 }
 
 .punti {
@@ -265,6 +271,20 @@ div.table_commands {
     height: 125px;
 }
 
+.pubinfo_iscalling {
+    /*  background-color: red;  */
+    color: grey;
+    visibility: visible;
+    position: absolute;
+    top: 475px;
+    left: 200px;
+    width:  396px !important;
+    width:  400px;
+    height: 121px !important;
+    height: 125px;
+    border: 2px solid #66bbff;
+}
+
 .public {
     /* background-color: red;  */
     visibility: hidden;
@@ -286,8 +306,6 @@ div.table_commands {
     margin-right: auto;
 }  
 
-
-
 .pubinfo_we {
     color: grey;
     visibility: visible;
@@ -298,6 +316,19 @@ div.table_commands {
     height: 200px;
 }
 
+.pubinfo_we_iscalling {
+    color: grey;
+    visibility: visible;
+    position: absolute;
+    top: 250px;
+    left: 175px;
+    width:  121px !important;
+    width:  125px;
+    height: 196px !important;
+    height: 200px;
+    border: 2px solid #66bbff;
+}
+
 .public_we {
     /*  background-color: red;  */
     visibility: hidden;
@@ -321,6 +352,20 @@ div.table_commands {
     height: 125px;
 }
 
+.pubinfo_nw_iscalling {
+    /*  background-color: red;  */
+    color: grey;
+    visibility: visible;
+    position: absolute;
+    top: 125px;
+    left: 200px;
+    width:  196px !important;
+    width:  200px;
+    height: 121px !important;
+    height: 125px;
+    border: 2px solid #66bbff;
+}
+
 .public_nw {
     /*  background-color: red;   */
     visibility: hidden;
@@ -333,52 +378,78 @@ div.table_commands {
     overflow: hidden;
 }
 
-.public_ne {
+.pubinfo_ne {
     /*  background-color: red;  */
-    visibility: hidden;
+    color: grey;
+    visibility: visible;
     position: absolute;
     top: 125px;
     left: 400px;
-    display: table;
     width:  200px;
     height: 125px;
-    overflow: hidden;
 }
 
-.pubinfo_ne {
+.pubinfo_ne_iscalling {
     /*  background-color: red;  */
     color: grey;
     visibility: visible;
     position: absolute;
     top: 125px;
     left: 400px;
+    width:  196px !important;
     width:  200px;
+    height: 121px !important;
     height: 125px;
+    border: 2px solid #66bbff;
 }
 
+.public_ne {
+    /*  background-color: red;  */
+    visibility: hidden;
+    position: absolute;
+    top: 125px;
+    left: 400px;
+    display: table;
+    width:  200px;
+    height: 125px;
+    overflow: hidden;
+}
 
-
-.public_ea {
+.pubinfo_ea {
     /*  background-color: red; */
-    visibility: hidden;
+    color: grey;
+    visibility: visible;
     position: absolute;
     top: 250px;
     left: 500px;
-    display: table;
     width:  125px;
     height: 200px;
-    overflow: hidden;
 }
 
-.pubinfo_ea {
+.pubinfo_ea_iscalling {
     /*  background-color: red; */
     color: grey;
     visibility: visible;
     position: absolute;
     top: 250px;
     left: 500px;
+    width:  121px !important;
     width:  125px;
+    height: 196px !important;
     height: 200px;
+    border: 2px solid #66bbff;
+}
+
+.public_ea {
+    /*  background-color: red; */
+    visibility: hidden;
+    position: absolute;
+    top: 250px;
+    left: 500px;
+    display: table;
+    width:  125px;
+    height: 200px;
+    overflow: hidden;
 }
 
 .vert_midfloat {
index 83a837c..00c79d8 100644 (file)
@@ -207,6 +207,8 @@ function table_init() {
     $("asta").style.visibility = "hidden";
     $("caller").style.visibility = "hidden";
     show_astat(-2,-2,-2,-2,-2);
+    set_iscalling(-1);
+
     for (i=0 ; i < 8 ; i++) {
        Drag.init($("card" + i), card_mouseup_cb);
        for (e = 0 ; e < PLAYERS_N ; e++)
@@ -268,7 +270,7 @@ function act_reload()
 
 function set_names(so,ea,ne,nw,we)
 {
-//    alert("EA: "+ea);
+    // alert("SET NAME");
     $("name").innerHTML = italizer(so);
     $("name").title = unescapeHTML(so[1]); 
     $("name_ea").innerHTML = italizer(ea);
@@ -280,9 +282,22 @@ function set_names(so,ea,ne,nw,we)
     $("name_we").innerHTML = italizer(we);
     $("name_we").title = unescapeHTML(we[1]);
 
+    for (i = 0 ; i < PLAYERS_N ; i++) 
+        $("name"+astat_suffix[i]).title_orig = $("name"+astat_suffix[i]).title;
+
     return;
 }
 
+function set_iscalling(idx)
+{
+    var i;
+
+    for (i = 0 ; i < PLAYERS_N ; i++) {
+        $("name"+astat_suffix[i]).className = "pubinfo"+astat_suffix[i]+(i == idx ? "_iscalling" : "");
+        $("name"+astat_suffix[i]).title = $("name"+astat_suffix[i]).title_orig + (i == idx ? " sta chiamando" : "");
+    }
+}
+
 function preferences_init()
 {
     var rd;
index 8055c20..042bb29 100644 (file)
@@ -252,6 +252,8 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
        $new_subst = $user->subst;
        $new_step =  $user->step;
       } while (0);
+
+      log_mop($user->step, 'bin::index_rd.php: after ret set');
       
       if ($user->the_end == TRUE) {
        log_rd2("LOGOUT BYE BYE!!");
@@ -293,9 +295,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
    step
 */
 
-$is_page_streaming =  ((stristr($HTTP_USER_AGENT, "linux") && 
-                       (stristr($HTTP_USER_AGENT, "firefox") || stristr($HTTP_USER_AGENT, "iceweasel"))) ? FALSE : TRUE);
-
+$is_page_streaming =  (stristr($HTTP_USER_AGENT, "MSIE") || stristr($HTTP_USER_AGENT, "CHROME") ? TRUE : FALSE);
 
 header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
@@ -317,6 +317,7 @@ $old_step =  $ext_step = $step;
 
 for ($i = 0 ; time() < $endtime ; $i++) {
   // log_rd("PRE MAIN ".$step);;
+  $pre_main = gettimeofday(TRUE);
   if (($ret = maincheck($sess, $old_stat, $old_subst, $old_step, &$stat, &$subst, &$step, $table_idx, $table_token)) != FALSE) {
     echo '@BEGIN@';
     // log_rd2(sprintf("\nSESS: [%s]\nOLD_STAT: [%s] OLD_SUBST: [%s] OLD_STEP: [%s] \nSTAT: [%s] SUBST: [%s] STEP: [%s] \nCOMM: [%s]\n", $sess, $old_stat, $old_subst, $old_step, $stat, $subst, $step, $ret));
@@ -324,6 +325,7 @@ for ($i = 0 ; time() < $endtime ; $i++) {
     echo ' @END@'; 
     log_send("EXT_STEP: ".$ext_step." ENDTIME: [".$endtime."] ".$ret);
     flush();
+    log_mop(0, 'bin::index_rd.php: after flush (begin: '.sprintf("%f", $pre_main).')');
     if ($is_page_streaming)
       break;
   }
@@ -332,7 +334,7 @@ for ($i = 0 ; time() < $endtime ; $i++) {
   $old_step =  $step;
   // log_rd("POST MAIN ".$step);;
   usleep(400000);
-  if (($i % 5) == 0) {
+  if (($i % 10) == 0) {
     // log_rd2("TIME: ".time());
     echo '_';
     flush();
index 81922cf..22feb29 100644 (file)
@@ -49,6 +49,8 @@ log_wr('COMM: '.$mesg);
 if ($table_idx < 0 || $table_idx >= TABLE_N)
      exit;
 
+log_mop(0, 'bin::index_wr.php: COMM: '.xcapemesg($mesg));
+
 $sem = Briskin5::lock_data($table_idx);
 
 if (($bri = &Briskin5::load_data($table_idx,$table_token)) == FALSE) {
@@ -67,8 +69,9 @@ if (($user = &$bri->get_user($sess, &$idx)) == FALSE) {
 $argz = explode('|', $mesg);
 
 log_wr('POSTSPLIT: '.$argz[0]);
+log_mop($user->step, 'bin::index_wr.php: after get_user()');
 
-if ($argz[0] == 'shutdown') {
+if (false && $argz[0] == 'shutdown') {
   log_auth($user_cur->sess, "Shutdown session. delegate to room gc the autologout");
   
   log_rd2("bin5/index_wr.php: AUTO LOGOUT.");
@@ -483,7 +486,7 @@ else if ($user->stat == 'table') {
           }
           log_legal($curtime, $user, "STAT:BRISKIN5:FINISH_GAME", $plist);
           if ($user->table_orig < TABLES_AUTH_N)
-            log_points($curtime, xcapelt($user), "STAT:BRISKIN5:FINISH_GAME", $plist);
+            log_points($curtime, xcapelt($user->name), "STAT:BRISKIN5:FINISH_GAME", $plist);
 
          $table->game_next();
          $table->game_init(&$bri->user);
@@ -515,6 +518,7 @@ else if ($user->stat == 'table') {
 }
 log_wr("before save data");
 Briskin5::save_data($bri);
+log_mop($user->step, 'bin::index_wr.php: after save_data()');
 
 Briskin5::unlock_data($sem);
 exit;
index ce73f0a..4933b03 100644 (file)
@@ -35,7 +35,7 @@ TODO:
    
 */
 
-ini_set("max_execution_time",  "120");
+ini_set("max_execution_time",  "240");
 
 require_once("../Obj/brisk.phh");
 require_once("../Obj/auth.phh");
@@ -50,7 +50,7 @@ function main()
   $wee = array();
   
   echo "inizio<br>";
-  fflush();
+  flush();
   if ($pazz != $G_alarm_passwd)
     exit;
 
index 704c481..e3e56d7 100644 (file)
@@ -252,6 +252,12 @@ function send_mesg(mesg)
     // alert("xhr_wr: "+xhr_wr+"  is_conn: "+is_conn);
     xhr_wr.open('GET', 'index_wr.php?'+(is_conn ? 'sess='+sess+'&' : '')+'mesg='+mesg, (is_conn ? true : false));
     xhr_wr.onreadystatechange = function() { return; };
+    if (typeof(console) == 'object') {
+        if (typeof(console.log) == 'function') {
+            var ldate = new Date();
+            console.log(ldate.getTime()+':MESG:'+mesg);
+        }
+    }
     xhr_wr.send(null);
 
     if (!is_conn) {
index d75a7f2..0aa8592 100644 (file)
@@ -20,7 +20,7 @@
  * not, write to the Free Software Foundation, Inc, 59 Temple Place -
  * Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id$
+ * $Id: index.php,v 1.33.2.28 2009-12-12 08:42:19 nastasi Exp $
  *
  */
 
@@ -79,6 +79,12 @@ $mlang_room = array( 'userpasserr'  => array('it' => 'Utente e/o password errati
                                              'en' => 'present'),
                      'st_rabb_desc' => array('it' => 'coniglio',
                                              'en' => 'rabbit'),
+                     'st_socc_desc' => array('it' => 'calcio',
+                                             'en' => 'soccer'),
+                     'st_baby_desc' => array('it' => 'pupo',
+                                             'en' => 'baby'),
+                     'st_mop_desc'  => array('it' => 'pulizie',
+                                             'en' => 'mop'),
                      
                      'tit_ticker'   => array('it' => 'scrivi un invito al tavolo e clicca',
                                              'en' => 'write an invitation at the table and click'),
@@ -154,10 +160,10 @@ $mlang_room = array( 'userpasserr'  => array('it' => 'Utente e/o password errati
                                              'en' => 'roadmap of next functionalities'),
                      'itm_rmap'     => array('it' => 'roadmap',
                                              'en' => 'roadmap'),
-                     'tit_meet'     => array('it' => 'foto dei raduni di briskisti',
+                     'tit_meet'     => array('it' => 'foto dei raduni di briskisti (serve Facebook)',
                                              'en' => 'photos of brisk meetings'),
-                     'itm_meet'     => array('it' => 'raduni',
-                                             'en' => 'meeting'),
+                     'itm_meet'     => array('it' => 'BriskMeeting',
+                                             'en' => 'BriskMeeting'),
                      'tit_mesg'     => array('it' => 'manda un messaggio o una segnalazione all\'amministratore del sito',
                                              'en' => 'send a message or a signalling to the administrator' ),
                      'mesgtoadm_tit'=> array('it' => 'Invia un messaggio o una segnalazione all\'amministratore:',
@@ -207,6 +213,12 @@ function poll_dom() {
     return '';
 }
 
+function carousel_top()
+{
+    $rn = rand(1, 3);
+    return (sprintf('<a target="_blank" href="http://shop.alternativeoutput.it"><img class="nobo" style="display: inline; border: 1px solid #808080;" src="img/briskshop%d.gif"></a>', $rn));
+}
+
 function main()
 {
   GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all;
@@ -223,177 +235,177 @@ function main()
   $ACTION = "login";
   
   if (isset($BRISK_SHOWHTML) == FALSE) {
-    $is_table = FALSE;
-    $sem = Room::lock_data();
-    log_main("lock Room");
-    $room = &Room::load_data();
-    $curtime = time();
-
-    /* Actions */
-
-    if (validate_sess($sess)) {
-      log_main("pre garbage_manager UNO");
-      $room->garbage_manager(TRUE);
-      log_main("post garbage_manager");
-      if (($user = &$room->get_user($sess, &$idx)) != FALSE) {
-       log_main("user stat: ".$user->stat);
-       if ($user->stat == "table") {
-         if (Room::save_data(&$room) == FALSE) {
-           echo "ERRORE SALVATAGGIO\n";
-           exit;
-         }
-         log_main("unlock Room");
-         Room::unlock_data($sem);
-         setcookie("table_token", $user->table_token, $curtime + 31536000);
-         setcookie("table_idx", $user->table, $curtime + 31536000);
-         header ("Location: briskin5/index.php");
-         exit;
-       }
-       $ACTION = "room";
-      }
-
-      if (Room::save_data(&$room) == FALSE) {
-       echo "ERRORE SALVATAGGIO\n";
-       exit;
-      }
-    }
-    
-    if ($ACTION == "login" && isset($name)) {
+      $is_table = FALSE;
+      $sem = Room::lock_data();
+      log_main("lock Room");
+      $room = &Room::load_data();
+      $curtime = time();
       
-      log_main("pre garbage_manager DUE");
-
-      if (isset($pass_private) == FALSE) {
-        $pass_private = FALSE;
+      /* Actions */
+      
+      if (validate_sess($sess)) {
+          log_main("pre garbage_manager UNO");
+          $room->garbage_manager(TRUE);
+          log_main("post garbage_manager");
+          if (($user = &$room->get_user($sess, &$idx)) != FALSE) {
+              log_main("user stat: ".$user->stat);
+              if ($user->stat == "table") {
+                  if (Room::save_data(&$room) == FALSE) {
+                      echo "ERRORE SALVATAGGIO\n";
+                      exit;
+                  }
+                  log_main("unlock Room");
+                  Room::unlock_data($sem);
+                  setcookie("table_token", $user->table_token, $curtime + 31536000);
+                  setcookie("table_idx", $user->table, $curtime + 31536000);
+                  header ("Location: briskin5/index.php");
+                  exit;
+              }
+              $ACTION = "room";
+          }
+          
+          if (Room::save_data(&$room) == FALSE) {
+              echo "ERRORE SALVATAGGIO\n";
+              exit;
+          }
       }
-
-      $room->garbage_manager(TRUE);
-      /* try login */
-      if (($user = &$room->add_user(&$sess, &$idx, $name, $pass_private, $_SERVER['REMOTE_ADDR'])) != FALSE) {
-       $ACTION = "room";
-       if ($idx < 0) {
-          $idx = -$idx - 1;
-          $is_login = TRUE;
-        }
-
-        log_legal($curtime, $user, "STAT:LOGIN", '');
-
-        // recovery lost game
-       if ($user->stat == "table") {
-         if (Room::save_data(&$room) == FALSE) {
-           echo "ERRORE SALVATAGGIO\n";
-           exit;
-         }
-         log_main("unlock Room");
-         Room::unlock_data($sem);
-         setcookie("table_token", $user->table_token, $curtime + 31536000);
-         setcookie("table_idx", $user->table, $curtime + 31536000);
-         header ("Location: briskin5/index.php");
-         exit;
-       }
-
-
-       // setcookie ("sess", "", time() + 180);      
-       $room->standup_update(&$user);
-       
+      
+      if ($ACTION == "login" && isset($name)) {
+          
+          log_main("pre garbage_manager DUE");
+          
+          if (isset($pass_private) == FALSE) {
+              $pass_private = FALSE;
+          }
+          
+          $room->garbage_manager(TRUE);
+          /* try login */
+          if (($user = &$room->add_user(&$sess, &$idx, $name, $pass_private, $_SERVER['REMOTE_ADDR'])) != FALSE) {
+              $ACTION = "room";
+              if ($idx < 0) {
+                  $idx = -$idx - 1;
+                  $is_login = TRUE;
+              }
+              
+              log_legal($curtime, $user, "STAT:LOGIN", '');
+              
+              // recovery lost game
+              if ($user->stat == "table") {
+                  if (Room::save_data(&$room) == FALSE) {
+                      echo "ERRORE SALVATAGGIO\n";
+                      exit;
+                  }
+                  log_main("unlock Room");
+                  Room::unlock_data($sem);
+                  setcookie("table_token", $user->table_token, $curtime + 31536000);
+                  setcookie("table_idx", $user->table, $curtime + 31536000);
+                  header ("Location: briskin5/index.php");
+                  exit;
+              }
+              
+              
+              // setcookie ("sess", "", time() + 180);      
+              $room->standup_update(&$user);
+              
        if (Room::save_data(&$room) == FALSE) {
-         echo "ERRORE SALVATAGGIO\n";
-         exit;
+            echo "ERRORE SALVATAGGIO\n";
+            exit;
        }
+          }
+          else {
+              /* Login Rendering */
+              /* MLANG: "Utente e/o password errati.", "Il nickname deve contenere almeno una lettera o una cifra.", "Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.", "Il tuo nickname &egrave; gi&agrave; in uso." */
+              /*
+               if ($idx == -3) 
+               $body .= '<div class="urgmsg"><b>'.$mlang_room['userpasserr'][$G_lang].'</b></div>';
+               else if ($idx == -2)
+               // $body .= '<div class="urgmsg"><b>Il nickname deve contenere almeno una lettera o una cifra.</b></div>';
+               $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassmust'][$G_lang].'</b></div>';
+               else if ($idx == -1) 
+               // $body .= '<div class="urgmsg"><b>Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.</b></div>';
+               $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassend'][$G_lang].'</b></div>';
+               else
+               // $body .= '<div class="urgmsg"><b>Il tuo nickname &egrave; gi&agrave; in uso.</b></div>';
+               $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassuse'][$G_lang].'</b></div>';
+              */
+              
+              if ($idx == -3) 
+                  $sfx = 'err';
+              else if ($idx == -2)
+                  $sfx = 'must';
+              else if ($idx == -1) 
+                  $sfx = 'end';
+              else
+                  $sfx = 'use';
+              
+              $body .= '<div class="urgmsg"><b>'.$mlang_room['userpass'.$sfx][$G_lang].'</b></div>';
+          }
       }
-      else {
-       /* Login Rendering */
-        /* MLANG: "Utente e/o password errati.", "Il nickname deve contenere almeno una lettera o una cifra.", "Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.", "Il tuo nickname &egrave; gi&agrave; in uso." */
-        /*
-       if ($idx == -3) 
-         $body .= '<div class="urgmsg"><b>'.$mlang_room['userpasserr'][$G_lang].'</b></div>';
-       else if ($idx == -2)
-         // $body .= '<div class="urgmsg"><b>Il nickname deve contenere almeno una lettera o una cifra.</b></div>';
-         $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassmust'][$G_lang].'</b></div>';
-       else if ($idx == -1) 
-         // $body .= '<div class="urgmsg"><b>Spiacenti, non ci sono pi&ugrave; posti liberi. Riprova pi&ugrave; tardi.</b></div>';
-         $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassend'][$G_lang].'</b></div>';
-       else
-         // $body .= '<div class="urgmsg"><b>Il tuo nickname &egrave; gi&agrave; in uso.</b></div>';
-          $body .= '<div class="urgmsg"><b>'.$mlang_room['userpassuse'][$G_lang].'</b></div>';
-        */
-
-       if ($idx == -3) 
-          $sfx = 'err';
-       else if ($idx == -2)
-          $sfx = 'must';
-       else if ($idx == -1) 
-         $sfx = 'end';
-       else
-         $sfx = 'use';
-
-        $body .= '<div class="urgmsg"><b>'.$mlang_room['userpass'.$sfx][$G_lang].'</b></div>';
-      }
-    }
-    Room::unlock_data($sem);
+      Room::unlock_data($sem);
   }
   /* Rendering. */
 
   if ($BRISK_SHOWHTML == "debugtable") {
-    $ACTION = "room";
+      $ACTION = "room";
   }
   else if ($BRISK_SHOWHTML == "debuglogin") {
-    $ACTION = "login";
+      $ACTION = "login";
   }
-
+  
   if ($ACTION == "room") {
-    $tables .= '<div class="room_tab">';
-    $tables .= '<table class="room_tab">';
-    for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
-      if ($user->flags & USER_FLAG_AUTH)
+      $tables .= '<div class="room_tab">';
+      $tables .= '<table class="room_tab">';
+      for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
+          if ($user->flags & USER_FLAG_AUTH)
         $i = $ii;
-      else
-        $i = TABLES_N - $ii - 1;
-
-      if ($ii % 4 == 0) {
-          $tables .= '<tr id = "tr_noauth'.$ii.'">';
-      }
-      if (TRUE || !($user->flags & USER_FLAG_ISOLAUTH) || $ii < TABLES_AUTH_N) {
-        $tables .= '<td id = "td_noauth'.$ii.'">';
-
-        $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
-        $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
-        $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
-        $tables .= '</div>';
-        $tables .= '</td>'."\n";
+          else
+              $i = TABLES_N - $ii - 1;
+          
+          if ($ii % 4 == 0) {
+              $tables .= '<tr id = "tr_noauth'.$ii.'">';
+          }
+          if (TRUE || !($user->flags & USER_FLAG_ISOLAUTH) || $ii < TABLES_AUTH_N) {
+              $tables .= '<td id = "td_noauth'.$ii.'">';
+              
+              $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
+              $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
+              $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
+              $tables .= '</div>';
+              $tables .= '</td>'."\n";
+          }
+          if ($ii % 4 == 3) {
+              $tables .= '</tr>';
+          }
       }
-      if ($ii % 4 == 3) {
-       $tables .= '</tr>';
-      }
-    }
-    $tables .= '</table></div>';
-
-
-    $standup .= '<table class="room_standup"><tr><td><div class="room_standup_orig" id="room_standup_orig"></div>';
-    $standup .= '<div class="room_ex_standup">';
-    /* MLANG: "Giocatori in piedi" */
-    // $standup .= '<div id="room_tit"><span class="room_titin"><b>Giocatori in piedi</b> - <a target="_blank" href="weboftrust.php">Come ottenere user e password</a> - </span></div>';
-    $standup .= '<div id="room_tit"><span class="room_titin"><b>'.$mlang_room['standing'][$G_lang].'</b></span></div>';
-    
-    $standup .= sprintf('<div id="standup" class="room_standup"></div>');
-    // MLANG Esco.
-    $standup .= '<div id="esco" class="esco"><input type="button" class="button" name="xreload"  value="Reload." onclick="act_reloadroom();"><input class="button" name="logout" value="'.$mlang_room['btn_exit'][$G_lang].'" onclick="esco_cb();" type="button"></div>';
-    $standup .= '</div></td></tr></table>';
+      $tables .= '</table></div>';
+      
+      
+      $standup .= '<table class="room_standup"><tr><td><div class="room_standup_orig" id="room_standup_orig"></div>';
+      $standup .= '<div class="room_ex_standup">';
+      /* MLANG: "Giocatori in piedi" */
+      // $standup .= '<div id="room_tit"><span class="room_titin"><b>Giocatori in piedi</b> - <a target="_blank" href="weboftrust.php">Come ottenere user e password</a> - </span></div>';
+      $standup .= '<div id="room_tit"><span class="room_titin"><b>'.$mlang_room['standing'][$G_lang].'</b></span></div>';
+      
+      $standup .= sprintf('<div id="standup" class="room_standup"></div>');
+      // MLANG Esco.
+      $standup .= '<div id="esco" class="esco"><input type="button" class="button" name="xreload"  value="Reload." onclick="act_reloadroom();"><input class="button" name="logout" value="'.$mlang_room['btn_exit'][$G_lang].'" onclick="esco_cb();" type="button"></div>';
+      $standup .= '</div></td></tr></table>';
   }
-
+  
   $altout_sponsor_arr = array( array ( 'id' => 'btn_altout',
-                                  'url' => 'http://www.alternativeoutput.it',
-                                 'content' => 'img/altout80x15.png',
-                                  'content_big' => 'img/logotxt_banner.png'),
-                         array ( 'id' => 'btn_virtualsky',
-                                  'url' => 'http://virtualsky.alternativeoutput.it',
-                                 'content' => 'img/virtualsky80x15a.gif',
-                                  'content_big' => 'img/virtualsky_big.png'),
-                         array ( 'id' => 'btn_dynamica',
-                                  'url' => 'http://www.dynamica.it',
-                                 'content' => 'img/dynamica.png',
-                                  'content_big' => 'img/dynamica_big.png')
-                         );
-
+                                       'url' => 'http://www.alternativeoutput.it',
+                                       'content' => 'img/altout80x15.png',
+                                       'content_big' => 'img/logotxt_banner.png'),
+                               array ( 'id' => 'btn_virtualsky',
+                                       'url' => 'http://virtualsky.alternativeoutput.it',
+                                       'content' => 'img/virtualsky80x15a.gif',
+                                       'content_big' => 'img/virtualsky_big.png'),
+                               array ( 'id' => 'btn_dynamica',
+                                       'url' => 'http://www.dynamica.it',
+                                       'content' => 'img/dynamica.png',
+                                       'content_big' => 'img/dynamica_big.png')
+                               );
+  
   $altout_support_arr = array( array ( 'id' => 'btn_brichi',
                                        'url' => 'http://www.briscolachiamata.it',
                                        'content' => 'img/brichi.png',
@@ -402,56 +414,55 @@ function main()
                                        'url' => 'http://www.forumolimpia.it',
                                        'content' => 'img/forumolimpia.gif',
                                        'content_big' => 'img/forumolimpia_big.png' ) );
-
-
-
+  
+  
+  
   $altout_support = "";
   $altout_support_big = "";
   for ($i = 0 ; $i < 3 ; $i++) {
-    $ii = ($i < 2 ? $i : 0);
-
-    $altout_support .= sprintf('<a style="position: absolute; top: %dpx; left: 7px;" target="_blank" href="%s"><img class="nobo" id="%s" src="%s" onMouseOver="show_bigpict(this, \'over\',100,10);" onMouseOut="show_bigpict(this, \'out\',0,0);"></a><br>',
-                               $i * 20, $altout_support_arr[$ii]['url'],
-                               $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']);
-    
-    $altout_support_big .= sprintf('<img style="position: absolute;" class="nobohide" id="%s_big" src="%s">',
-                                   $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']);
+      $ii = ($i < 2 ? $i : 0);
+      
+      $altout_support .= sprintf('<a style="position: absolute; top: %dpx; left: 7px;" target="_blank" href="%s"><img class="nobo" id="%s" src="%s" onMouseOver="show_bigpict(this, \'over\',100,10);" onMouseOut="show_bigpict(this, \'out\',0,0);"></a><br>',
+                                 $i * 20, $altout_support_arr[$ii]['url'],
+                                 $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']);
+      
+      $altout_support_big .= sprintf('<img style="position: absolute;" class="nobohide" id="%s_big" src="%s">',
+                                     $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']);
   }
-
-
+  
+  
   // seed with microseconds since last "whole" second
   // srand ((double) microtime() * 1000000);
   // $randval = rand(0,count($altout_sponsor_arr)-1);
   $altout_sponsor = "";
   $altout_sponsor_big = "";
   for ($i = 0 ; $i < 4 ; $i++) {
-    $ii = ($i < 3 ? $i : 0);
-
-    $altout_sponsor .= sprintf('<a style="position: absolute; top: %dpx; left: 7px;" target="_blank" href="%s"><img class="nobo" id="%s" src="%s" onMouseOver="show_bigpict(this, \'over\',100,10);" onMouseOut="show_bigpict(this, \'out\',0,0);"></a><br>',
-                               $i * 20, $altout_sponsor_arr[$ii]['url'],
-                               $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']);
-    
-    $altout_sponsor_big .= sprintf('<img class="nobohide" id="%s_big" src="%s">',
+      $ii = ($i < 3 ? $i : 0);
+      
+      $altout_sponsor .= sprintf('<a style="position: absolute; top: %dpx; left: 7px;" target="_blank" href="%s"><img class="nobo" id="%s" src="%s" onMouseOver="show_bigpict(this, \'over\',100,10);" onMouseOut="show_bigpict(this, \'out\',0,0);"></a><br>',
+                                 $i * 20, $altout_sponsor_arr[$ii]['url'],
+                                 $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']);
+      
+      $altout_sponsor_big .= sprintf('<img class="nobohide" id="%s_big" src="%s">',
                                    $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content_big']);
   }
-
-
-
-
-
+  
+  
+  
+  
+  
   $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt");
   if ($brisk_donate == FALSE)
-    $brisk_donate = "";
-
-
+      $brisk_donate = "";
+  
+  
   /* MLANG: "briscola chiamata in salsa ajax", */
-
-$brisk_header_form = '<div class="container">
-<!-- =========== header ===========  -->
-<div id="header" class="header">
-<table width="100%%" border="0" cols="3"><tr>
-<td align="left"><div style="padding-left: 8px;">'.($G_is_local ? '' :
-'<script type="text/javascript"><!--
+  
+  mt_srand(make_seed());
+  $rn = rand(0, 1);
+  
+  if ($rn == 0) { 
+      $banner_top_left = '<script type="text/javascript"><!--
 google_ad_client = "pub-5246925322544303";
 google_ad_width = 234;
 google_ad_height = 60;
@@ -467,17 +478,12 @@ google_color_url = "000000";
 </script>
 <script type="text/javascript"
   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>'
-).'</div></td>
-<td align="center">'.(($G_with_topbanner || $G_with_donors) ? '<table><tr><td>' : '').'<div style="text-align: center;">
-    <img class="nobo" src="img/brisk_logo64.png">
-    '.$mlang_room['headline'][$G_lang].'<br>
-    </div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>', 
-                                                                ($G_with_topbanner ? $G_topbanner : 
-"<div style='background-color: #ffd780; border: 1px solid black; text-align: center;'><img class='nobo' src=\"donometer.php?c=".$G_donors_cur."&a=".$G_donors_all."\"><div style='padding: 1px; background-color: white;'><b>donatori</b></div></div>") ) : '').'</td>
-<td align="right"><div style="padding-right: 8px;">
-'.($G_is_local ? '' :
-'<script type="text/javascript"><!--
+</script>';
+      $banner_top_right = carousel_top();
+  }
+  else { 
+      $banner_top_left = carousel_top();
+      $banner_top_right = '<script type="text/javascript"><!--
 google_ad_client = "pub-5246925322544303";
 google_ad_width = 234;
 google_ad_height = 60;
@@ -493,13 +499,27 @@ google_color_url = "000000";
 </script>
 <script type="text/javascript"
   src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-</script>'
-).'</div></td>
+</script>';
+  }
+
+  $brisk_header_form = '<div class="container">
+<!-- =========== header ===========  -->
+<div id="header" class="header">
+<table width="100%%" border="0" cols="3"><tr>
+<td align="left"><div style="padding-left: 8px;">'.($G_is_local ? '' : $banner_top_left ).'</div></td>
+<td align="center">'.(($G_with_topbanner || $G_with_donors) ? '<table><tr><td>' : '').'<div style="text-align: center;">
+    <img class="nobo" src="img/brisk_logo64.png">
+    '.$mlang_room['headline'][$G_lang].'<br>
+    </div>'.( ($G_with_topbanner || $G_with_donors) ? sprintf('</td><td>%s</td></tr></table>', 
+                                                                ($G_with_topbanner ? $G_topbanner : 
+"<div style='background-color: #ffd780; border: 1px solid black; text-align: center;'><img class='nobo' src=\"donometer.php?c=".$G_donors_cur."&a=".$G_donors_all."\"><div style='padding: 1px; background-color: white;'><b>donatori</b></div></div>") ) : '').'</td>
+<td align="right"><div style="padding-right: 8px;">
+'.($G_is_local ? '' : $banner_top_right ).'</div></td>
 </td></table>
 </div>';
 
 /* MLANG: ALL THE VERTICAL MENU */
-$brisk_vertical_menu = '
+  $brisk_vertical_menu = '
 <!--  =========== vertical menu ===========  -->
 <div class="topmenu">
 <!-- <a target="_blank" href="/briskhome.php"></a> -->
@@ -568,14 +588,43 @@ $brisk_vertical_menu = '
 <a href="#" title="'.$mlang_room['tit_meet'][$G_lang].'" 
    onmouseover="menu_show(\'menu_meeting\');">'.$mlang_room['itm_meet'][$G_lang].'</a><br>
 
-<div id="menu_meeting" class="webstart">
-<a href="http://www.anomalia.it/mop/photoo" 
+<div style="text-align: right;" id="menu_meeting" class="webstart">
+<a href="http://it-it.facebook.com/event.php?eid=262482143080&index=1"
    target="_blank" onmouseover="menu_hide(0,2);"
-   title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
+   title="1° Torneo-Meeting di Lodi del 21/02/2010" ><img style="display: inline;" class="nobo" src="img/coppa16.png">Lodi 02/10</a><br>
+
+<a href="http://it-it.facebook.com/event.php?eid=165523204539&index=1"
+   target="_blank" onmouseover="menu_hide(0,2);"
+   title="1° Torneo-Meeting di Parma del 22/11/2009" <img style="display: inline;" class="nobo" src="img/coppa16.png">Parma 11/09</a><br>
+
+<a href="http://it-it.facebook.com/event.php?eid=105699129890&index=1"
+   target="_blank" onmouseover="menu_hide(0,2);"
+   title="BriskMeeting di Parma del 13/09/2009" >Parma 09/09</a><br>
+
+<a href="http://it-it.facebook.com/event.php?eid=97829048656&index=1"
+   target="_blank" onmouseover="menu_hide(0,2);"
+   title="BriskMeeting di Clusane d\'Iseo del 5/07/2009" >Clusane 07/09</a><br>
+
+<a href="http://it-it.facebook.com/event.php?eid=103366692570&index=1"
+   target="_blank" onmouseover="menu_hide(0,2);"
+   title="BriskMeeting Siciliano del 14/06/2009" >Catania 06/09</a><br>
+
+<a href="http://it-it.facebook.com/event.php?eid=81488770852&index=1" 
+   target="_blank" onmouseover="menu_hide(0,2);"
+   title="BriskMeeting di Piacenza del 19/04/2009" >Piacenza 04/09</a><br>
+
+<a href="http://it-it.facebook.com/event.php?eid=51159131399&index=1" 
+   target="_blank" onmouseover="menu_hide(0,2);"
+   title="BriskMeeting di Parma del 22/02/2009" >Parma 02/09</a><br>
 
 <a href="http://www.anomalia.it/mop/photoo?album=brisk_pc0806" 
    target="_blank" onmouseover="menu_hide(0,2);"
    title="Raduno di Piacenza del del 15/06/2008" >Piacenza 06/08</a><br>
+
+<a href="http://www.anomalia.it/mop/photoo" 
+   target="_blank" onmouseover="menu_hide(0,2);"
+   title="Torneo di Milano del 17/05/2008" >Milano 05/08</a><br>
+
 </div>
 </div>'. ($ACTION == "room" ? '<div style="padding: 0px; margin: 0px; witdh: 50px; height: 8px; font-size: 1px;"></div><img class="nobo" src="img/brisk_commands'.langtolng($G_lang).'.png" onmouseover="menu_hide(0,0); menu_show(\'menu_commands\');">
 
@@ -653,6 +702,28 @@ $brisk_vertical_menu = '
           .$mlang_room['st_rabb_desc'][$G_lang].
 '&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
 
+<a href="#" 
+   onmouseover="menu_hide(0,2);"
+   title="" onclick="act_chatt(\'/st calcio\'); menu_over(-1,this);">'
+          // MLANG
+          .$mlang_room['st_socc_desc'][$G_lang].
+'&nbsp;<img class="unbo" src="img/st_soccer.png"></a><br>
+
+<a href="#" 
+   onmouseover="menu_hide(0,2);"
+   title="" onclick="act_chatt(\'/st pupo\'); menu_over(-1,this);">'
+          // MLANG
+          .$mlang_room['st_baby_desc'][$G_lang].
+'&nbsp;<img class="unbo" src="img/st_baby.png"></a><br>
+
+<!--
+<a href="#" 
+   onmouseover="menu_hide(0,2);"
+   title="" onclick="act_chatt(\'/st coniglio\'); menu_over(-1,this);">'
+          // MLANG
+          .$mlang_room['st_rabb_desc'][$G_lang].
+'&nbsp;<img class="unbo" src="img/st_rabbit.png"></a><br>
+-->
 </div>
 
 <a href="#" title="avvia un ticker pubblicitario per il tuo tavolo" 
index 689fce0..cbaf2fa 100644 (file)
@@ -278,7 +278,9 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
        $new_subst = $user->subst;
        $new_step =  $user->step;
       } while (0);
-      
+
+      log_mop($user->step, 'index_rd.php: after ret set');
+
       if ($user->the_end == TRUE) {
        log_rd2("LOGOUT BYE BYE!!");
        log_auth($user->sess, "Explicit logout.");
@@ -317,9 +319,7 @@ function maincheck($sess, $cur_stat, $cur_subst, $cur_step, &$new_stat, &$new_su
    step
 */
 
-$is_page_streaming =  ((stristr($HTTP_USER_AGENT, "linux") && 
-                       (stristr($HTTP_USER_AGENT, "firefox") || stristr($HTTP_USER_AGENT, "iceweasel"))) ? FALSE : TRUE);
-
+$is_page_streaming =  (stristr($HTTP_USER_AGENT, "MSIE") || stristr($HTTP_USER_AGENT, "CHROME") ? TRUE : FALSE);
 
 header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
@@ -341,6 +341,7 @@ $old_step =  $ext_step = $step;
 
 for ($i = 0 ; time() < $endtime ; $i++) {
   // log_rd("PRE MAIN ".$step);;
+  $pre_main = gettimeofday(TRUE);
   if (($ret = maincheck($sess, $old_stat, $old_subst, $old_step, &$stat, &$subst, &$step)) != FALSE) {
     echo '@BEGIN@';
     // log_rd2(sprintf("\nSESS: [%s]\nOLD_STAT: [%s] OLD_SUBST: [%s] OLD_STEP: [%s] \nSTAT: [%s] SUBST: [%s] STEP: [%s] \nCOMM: [%s]\n", $sess, $old_stat, $old_subst, $old_step, $stat, $subst, $step, $ret));
@@ -348,6 +349,7 @@ for ($i = 0 ; time() < $endtime ; $i++) {
     echo ' @END@'; 
     log_send("IS_PAGE: ".($is_page_streaming == TRUE ? "TRUE" : "FALSE")."EXT_STEP: ".$ext_step." ENDTIME: [".$endtime."] ".$ret);
     flush();
+    log_mop(0, 'index_rd.php: after flush (begin: '.sprintf("%f", $pre_main).')');
     if ($is_page_streaming)
       break;
   }
@@ -356,7 +358,7 @@ for ($i = 0 ; time() < $endtime ; $i++) {
   $old_step =  $step;
   // log_rd("POST MAIN ".$step);;
   usleep(400000);
-  if (($i % 5) == 0) {
+  if (($i % 10) == 0) {
     // log_rd2("TIME: ".time());
     echo '_';
     flush();
index f48bc00..f3eec69 100644 (file)
@@ -98,6 +98,7 @@ if (array_search($_SERVER['REMOTE_ADDR'], $G_black_list) !== FALSE) {
 
 $is_spawn = FALSE;
 
+log_mop(0, 'index_wr.php: COMM: '.xcapemesg($mesg));
 log_wr('COMM: '.xcapemesg($mesg));
 
 $sem = Room::lock_data();
@@ -180,6 +181,8 @@ $argz = explode('|', xcapemesg($mesg));
 
 log_wr('POSTSPLIT: '.$argz[0]);
 
+log_mop($user->step, 'index_wr.php: after get_user()');
+
 if ($argz[0] == 'shutdown') {
   log_auth($user->sess, "Shutdown session.");
 
@@ -668,6 +671,7 @@ else if ($user->stat == 'room') {
 }
 log_wr("before save data");
 Room::save_data($room);
+log_mop($user->step, 'index_wr.php: after save_data()');
 
 Room::unlock_data($sem);
 exit;
index 46f8612..75dfbeb 100644 (file)
@@ -33,9 +33,10 @@ var l_list_isol = 0x02;
 
 function state_add(flags)
 {
-    var content = "";
-    var st, name = "";
-    var tit = "";
+    var content = "", supercont = "";
+    var st, superst, name = "", supername = "", supersfx = "";
+    var tit = "", supertit = "";
+
 
     if ((flags & 0xf00) != 0) {
         st = flags & 0xf00;
@@ -73,12 +74,43 @@ function state_add(flags)
             name = "st_rabbit.png";
             tit = (g_lang == 'en' ? "Rabbit time" : "sono a spasso col coniglio");
             break;
+        case 0x900:
+            name = "st_soccer.png";
+            tit = (g_lang == 'en' ? "Soccer time" : "c'è la partita!!");
+            break;
+        case 0xa00:
+            name = "st_baby.png";
+            tit = (g_lang == 'en' ? "Children time" : "ho il pupo da accudire");
+            break;
+        case 0xb00:
+            name = "st_mop.png";
+            tit = (g_lang == 'en' ? "Mop time" : "sto rassettando");
+            break;
         default:
             break;
         }
+    }
+
+    if ((flags & 0xf0000) != 0) {
+        superst = flags & 0xf0000;
         if (name != "") {
-            content += '&nbsp;<img title="'+tit+'" class="unbo" src="img/'+name+'">';
+            supersfx = "_side";                
         }
+
+        switch (superst) {
+        case 0x20000:
+            supername = "superuser"+supersfx+".png";
+            supertit = (g_lang == 'en' ? "Brisk Supporter" : "Brisk Supporter");
+            break;
+        }
+    }
+
+    if (supername != "") {
+        content += '&nbsp;<img title="'+supertit+'" class="inline" src="img/'+supername+'">';
+    }
+    
+    if (name != "") {
+        content += '&nbsp;<img title="'+tit+'" class="inline" src="img/'+name+'">';
     }
 
     return content;