4 PATH
=$PATH:$basedir/build
/bin
15 if [ ! -d $basedir/build
]
20 if [ ! -f $basedir/.setup
]; then
21 if [[ $
(lsb_release
-a) =~ .
*Ubuntu.
* ]] ||
[ -f "/etc/debian_version" ]
23 read -p "!!!ONLY RUN ONCE!!! Do you want to install dependencies (y/n)?" response
24 response
=${response,,} # tolower
25 if [[ $response =~ ^
(yes|y|
) ]]; then
26 $basedir/utils
/init
/ubuntu.sh
27 source /etc
/profile.d
/java.sh
28 source /etc
/profile.d
/oracle.sh
29 $basedir/utils
/init
/buildCurl.sh
32 echo "Please login and out or reboot as changes have been made to your PATH "
37 read -p "Do you want to build the server now? (y/n) " response
38 response
=${response,,} # tolower
39 if [[ $response =~ ^
(yes|y|
) ]]; then
42 cmake
$basedir/src
-DCMAKE_BUILD_TYPE=Release
49 read -p "Do you want to build the config environment now? (y/n) " response
50 response
=${response,,} # tolower
51 if [[ $response =~ ^
(yes|y|
) ]]; then
53 # Prompt for configuration environment.
54 read -p "Configure environment (local, live, tc, design)? You probably want local. " config_env
56 # Make sure the configuration environment exists.
57 if [ ! -d $basedir/configs
/$config_env ]; then
58 echo "Invalid configuration environment."
63 echo "Enter your IP address (LAN for port forwarding or internal, outside IP for DMZ)"
66 echo "Enter the DSN for the database connection "
69 echo "Enter the database username "
72 echo "Enter the database password "
75 echo "Enter a name for the galaxy cluster "
78 if [ -d $basedir/exe
]; then
82 mkdir
-p $basedir/exe
/linux
/logs
83 mkdir
-p $basedir/exe
/shared
85 ln -s $basedir/build
/bin
$basedir/exe
/linux
/bin
87 cp -u $basedir/configs
/$config_env/linux
/* $basedir/exe
/linux
88 cp -u $basedir/configs
/$config_env/shared
/* $basedir/exe
/shared
90 for filename
in $
(find $basedir/exe
-name '*.cfg'); do
91 sed -i -e "s@DBSERVICE@$DBSERVICE@g" -e "s@DBUSERNAME@$DBUSERNAME@g" -e "s@DBPASSWORD@$DBPASSWORD@g" -e "s@CLUSTERNAME@$CLUSTERNAME@g" -e "s@HOSTIP@$HOSTIP@g" $filename
95 # Generate other config files if their template exists.
98 # Generate at least 1 node that is the /etc/hosts IP.
99 $basedir/utils
/build_node_list.sh
102 read -p "Do you want to build the scripts? (y/n) " response
103 response
=${response,,} # tolower
104 if [[ $response =~ ^
(yes|y|
) ]]; then
105 #prepare environment to run data file builders
107 PATH
=$basedir/build
/bin
:$PATH
109 read -p "Do you wanna use multicore scripts or the safe option? (multi/safe) " response
110 response
=${response,,}
111 if [[ $response =~ ^
(multi|m|
) ]]; then
112 $basedir/utils
/mocha
/prepare_all_scripts_multi.sh
$basedir/dsrc
/sku
.0/sys.server
/compiled
/game
/script
113 $basedir/utils
/build_java_multi.sh
114 $basedir/utils
/build_miff.sh
115 $basedir/utils
/build_tab_multi.sh
116 $basedir/utils
/build_tpf_multi.sh
118 $basedir/utils
/mocha
/prepare_all_scripts.sh
$basedir/dsrc
/sku
.0/sys.server
/compiled
/game
/script
119 $basedir/utils
/build_java.sh
120 $basedir/utils
/build_miff.sh
121 $basedir/utils
/build_tab.sh
122 $basedir/utils
/build_tpf.sh
125 $basedir/utils
/build_object_template_crc_string_tables.py
126 $basedir/utils
/build_quest_crc_string_tables.py
131 read -p "Import database? (y/n) " response
132 response
=${response,,}
133 if [[ $response =~ ^
(yes|y|
) ]]; then
134 cd $basedir/src
/game
/server
/database
/build
/linux
136 if [[ -z "$DBSERVICE" ]]; then
137 echo "Enter the DSN for the database connection "
141 if [[ -z "$DBUSERNAME" ]]; then
142 echo "Enter the database username "
146 if [[ -z "$DBPASSWORD" ]]; then
147 echo "Enter the database password "
151 .
/database_update.pl
--username=$DBUSERNAME --password=$DBPASSWORD --service=$DBSERVICE --goldusername=$DBUSERNAME --loginusername=$DBUSERNAME --createnewcluster --packages
153 echo "Loading template list"
154 perl ..
/..
/templates
/processTemplateList.pl
< ..
/..
/..
/..
/..
/..
/dsrc
/sku
.0/sys.server
/built
/game
/misc
/object_template_crc_string_table.tab
> $basedir/build
/templates.sql
155 sqlplus
${DBUSERNAME}/${DBPASSWORD}@${DBSERVICE} @
$basedir/build
/templates.sql
> $basedir/build
/templates.out
158 echo "Build complete!"