From 5772fe335990b61f170d2e7365bb5ab58ba57fef Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Thu, 5 Jun 2014 07:16:16 +0200 Subject: [PATCH] add number of certified-only tables and small refactoring of INSTALL script --- INSTALL.sh | 30 +++++++++++++++--------------- web/Obj/brisk.phh | 3 ++- web/index.php | 2 ++ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/INSTALL.sh b/INSTALL.sh index 5865661..3c25449 100755 --- a/INSTALL.sh +++ b/INSTALL.sh @@ -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 ] [-A ] [-a ] [-f ] [-p ] [-U ] [-u ] [-d ] [-w ] [-k ] [-l ] [-y ] [-P ] [-x]" + echo "$1 [-W] [-n 3|5] [-c 3|8] [-t <(n>=4)>] [-T ] [-G ] [-A ] [-a ] [-f ] [-p ] [-U ] [-u ] [-d ] [-w ] [-k ] [-l ] [-y ] [-P ] [-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 diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index a00f700..5c85dfb 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -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))); diff --git a/web/index.php b/web/index.php index 6ee1d74..648666d 100644 --- a/web/index.php +++ b/web/index.php @@ -888,6 +888,7 @@ supported by:
var g_lng = ""; var g_tables_n = ; var g_tables_auth_n = ; + var g_tables_cert_n = ; var g_prefs, g_prefs_new = null; var g_listen; var g_withflash = false; @@ -1046,6 +1047,7 @@ echo "$body"; ?> var g_lng = ""; var g_tables_n = ; var g_tables_auth_n = ; + var g_tables_cert_n = ; var g_prefs, g_prefs_new = null; var g_listen; var g_is_spawn = 0; -- 2.17.1