Merge branch 'ipclass-ban' into certified_ipclass-ban
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Mon, 14 Jul 2014 16:29:31 +0000 (18:29 +0200)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Mon, 14 Jul 2014 16:29:31 +0000 (18:29 +0200)
INSTALL.sh
web/Obj/brisk.phh
web/index.php

index 5865661..3c25449 100755 (executable)
@@ -10,6 +10,7 @@ card_hand=3
 players_n=3
 tables_n=44
 tables_auth_n=12
+tables_cert_n=4
 brisk_auth_conf="brisk_spu_auth.conf.pho"
 brisk_debug="0x0400"
 # brisk_debug="0xffff"
@@ -30,7 +31,7 @@ function usage () {
     echo "$1 -h"
     echo "$1 chk                          - run lintian on all ph* files."
     echo "$1 pkg                          - build brisk packages."
-    echo "$1 [-W] [-n 3|5] [-c 3|8] [-t <(n>=4)>] [-T <auth_tab>] [-A <apache-conf>] [-a <auth_file_name>] [-f <conffile>] [-p <outconf>] [-U <usock_path>] [-u <sys_user>] [-d <TRUE|FALSE>] [-w <web_dir>] [-k <ftok_dir>] [-l <legal_path>] [-y <proxy_path>] [-P <prefix_path>] [-x]"
+    echo "$1 [-W] [-n 3|5] [-c 3|8] [-t <(n>=4)>] [-T <auth_tab>] [-G <cert_tab>] [-A <apache-conf>] [-a <auth_file_name>] [-f <conffile>] [-p <outconf>] [-U <usock_path>] [-u <sys_user>] [-d <TRUE|FALSE>] [-w <web_dir>] [-k <ftok_dir>] [-l <legal_path>] [-y <proxy_path>] [-P <prefix_path>] [-x]"
     echo "  -h this help"
     echo "  -f use this config file"
     echo "  -p save preferences in the file"
@@ -40,6 +41,7 @@ function usage () {
     echo "  -n number of players            - def. $players_n"
     echo "  -t number of tables             - def. $tables_n"
     echo "  -T number of auth-only tables   - def. $tables_auth_n"
+    echo "  -G number of cert-only tables   - def. $tables_cert_n"
     echo "  -a authorization file name      - def. \"$brisk_auth_conf\""
     echo "  -d activate dabug               - def. $brisk_debug"
     echo "  -w dir where place the web tree - def. \"$web_path\""
@@ -150,6 +152,7 @@ while [ $# -gt 0 ]; do
         -n*) players_n="$(get_param "-n" "$1" "$2")"; sh=$?;;
         -t*) tables_n="$(get_param "-t" "$1" "$2")"; sh=$?;;
         -T*) tables_auth_n="$(get_param "-T" "$1" "$2")"; sh=$?;;
+        -G*) tables_cert_n="$(get_param "-G" "$1" "$2")"; sh=$?;;
         -a*) brisk_auth_conf="$(get_param "-a" "$1" "$2")"; sh=$?;;
         -d*) brisk_debug="$(get_param "-d" "$1" "$2")"; sh=$?;;
         -w*) web_path="$(get_param "-w" "$1" "$2")"; sh=$?;;
@@ -185,6 +188,7 @@ echo "    card_hand:   $card_hand"
 echo "    players_n:   $players_n"
 echo "    tables_n:    $tables_n"
 echo "    tables_auth_n: $tables_auth_n"
+echo "    tables_cert_n: $tables_cert_n"
 echo "    brisk_auth_conf: \"$brisk_auth_conf\""
 echo "    brisk_debug:\"$brisk_debug\""
 echo "    web_path:   \"$web_path\""
@@ -208,6 +212,7 @@ if [ ! -z "$outconf" ]; then
     echo "players_n=$players_n"
     echo "tables_n=$tables_n"
     echo "tables_auth_n=$tables_auth_n"
+    echo "tables_cert_n=$tables_cert_n"
     echo "brisk_auth_conf=\"$brisk_auth_conf\""
     echo "brisk_debug=\"$brisk_debug\""
     echo "web_path=\"$web_path\""
@@ -374,23 +379,18 @@ sed -i "s/define *( *'BIN5_PLAYERS_N', *[0-9]\+ *)/define('BIN5_PLAYERS_N', $pla
 
 sed -i "s@define *( *'FTOK_PATH',[^)]*)@define('FTOK_PATH', \"$ftok_path\")@g" $(find ${web_path}__ -type f -name '*.ph*' -exec grep -l "define *( *'FTOK_PATH',[^)]*)" {} \;)
 
-sed -i "s@define *( *'SITE_PREFIX',[^)]*)@define('SITE_PREFIX', \"$prefix_path\")@g" ${web_path}__/Obj/sac-a-push.phh
-
-sed -i "s@define *( *'SITE_PREFIX_LEN',[^)]*)@define('SITE_PREFIX_LEN', $prefix_path_len)@g" ${web_path}__/Obj/sac-a-push.phh
+sed -i "s@define *( *'SITE_PREFIX',[^)]*)@define('SITE_PREFIX', \"$prefix_path\")@g;
+s@define *( *'SITE_PREFIX_LEN',[^)]*)@define('SITE_PREFIX_LEN', $prefix_path_len)@g" ${web_path}__/Obj/sac-a-push.phh
 
 sed -i "s@define *( *'USOCK_PATH',[^)]*)@define('USOCK_PATH', \"$usock_path\")@g" ${web_path}__/spush/brisk-spush.phh
 
-sed -i "s@define *( *'TABLES_N',[^)]*)@define('TABLES_N', $tables_n)@g" ${web_path}__/Obj/brisk.phh
-
-sed -i "s@define *( *'TABLES_AUTH_N',[^)]*)@define('TABLES_AUTH_N', $tables_auth_n)@g" ${web_path}__/Obj/brisk.phh
-
-sed -i "s@define *( *'BRISK_DEBUG',[^)]*)@define('BRISK_DEBUG', $brisk_debug)@g" ${web_path}__/Obj/brisk.phh
-
-sed -i "s@define *( *'LEGAL_PATH',[^)]*)@define('LEGAL_PATH', \"$legal_path\")@g" ${web_path}__/Obj/brisk.phh
-
-sed -i "s@define *( *'PROXY_PATH',[^)]*)@define('PROXY_PATH', \"$proxy_path\")@g" ${web_path}__/Obj/brisk.phh
-
-sed -i "s@define *( *'BRISK_CONF',[^)]*)@define('BRISK_CONF', \"$brisk_conf\")@g" ${web_path}__/Obj/brisk.phh
+sed -i "s@define *( *'TABLES_N',[^)]*)@define('TABLES_N', $tables_n)@g;
+s@define *( *'TABLES_AUTH_N',[^)]*)@define('TABLES_AUTH_N', $tables_auth_n)@g;
+s@define *( *'TABLES_CERT_N',[^)]*)@define('TABLES_CERT_N', $tables_cert_n)@g;
+s@define *( *'BRISK_DEBUG',[^)]*)@define('BRISK_DEBUG', $brisk_debug)@g;
+s@define *( *'LEGAL_PATH',[^)]*)@define('LEGAL_PATH', \"$legal_path\")@g;
+s@define *( *'PROXY_PATH',[^)]*)@define('PROXY_PATH', \"$proxy_path\")@g;
+s@define *( *'BRISK_CONF',[^)]*)@define('BRISK_CONF', \"$brisk_conf\")@g;" ${web_path}__/Obj/brisk.phh
 
 sed -i "s@define *( *'BRISK_AUTH_CONF',[^)]*)@define('BRISK_AUTH_CONF', \"$brisk_auth_conf\")@g" ${web_path}__/Obj/auth.phh
 
index c579ddc..711e16b 100644 (file)
@@ -28,7 +28,8 @@ define('FTOK_PATH', "/var/lib/brisk");
 define('LEGAL_PATH', "/tmp/legal_brisk");
 define('PROXY_PATH', "/var/lib/brisk_proxy");
 define('TABLES_N', 36);
-define('TABLES_AUTH_N', 4);
+define('TABLES_AUTH_N', 8);
+define('TABLES_CERT_N', 4);
 define('PLAYERS_N', 3);
 define('MAX_POINTS', 5);
 define('MAX_PLAYERS', (20 + (PLAYERS_N * TABLES_N)));
@@ -777,11 +778,6 @@ class Table {
     }
   }
 
-
-
-  //      $ret .= table_act_content(($user->subst == 'standup'), $this->table[$i]->player_n, $i, $user->table, 
-  //                              ($this->table[$i]->auth_only == FALSE ? TRUE : $user->flags & USER_FLAG_AUTH));
-
   // function act_content($isstanding, $sitted, $table, $cur_table, $allowed)
   function act_content($user)
   {
@@ -1364,8 +1360,7 @@ class Brisk
     for ($i = 0 ; $i < TABLES_N ; $i++) {
 
       $ret .= $this->table_content($user, $i);
-      // $ret .= table_act_content(($user->subst == 'standup'), $this->table[$i]->player_n, $i, $user->table, 
-      //                          ($this->table[$i]->auth_only == FALSE ? TRUE : $user->flags & USER_FLAG_AUTH));
+
       $ret .=  $this->table[$i]->act_content($user);
       if ($this->table[$i]->wag_own != -1) 
         $ret .= sprintf('tra.add(%d, "%s: %s"); ', $i,  $this->user[$this->table[$i]->wag_own]->name, $this->table[$i]->wag_com);
@@ -1453,15 +1448,11 @@ class Brisk
          // clean the action buttons in other tables
          for ($e = 0 ; $e < TABLES_N ; $e++) {
            if ($this->table[$e]->player_n < PLAYERS_N) {
-             // $ret .= table_act_content(TRUE, 0, $e, $user->table, 
-              //                           ($this->table[$e]->auth_only == FALSE ? TRUE : $user->flags & USER_FLAG_AUTH));
               $ret .= $this->table[$e]->act_content($user);
             }
          }
        }
        else {
-         // $ret .= table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table,
-          //                           ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
           $ret .= $table->act_content($user_cur);
        }
       }
@@ -1536,8 +1527,6 @@ class Brisk
        $ret .= $this->table_content($user_cur, $table_idx);
        $ret .= $this->standup_content($user_cur);
        
-       // $ret .= table_act_content(FALSE, 0, $table_idx, $user_cur->table,
-        //                           ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
         $ret .= $table->act_content($user_cur);
 
 
@@ -1565,8 +1554,7 @@ class Brisk
        log_main("JOIN_WAKEUP wup_idx ".$wup_idx."  wup_n ".$user_wup_n);
 
        log_main("JOIN_WAKEUP more");
-       // $ret .= table_act_content(($user_cur->subst == 'standup'), $table->player_n, $table_idx, $user_cur->table,
-        //                           ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
+
         $ret .= $table->act_content($user_cur);
 
        log_main("JOIN_WAKEUP end more");
@@ -1709,8 +1697,7 @@ class Brisk
           }
           else if ($table_idx > -1) {
               if ($table->player_n == PLAYERS_N) {
-                  // $ret .= table_act_content(($user_cur->subst == 'standup'), PLAYERS_N, $table_idx, $user_cur->table,
-                  ///                      ($table->auth_only == FALSE ? TRUE : $user_cur->flags & USER_FLAG_AUTH));
+
                   $ret .= $table->act_content($user_cur);
               }
           }
index feaa28e..11694ca 100644 (file)
@@ -382,7 +382,7 @@ function index_main(&$brisk, $transp_type, &$header_out, $remote_addr_full, $get
       $tables .= '<table class="room_tab">';
       for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
           if ($user->flags & USER_FLAG_AUTH)
-        $i = $ii;
+              $i = $ii;
           else
               $i = TABLES_N - $ii - 1;
 
@@ -897,6 +897,7 @@ supported by:<br>
    var g_lng = "<? echo $G_lng; ?>";
    var g_tables_n = <? echo TABLES_N; ?>;
    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
+   var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
    var g_prefs, g_prefs_new = null;
    var g_listen;
    var g_withflash = false;
@@ -1055,6 +1056,7 @@ echo "$body"; ?>
    var g_lng = "<? echo $G_lng; ?>";
    var g_tables_n = <? echo TABLES_N; ?>;
    var g_tables_auth_n = <? echo TABLES_AUTH_N; ?>;
+   var g_tables_cert_n = <? echo TABLES_CERT_N; ?>;
    var g_prefs, g_prefs_new = null;
    var g_listen;
    var g_is_spawn = 0;