Squashed commit of the following:

commit b499feffaca921d7303b0e9d41c5a95f4d37cc92
Merge: cd4eadc 07174ee
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Apr 19 08:15:37 2019 -0700

    Merge branch 'master' into ant_build

    # Conflicts:
    #	build_linux.sh

commit cd4eadc50a782241b393a55808b6c1c610109f47
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Apr 19 08:15:03 2019 -0700

    Updated submodules

commit 30033e17cf8d7e871414e9e83496c823af9f3a7f
Author: CekisSWG <cekisswg@gmail.com>
Date:   Mon Mar 18 23:30:43 2019 -0400

    updated dsrc submodule version

commit 3c938006373d128fc6d354a65740c9a841cde685
Author: CekisSWG <cekisswg@gmail.com>
Date:   Sat Mar 16 20:55:24 2019 -0400

    Fixed some unneeded Java 11 changes

commit 8cecdea1f3a3e7df4892529cfcf292eceaaaa48f
Author: CekisSWG <cekisswg@gmail.com>
Date:   Sat Mar 16 20:18:52 2019 -0400

    Updated build.xml to not pull before compiling

commit 099e5572fb09667042d9b475d77717c06eb95d24
Merge: 64706b1 3dffac9
Author: CekisSWG <cekisswg@gmail.com>
Date:   Thu Mar 14 17:03:29 2019 -0400

    Merge branch 'ant_build' of github.com:SWG-Source/swg-main into ant_build

commit 64706b1180a45f8936d8ca3fa0077c5fe209e5ab
Author: CekisSWG <cekisswg@gmail.com>
Date:   Thu Mar 14 17:03:19 2019 -0400

    Updated Ant build to now checkout specific branches

commit 3dffac9e7aedee902768e0e2dcc7f0c4dc3c6731
Author: Cekis <Cekis@users.noreply.github.com>
Date:   Mon Mar 11 00:06:41 2019 -0700

    Update README.md

commit 8ae089e291b7dcfe60f3a940225aea47d6ba2c05
Author: Cekis <Cekis@users.noreply.github.com>
Date:   Mon Mar 11 00:05:50 2019 -0700

    Update README.md

commit f8820a00ec3db600460534b4e400d0689c2d26da
Author: CekisSWG <cekisswg@gmail.com>
Date:   Mon Mar 11 02:59:27 2019 -0400

    Modified build script to accomodate submodules

commit 99987dce77061cd45d7ae82a334917f472219c65
Author: CekisSWG <cekisswg@gmail.com>
Date:   Mon Mar 11 02:33:40 2019 -0400

    Added config repo

commit b28e57b4ba07a5ea63973b04e7143f50cf099d59
Author: CekisSWG <cekisswg@gmail.com>
Date:   Sun Mar 10 15:23:25 2019 -0400

    Updated per new submodule usage.

commit 169d6c3f71ddee74ae2b07d5faa5407b0d32c8bf
Author: CekisSWG <cekisswg@gmail.com>
Date:   Sun Mar 10 14:55:55 2019 -0400

    Adding submodules to swg-main repo for easier usage.

commit fd865d971d9004b9b80c8b03a8483dccd926b249
Merge: c604a07 a8b9067
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Sun Mar 10 12:03:28 2019 -0500

    Merge remote-tracking branch 'origin/master' into ant_build

commit c604a07b51ea27bd3513c938f2f486bda6e89f48
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Sun Mar 10 11:51:21 2019 -0500

    Update gitignore

commit e0c2b752ecbcac05ccc6c615a7a09ff75d5a0dce
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Sun Mar 10 11:48:26 2019 -0500

    Remove stationapi/ from swg-main. It's getting its own repo.

commit d6b5d90a2cd5b9a8ea3ec41298fbf92c706f70bc
Author: SWG <swg@swg.swg>
Date:   Wed Mar 6 23:59:17 2019 -0500

    Added moving chat binaries to base dir for build chat target

commit 6679836f0157926dfffd3feebcf17061797a3aab
Author: SWG <swg@swg.swg>
Date:   Wed Mar 6 23:49:08 2019 -0500

    Fixed issue where more than one cluster of the same name could be added to the system.

commit cb8ab05d7e64e0c89705d09f3bbbf1a3ddc22a7c
Author: SWG <swg@swg.swg>
Date:   Wed Mar 6 17:06:47 2019 -0500

    fixed merge issues

commit d15dde6ae5b9a997532be2b9548d482068e42c18
Merge: 33fac3c 5f452c7
Author: SWG <swg@swg.swg>
Date:   Wed Mar 6 17:00:41 2019 -0500

    Added initial compile chat server target

commit 33fac3cafb01b353aadbcfb13fd3353e81697581
Author: SWG <swg@swg.swg>
Date:   Wed Mar 6 16:59:48 2019 -0500

    Added initial compile chat server target

commit 5f452c7817a59c4b6d6a221da4e8fe85e9b50ff6
Author: Cekis <Cekis@users.noreply.github.com>
Date:   Sat Mar 2 21:25:03 2019 -0800

    fixed service_name bug

commit 27e6c912f83eb94c30273c3c7baad611c140f734
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Thu Feb 21 16:25:03 2019 -0600

    Set default to something harmless

commit d5f3b42dd204c7cd13c890c35c232012143222d2
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Thu Feb 21 13:31:40 2019 -0600

    Instruct users to make their own local.properties if they want to

commit 915ff5adecdcf60aa0f703eb5f8695013ef09509
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Thu Feb 21 13:29:01 2019 -0600

    Remove sample local.properties... bummer

commit 68d224850b430f8c8c216d2b7cfa35c7fe749180
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Thu Feb 21 12:55:10 2019 -0600

    typos... /facepalm

commit eb9f6c92cddc38da0ead50c072742461f95cfd7e
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Thu Feb 21 12:47:45 2019 -0600

    gitignore local.properties so that settings users change don't mess with future git pulls

commit 70b336ee148afb659729fcba4312b9032a2207a3
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Thu Feb 21 12:45:33 2019 -0600

    Add local.properties so users can change things if they want to

commit 09bc9094c416db0f8bcaa8f20b905ee403657a4f
Author: Tekaoh <45337851+Tekaoh@users.noreply.github.com>
Date:   Thu Feb 21 09:09:38 2019 -0600

    Delete depreciated update script

commit bf979ebdc28887a2a5632b0d39f8c6d186a6ac77
Author: SWG <swg@swg.swg>
Date:   Wed Feb 13 01:35:31 2019 -0500

    Fixed bug caused by bad reference

commit 550ba4660fe4ed7855f0bbe91545be6edd02c654
Author: SWG <swg@swg.swg>
Date:   Tue Feb 12 18:54:45 2019 -0500

    Added targets to configure settings

commit 26f352ed32a374e2135dd86513933027eeffcc16
Author: SWG <swg@swg.swg>
Date:   Tue Feb 12 12:32:48 2019 -0500

    Fixed bugs with ant script

commit 569b62783a2c58b217ea1ba549fe30283923328e
Author: Cekis <cekisswg@gmail.com>
Date:   Fri Feb 8 14:13:42 2019 -0500

    Updated build.xml to handle compiler better and set default to GCC and Release mode

commit d66964b27776ee22147b2b10a5d7e5c6b8eab65d
Author: Cekis <cekisswg@gmail.com>
Date:   Sun Jan 27 19:29:20 2019 -0500

    Added force kill for SwgGameServer processes

commit 2233d2dea70b1dfda11dbb0b123d37766df5e6eb
Merge: d322a0e a7cddbd
Author: Cekis <cekisswg@gmail.com>
Date:   Sun Jan 27 19:08:43 2019 -0500

    Merge branch 'master' of https://github.com/SWG-Source/swg-main into ant_build

commit d322a0eb93ea70726ae089a23db69c3ea6a92a02
Author: Cekis <Cekis@users.noreply.github.com>
Date:   Sat Jan 19 10:36:54 2019 -0800

    Update README.md

commit af69d76ffff17fc4f4886a4caffb394ce7fa2841
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Dec 28 16:44:47 2018 -0800

    Updated changes to SQLPlus targets

commit 3b0bf10c0dff0ac9de2e66ee5a8789a467ab505e
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Dec 28 21:38:19 2018 +0000

    Adjusted for missing LD_LIBRARY_PATH var - oops

commit 2a25db52d959b0430fc6b62ceba7b8bb8059ea5b
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Dec 28 21:31:20 2018 +0000

    Adjusted for missing LD_LIBRARY_PATH var

commit 210397baca401a5ba724f4e945c8efdf15a120e6
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Dec 28 20:34:21 2018 +0000

    added an echo to indicate which compiler is being used.

commit ed6d4687c9f30f58ebde9b1af5823e124628f796
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Dec 28 20:31:52 2018 +0000

    Added configuration to easily choose gcc or clang compilers

commit ce657b4320
Author: CekisSWG <cekisswg@gmail.com>
Date:   Fri Dec 28 02:36:09 2018 +0000

    Added new ANT build files

commit d66e44c6b9
Author: CekisSWG <cekisswg@gmail.com>
Date:   Thu Dec 27 19:00:41 2018 +0000

    Updated build script to now use ANT for building.
This commit is contained in:
CekisSWG
2019-04-19 08:20:38 -07:00
parent 07174ee771
commit 0c26a6111c
15 changed files with 778 additions and 963 deletions

7
.gitignore vendored
View File

@@ -1,11 +1,8 @@
build/
chat/
clientdata/
configs/
data/
dependencies/
dsrc/
exe/
src/
stationapi/
miff/
.setup
local.properties

17
.gitmodules vendored Normal file
View File

@@ -0,0 +1,17 @@
[submodule "stationapi"]
path = stationapi
url = https://github.com/SWG-Source/stationapi.git
[submodule "dsrc"]
path = dsrc
url = https://github.com/SWG-Source/dsrc.git
[submodule "src"]
path = src
url = https://github.com/SWG-Source/src.git
[submodule "clientdata"]
path = clientdata
url = https://github.com/SWG-Source/clientdata.git
[submodule "exe"]
path = exe
url = https://github.com/SWG-Source/configs.git
ignore = dirty

145
README.md Normal file → Executable file
View File

@@ -1,7 +1,8 @@
# SWGSource V1.2 Build Instructions
# SWGSource V2.0 (version pending) Build Instructions
## Credit
Credit the StellaBellum team (DarthArgus, Cekis, SilentGuardian, Ness, SwgNoobs, DevCodex) for making their repositories open. All source is forked from those repositories and progressed from that point.
Credit the StellaBellum team (DarthArgus, Cekis, SilentGuardian, Ness, SwgNoobs, DevCodex) for making their repositories open. All source is forked from
those repositories and progressed from that point.
## What Do You Need To Do To Get A Server Running?
@@ -16,91 +17,37 @@ When the GIT repository has been cloned successfully, open the swg-main director
cd /home/swg/swg-main
Create a .setup file such that the build script knows where to start:
touch .setup
## Building
The process is nearly fully automated by executing the build_linux.sh script located in swg-main. The script will ask you a series of questions with each
question corresponding to a different step in the build process. Each step is defined below. To complete building, kick off the build script and follow
these instructions as detailed here to understand each step.
### Requirements
- Java 8 (1.8_u101)
- Apache ANT 1.9+
First and foremost, IF YOU DO NOT HAVE ANT INSTALLED ALREADY, you'll need to install Apache ANT (at least version 1.9) on your VM. ANT is required for the build process to run successfully. ANT
will be included in the next VM build, but for now here are the steps to do so manually:
1. Go to https://ant.apache.com/download and download the latest version of ANT (1.10.5 is latest as of this writing, but anything over 1.9.x should work fine).
2. Expand the ANT package (.zip or .tar) into your VM (or server) directories somewhere. Take note of the location where you expanded it.
3. Edit your .profile and add a line that sets the location where you expanded it as ANT_HOME.
4. While you're editing your profile, make sure that JAVA_HOME is set to the right spot too. You can figure out where Java is installed by using the
"which" command: ```which java```
5. Save your .profile edits and test out that ANT_HOME is installed properly by typing in "ant" at any location on your command line. You should get a
non-standard error message about how build.xml is missing. If JAVA_HOME isn't set correctly, you'll get an error about that too.
### Starting the Build Process
Follow the instructions of the build script. The binary building phase will take roughly 1 hour for each CPU core assigned to your VM. Do not skip any steps.
Execute the following script to start building (see detail on each step below this):
To complete building, kick off the build script from your swg-main directory by typing in: ```ant swg```
./build_linux.sh
The build process is fully configured in the build.properties file. There is no need to touch this file unless you have a fully customized version that you
would like to run. For starters, just don't worry about touching it.
#### Cloning the Repositories
The script will first ask if you would like to retrieve any GIT folders necessary (it knows which ones it needs to get). It will attempt to get the pre-configured
repositories that are outlined in the build script by cloning them. It will simply do a pull if the repositories already exist to bring them up to date.
This currently includes "src", "dsrc", and others:
You can also run sections of the build script manually (not recommended until you are used to the environment of which you're working in).
Do you want to pull/update git? (y/n)
#### ANT Usage
DID YOU KNOW?: You can specify multiple ANT targets with a single command as well (this goes for any of these targets you give it). ANT will execute them and make sure all
of their dependencies are met in the order you provide them:
If you answer "y" to the question, it will attempt to retrieve the latest version set of the code. If you hit enter or choose "n" it will skip to the next step.
### Compile Phase
After getting the latest version of the code, the build script will then attempt to build the server.
#### Compile Mode
The system first needs to know how you will be compiling the code. You have a choice of either DEBUG (d) mode or RELEASE (r) mode. If you do not enter "d" or "debug" for the mode then it is assumed you wish to build a RELEASE build. (release is recommended unless you have a specific reason to want debug.)
Is this for DEBUG mode or RELEASE mode? (d/r):
#### Compiling SRC
The first compile step is to build the server C++ code. This is the source found in the "src" folder. Once compiled, you should have compiled code in the "build" directory of swg-main:
Do you want to recompile the server code (C++) now? (y/n)
#### Building the Server Configuration Files
The next step will attempt to build the configuration files. This step captures data needed for the server to execute properly. The following information is captured in this step:
Do you want to build the config environment now? (y/n)
Enter your IP address (LAN for port forwarding or internal, outside IP for DMZ)
Enter the IP address of the host machine that will be the server. This is typically your VM IP Address.
Enter the DSN for the database connection
Enter the name of the database. This is typically just "//127.0.0.1/swg" without quotes. It uses the 127.0.0.1 localhost loopback instead of the VM IP on purpose.
Enter the database username
Enter the user name for the database connection. This is also typically just "swg" without quotes.
Enter the database password
Enter the password for the database connection. This is also typically just "swg" without quotes.
Enter a name for the galaxy cluster
This will be the cluster name of the galaxy. Use something creative (or not), this is the name of the galaxy you're going to choose when creating a new character. NOTE: Remember your cluster name because you will need it again in a later step.
#### Compiling DSRC
The next step will be to build the Java code that resides in the dsrc folder. This code is where 99% of the game content and AI resides. This step takes a long time so go watch a movie or something while it builds. Note: It will give you the option of using "multi" or "safe" building. Multi takes advantage of multi-threaded compiling (typically faster). However, it was found that using it SOMETIMES caused issues, but these issues are likely no around any longer. Needless to say, if you encounter issues using MULTI, try using Safe instead which does not use multi-threaded compiling:
Do you want to recompile the scripts (.java)? (y/n)
The Script will currently build the ENTIRE dsrc at this step. If you want to build just an individual part, please see `./build_dsrc.sh` information at the bottom of this readme.
#### Build your chat server
This step will (re)build the stationapi chat server.
Do you want to build stationapi chat server now? (y/n)
#### Importing the Database SQL
This step will attempt to create the database schema from the SQL files that are in the src directory structure. It will create all database tables, functions, views and stored procedures the game needs to use. You can run this step without fear of ruining anything that is currently in place. Keep in mind that if you do attempt to import the database over the top of an existing swg database, it will simply throw errors after a very short attempt, but will not cause issue with your current data. Basically, you can't mess this part up:
Import database? (y/n)
If you haven't previously entered the necessary database information above, it will ask you for that information here.
#### Clientdata symlink
The Clientdata Repo is in /home/swg/swg-main/clientdata. You MUST have this in place and have the symbolic link created before the server can execute successfully:
Do you want to create the symlink for the clientdata folder? (y/n)
```
ant git_src git_dsrc
```
#### Final configuration:
@@ -115,32 +62,44 @@ Point your login.cfg in your game folder (on your client machine, NOT the VM) to
AND YOU'RE DONE!
#MORE READING...
## build_dsrc.sh
You may want to build certain parts of the dsrc individually instead of all at once as done in build_linux.sh. Here is some information about the specific steps in build_dsrc.sh:
The following targets ARE NOT REQUIRED, but you may find yourself wanting to build certain parts of the dsrc individually instead of all at once as done in the
ANT build script. Here is some information about the specific targets in ANT build file:
#### Compiling the mIFF files
This step will compile all *.mif files into *.iff binary files.
The "compile_miff" target will compile all *.mif files into *.iff binary files.
Do you want to build the mIFF files (.mif)? (y/n)
```ant compile_miff```
#### Compiling the Datatable files
This step will compile all the *.tab files into *.iff binary files. Again, speed constraints aside, you have the choice of using MULTI or SAFE for compiling (see DSRC Compiling above):
The "compile_tab" target will compile all the *.tab files into *.iff binary files:
Do you want to build the datatables (.tab)? (y/n)
```ant compile_tab```
#### Compiling Template Files
This step will compile all the *.tpf files into *.iff binary files. You have a choice of Multi or Safe here as well:
The "compile_tpf" target will compile all the *.tpf files into *.iff binary files:
Do you want to build the template files (.tpf)? (y/n)
```ant compile_tpf```
If you have built the TPF files in this step (i.e. you didn't skip this step) then the build script will also attempt to recreate the Object Template and Quest CRC tables and subsequently will attempt to push those changes to the database since this will also be required. A GREAT feature to have when creating new template files or changing existing ones.
If you have built the TPF files in this step (i.e. you didn't skip this step) then the target will also attempt to recreate the Object Template and Quest CRC
tables and subsequently will attempt to push those changes to the database since this will also be required. A GREAT feature to have when creating new template files
or changing existing ones.
Again... if you wish to do a multiple of these things, you can string multiple targets together like so (not all 3 are required and they can be added in any order as
ANT handles any dependencies already):
```ant compile_miff compile_tab compile_tpf```
This particular command will first build the MIFF files, then compile the TAB files, then compile and load the Template Files into the database.
### Database Phase
#### Building Object Template and Quest CRC Files
This step will compile the object template and quest CRC files. These files translate the long name of these files (including file path) into a very short code that allows the server to identify them without the danger of long text being transferred over the internet in packets. Basically a optimization that SOE implemented:
This step will compile the object template and quest CRC files. These files translate the long name of these files (including file path) into a very short code that
allows the server to identify them without the danger of long text being transferred over the internet in packets. Basically an optimization that SOE implemented:
Do you want to build the Object Template or Quest CRC files? (y/n)
```ant load_templates```
Building these files will also trigger the build script to then populate the database with the CRC's that were generated. If you are doing this build script in pieces (i.e. you're selectively building), this is a GREAT way to re-import new or changed TPF file changes. In order to re-import CRC's into the database, if you haven't already entered it above, it will ask you for the database information here.
Building these files will also trigger the target to then populate the database with the CRC's that were generated. If you are doing this target in pieces
(i.e. you're selectively building), this is a GREAT way to re-import new or changed TPF file changes. In order to re-import CRC's into the database, if you haven't
already entered it above, it will ask you for the database information here.

29
build.properties Executable file
View File

@@ -0,0 +1,29 @@
### Note: Please don't change these for your local setup. You may get a merge conflict when updating if ever this file gets changed by a dev. Instead, make a local.properties file for your own settings. Thanks!
# General
# This handles if the database will be dropped or not. Turn this on if you want to drop the db and do a "ant drop_database" from the swg-main dir.
firstrun = false
# SWG Server Settings
cluster_name = swg
# max_characters_per_account is the number of characters that a single account may have, across all clusters
max_characters_per_account = 10
# max_characters_per_cluster is the number of characters that a single cluster may have
max_characters_per_cluster = 250
# character_slots is the number of characters that a single account may have on one cluster
character_slots = 10
# Database Settings
db_username = swg
db_password = swg
db_service = swg
# Git Settings
src_branch = master
dsrc_branch = master
clientdata_branch = master
configs_branch = master
# SRC Compilation
compiler = gcc
src_build_type = Release

478
build.xml Executable file
View File

@@ -0,0 +1,478 @@
<project name="SWGBuild" default="echoprops" basedir="/home/swg/swg-main" xmlns:if="ant:if" xmlns:unless="ant:unless">
<import file="git_targets.xml" />
<description>
This build file will build all aspects of the SWG Source Code. Created by Cekis (cekisswg@gmail.com).
</description>
<!-- Get our host info -->
<hostinfo/>
<!-- Property File -->
<property file="local.properties" />
<property file="build.properties" />
<!-- Global Properties -->
<property name="build" location="${basedir}/build"/>
<!-- Database Service Name is derived to make it easier in the properties file -->
<property name="service_name" value="//${ADDR4}/${db_service}"/>
<!-- Setup Source Directories -->
<property name="exe" location="${basedir}/exe"/>
<property name="src" location="${basedir}/src"/>
<property name="dsrc" location="dsrc" relative="true" basedir="${basedir}"/>
<property name="data" location="data" relative="true" basedir="${basedir}"/>
<property name="chat_home" location="${basedir}/stationapi"/>
<property name="chat_build" location="${chat_home}/build"/>
<property name="clientdata" location="${basedir}/clientdata"/>
<property name="configs" location="configs" relative="true" basedir="${basedir}"/>
<!-- Setup Key Game Directories -->
<property name="dsrc_server" location="${dsrc}/sku.0/sys.server/compiled/game"/>
<property name="dsrc_shared" location="${dsrc}/sku.0/sys.shared/compiled/game"/>
<property name="data_server" location="${data}/sku.0/sys.server/compiled/game"/>
<property name="data_shared" location="${data}/sku.0/sys.shared/compiled/game"/>
<property name="data_client" location="${data}/sku.0/sys.client/compiled"/>
<!-- Setup CRC Files to load into the database -->
<property name="object_crc_file" location="${dsrc}/sku.0/sys.server/built/game/misc/object_template_crc_string_table.tab"/>
<property name="templates_sql_file" location="${build}/templates.sql"/>
<!-- Define where most of our compiled tools will live -->
<property name="tools_home" location="${build}/bin"/>
<property name="bin_home" location="${exe}/linux/bin"/>
<property environment="env"/>
<!-- The init target handles the environment setup - not much to do but create directories -->
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${data_server}"/>
<mkdir dir="${data_shared}"/>
<mkdir dir="${data_client}"/>
</target>
<target name="echoprops">
<echoproperties/>
<echo>IP Address: ${ADDR4}</echo>
</target>
<target name="swg" description="builds the entire SWG codebase for the first run" depends="clean,git_update_submods,update_configs,create_database,compile">
</target>
<!-- Clean simply calls the other clean targets -->
<target name="clean" depends="clean_src,clean_dsrc,init">
</target>
<!-- Delete the SRC Build folder -->
<target name="clean_src">
<echo>Cleaning the SRC build directory.</echo>
<delete dir="${build}" verbose="false" failonerror="false"/>
</target>
<!-- Delete the DSRC Build folder -->
<target name="clean_dsrc">
<echo>Cleaning the DSRC directory.</echo>
<delete includeemptydirs="true" removeNotFollowedSymlinks="true" failonerror="false">
<fileset dir="${data}" includes="**/*" followsymlinks="false"/>
</delete>
</target>
<!-- Delete the DSRC Build folder -->
<target name="clean_java">
<echo>Cleaning the DSRC script directory.</echo>
<delete dir="${data_server}/script" verbose="false"/>
</target>
<!-- Gets the architecture we're on - uses old way of getting it from original build_linux.sh script -->
<target name="get_arch">
<exec executable="arch" dir="." outputproperty="arch"/>
<condition property="compile.x86">
<equals arg1="${arch}" arg2="x86_64"/>
</condition>
<echo>Architecture is ${arch}</echo>
<condition property="is_debug_build">
<equals arg1="${src_build_type}" arg2="Debug"/>
</condition>
<echo>Creating a ${src_build_type} build</echo>
<condition property="use_gcc">
<equals arg1="${compiler}" arg2="gcc"/>
</condition>
</target>
<target name="set_compiler" description="sets the compiler to use based on what is set in build.properties" depends="set_gcc,set_clang">
</target>
<target name="set_gcc" if="${use_gcc}">
<echo>Using the GCC compiler</echo>
<property name="cc_compiler" value="gcc"/>
<property name="cxx_compiler" value="g++"/>
</target>
<target name="set_clang" unless="${use_gcc}">
<echo>Using the CLang compiler</echo>
<property name="cc_compiler" value="clang"/>
<property name="cxx_compiler" value="clang++"/>
</target>
<!-- Gets the number of processors at our disposal -->
<target name="get_num_procs">
<exec executable="nproc" dir="." outputproperty="nproc"/>
<echo>We have ${nproc} processors (cores) to use.</echo>
</target>
<target name="git_update_submods" description="Pull down the sub-modules for swg-main">
<git-update-submods dir="${basedir}"/>
<git-checkout branch="${src_branch}" dir="${src}"/>
<git-checkout branch="${dsrc_branch}" dir="${dsrc}"/>
<git-checkout branch="${configs_branch}" dir="${basedir}/exe"/>
<git-checkout branch="${clientdata_branch}" dir="${clientdata}"/>
</target>
<target name="update_configs" description="updates the configuration files with the desired settings" if="firstrun">
<replace dir="${exe}" propertyFile="${basedir}/build.properties">
<include name="**/*.cfg"/>
<replacefilter token="CLUSTERNAME" property="cluster_name"/>
<replacefilter token="HOSTIP" value="${ADDR4}"/>
<replacefilter token="DBUSERNAME" property="db_username"/>
<replacefilter token="DBSERVICE" value="service_name"/>
<replacefilter token="DBPASSWORD" property="db_password"/>
</replace>
</target>
<!-- Creates the Make files for our SRC that will be used during compile stage (Intel) -->
<target name="prepare_src_x86" depends="init,get_arch,set_compiler" description="prepare server code - Intel" if="compile.x86">
<exec executable="cmake" dir="${build}" failonerror="true">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<env key="CC" value="${cc_compiler}" unless:true="${use_gcc}"/>
<env key="CXX" value="${cxx_compiler}" unless:true="${use_gcc}"/>
<env key="LDFLAGS" value="-L/usr/lib32"/>
<env key="CMAKE_PREFIX_PATH" value="/usr/lib32:/lib32:/usr/lib/i386-linux-gnu:/usr/include/i386-linux-gnu"/>
<arg value="-DCMAKE_C_FLAGS=-m32"/>
<arg value="-DCMAKE_CXX_FLAGS=-m32"/>
<arg value="-DCMAKE_EXE_LINKER_FLAGS=-m32"/>
<arg value="-DCMAKE_MODULE_LINKER_FLAGS=-m32"/>
<arg value="-DCMAKE_SHARED_LINKER_FLAGS=-m32"/>
<arg value="-DCMAKE_BUILD_TYPE=${src_build_type}"/>
<arg value="${src}"/>
</exec>
</target>
<!-- Creates the Make files for our SRC that will be used during compile stage (Non-Intel) -->
<target name="prepare_src" depends="init,get_arch,set_compiler" description="compile server code - non Intel" unless="compile.x86">
<exec executable="cmake" dir="${build}" failonerror="true">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<env key="CC" value="${cc_compiler}" unless:true="${use_gcc}"/>
<env key="CXX" value="${cxx_compiler}" unless:true="${use_gcc}"/>
<arg value="-DCMAKE_BUILD_TYPE=${src_build_type}"/>
<arg value="${src}"/>
</exec>
</target>
<target name="strip_src" unless="${is_debug_build}" description="removes debugging information from release builds, making them smaller">
<exec executable="strip" dir="${build}">
<arg value="-d"/>
<arg value="bin/*"/>
</exec>
</target>
<!-- Compiles the SRC (C++) code -->
<target name="compile_src" description="compile server code" depends="init,prepare_src,prepare_src_x86,get_num_procs,strip_src">
<exec executable="make" dir="${build}" failonerror="true">
<env key="CC" value="${cc_compiler}"/>
<env key="CXX" value="${cxx_compiler}"/>
<arg value="-j${nproc}"/>
</exec>
</target>
<!-- Prepares the Station API (chat server) code for building -->
<target name="prepare_chat" description="prepares the chat server structure for building">
<copy todir="${chat_home}/externals/udplibrary">
<fileset dir="${chat_home}/udplibrary"/>
</copy>
</target>
<!-- Compiles the Station API (chat server) code -->
<target name="compile_chat" description="compile chat server code" depends="prepare_chat">
<delete dir="${chat_build}"/>
<mkdir dir="${chat_build}"/>
<exec executable="cmake" dir="${chat_build}" failonerror="true">
<arg value=".."/>
</exec>
<exec executable="cmake" dir="${chat_build}" failonerror="true">
<arg value="--build"/>
<arg value="."/>
</exec>
<move todir="${basedir}/chat">
<fileset dir="${chat_build}/bin"/>
</move>
</target>
<!-- Compiles the DSRC (Java) code -->
<target name="compile_java" depends="init" description="compile java code">
<javac srcdir="${dsrc_server}" destdir="${data_server}" includeantruntime="false" classpath="${data_server}" encoding="utf8" sourcepath="${dsrc_server}" debug="true" deprecation="on">
<compilerarg value="-Xlint:-options"/>
</javac>
<antcall target="create_symlinks"/>
</target>
<!-- Compiles all code necessary for server execution -->
<target name="compile" depends="compile_src,compile_chat,compile_java,compile_miff,compile_tab,compile_tpf,load_templates">
</target>
<!-- Compiles all .mif files -->
<target name="compile_miff">
<fileset id="miff_files" dir="${dsrc}" includes="**/*.mif"/>
<touch mkdirs="true" verbose="false">
<fileset refid="miff_files"/>
<mapper type="glob" from="*.mif" to="${data}/*/.tmp" />
</touch>
<delete>
<fileset dir="${data}" includes="**/.tmp"/>
</delete>
<apply executable="./Miff" dir="${tools_home}" dest="${data}" parallel="false" type="file">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<arg value="-i"/>
<srcfile prefix="&quot;" suffix="&quot;"/>
<arg value="-o"/>
<targetfile prefix="&quot;" suffix="&quot;"/>
<fileset refid="miff_files"/>
<mapper type="glob" from="*.mif" to="*.iff"/>
</apply>
<antcall target="cleanup"/>
</target>
<!-- Compiles all .tab files -->
<target name="compile_tab">
<property name="server_datatables" location="${dsrc_server}/datatables"/>
<property name="shared_datatables" location="${dsrc_shared}/datatables"/>
<property name="include_datatables" location="${shared_datatables}/include"/>
<touch mkdirs="true" verbose="false">
<fileset dir="${dsrc}" includes="**/*.tab"/>
<mapper type="glob" from="*.tab" to="${data}/*/.tmp" />
</touch>
<delete>
<fileset dir="${data}" includes="**/.tmp"/>
</delete>
<apply executable="./DataTableTool" dir="${tools_home}" dest="${data}" parallel="false" type="file" failonerror="true">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<arg value="-i"/>
<srcfile prefix="&quot;" suffix="&quot;"/>
<arg value="-- -s SharedFile"/>
<arg value="searchPath10=${data_shared}"/>
<arg value="searchPath10=${data_server}"/>
<arg value="searchPath10=${data_server}"/>
<fileset dir="${dsrc}" includes="**/*.tab" excludes="**/object_template_crc_string_table.tab,**/quest_crc_string_table.tab"/>
<mapper type="glob" from="*.tab" to="*.iff"/>
</apply>
<antcall target="cleanup"/>
</target>
<!-- Compiles all Template Files (.tpf) -->
<target name="compile_tpf" description="compile the template files (*.tpf) into .iff">
<touch mkdirs="true" verbose="false">
<fileset dir="${dsrc}" includes="**/*.tpf"/>
<mapper type="glob" from="*.tpf" to="${data}/*/.tmp" />
</touch>
<delete>
<fileset dir="${data}" includes="**/.tmp"/>
</delete>
<apply executable="${tools_home}/TemplateCompiler" dir="${basedir}" dest="${basedir}" parallel="false" type="file" failonerror="false" relative="true">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<arg value="-compile"/>
<srcfile/>
<fileset dir="${basedir}" includes="${dsrc}/**/*.tpf"/>
<mapper type="glob" from="${dsrc}/*.tpf" to="${data}/*.iff"/>
</apply>
<antcall target="cleanup"/>
</target>
<!-- Compiles all Template Definition Files (.tdf) -->
<!--
<target name="compile_tdf" description="compile the template definition files (*.tdf) into .iff">
<touch mkdirs="true" verbose="false">
<fileset dir="${dsrc}" includes="**/*.tdf"/>
<mapper type="glob" from="*.tdf" to="${data}/*/.tmp" />
</touch>
<delete>
<fileset dir="${data}" includes="**/.tmp"/>
</delete>
<apply executable="${tools_home}/TemplateDefinitionCompiler" dir="${basedir}" dest="${basedir}" parallel="false" type="file" failonerror="false" relative="true">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<arg value="-compile"/>
<srcfile/>
<fileset dir="${basedir}" includes="${dsrc}/**/*.tdf"/>
<mapper type="glob" from="${dsrc}/*.tdf" to="${data}/*.iff"/>
</apply>
<antcall target="cleanup"/>
</target>
-->
<!-- Creates the Object Template CRC file -->
<target name="build_object_template_crc" description="creates the object template crc file" depends="compile_tpf, compile_miff">
<exec executable="utils/build_object_template_crc_string_tables.py" dir="${basedir}">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
</exec>
</target>
<!-- Creates the Quest CRC file -->
<target name="build_quest_crc" description="creates the quest crc file" depends="compile_tab">
<exec executable="utils/build_quest_crc_string_tables.py" dir="${basedir}">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
</exec>
</target>
<!-- Creates SQL (insert statements) to get all the CRC Templates into the database -->
<target name="process_templates" description="generates sql from generated crc files" depends="build_object_template_crc,build_quest_crc">
<exec executable="perl" dir="${basedir}/src/game/server/database/templates" input="${object_crc_file}" output="${templates_sql_file}">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<arg value="processTemplateList.pl"/>
</exec>
</target>
<!-- Executes the generated Template CRC SQL in SQL*Plus -->
<target name="load_templates" description="loads generated templates into the database" depends="process_templates">
<exec executable="sqlplus" dir="${build}">
<arg value="${db_username}/${db_password}@${ADDR4}/${db_service}"/>
<arg value="@${templates_sql_file}"/>
</exec>
</target>
<!-- Target used to create database tables -->
<target name="create_database" description="creates database tables from existing sql scripts" if="firstrun">
<replace file="build.properties" token="firstrun = true" value="firstrun = false"/>
<exec executable="perl" dir="${basedir}/src/game/server/database/build/linux">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<arg value="database_update.pl"/>
<arg value="--username=${db_username}"/>
<arg value="--password=${db_password}"/>
<arg value="--service=${ADDR4}/${db_service}"/>
<arg value="--goldusername=${db_username}"/>
<arg value="--loginusername=${db_username}"/>
<arg value="--createnewcluster"/>
<arg value="--packages"/>
</exec>
<antcall target="add_new_cluster"/>
<antcall target="configure_limits"/>
</target>
<target name="add_new_cluster" description="Adds the cluster name to the database" if="firstrun">
<sql classpath="${env.ORACLE_HOME}/lib/ojdbc8.jar"
driver="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@${ADDR4}:1521:${db_service}"
userid="${db_username}"
password="${db_password}">
insert into cluster_list (id, name, num_characters, address, secret, locked, not_recommended)
select (select nvl(max(id)+1,1) from cluster_list), '${cluster_name}', 0, '${ADDR4}', 'N', 'N', 'N' from dual
where not exists (select '${cluster_name}', '${ADDR4}' from cluster_list);
</sql>
</target>
<target name="configure_limits" description="Defines the limits of the cluster and accounts in the database">
<sql classpath="${env.ORACLE_HOME}/lib/ojdbc8.jar"
driver="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@${ADDR4}:1521:${db_service}"
userid="${db_username}"
password="${db_password}">
update default_char_limits set account_limit = ${max_characters_per_account}, cluster_limit = ${max_characters_per_cluster};
update default_character_slots set num_slots = ${character_slots} where character_type_id = 1;
</sql>
</target>
<!-- Target used to delete database tables - change properties file "firstrun" from "false" to "true" to enable execution -->
<target name="drop_database" description="completely wipes database data">
<input message="All data WILL BE DELETED from SWG DB!!! ARE YOU SURE YOU WANT TO DELETE? Type the word DELETE if you do: " addproperty="do.delete"/>
<condition property="do.drop">
<equals arg1="DELETE" arg2="${do.delete}"/>
</condition>
<fail unless="do.drop">Database Drop Aborted.</fail>
<replace file="build.properties" token="firstrun = true" value="firstrun = false"/>
<exec executable="perl" dir="${basedir}/src/game/server/database/build/linux">
<env key="PATH" value="${env.PATH}:${tools_home}"/>
<arg value="database_update.pl"/>
<arg value="--username=${db_username}"/>
<arg value="--password=${db_password}"/>
<arg value="--service=${ADDR4}/${db_service}"/>
<arg value="--goldusername=${db_username}"/>
<arg value="--loginusername=${db_username}"/>
<arg value="--drop"/>
<arg value="--packages"/>
</exec>
</target>
<target name="create_symlinks">
<symlink link="${basedir}/data/sku.0/sys.client/compiled/clientdata" resource="${clientdata}"/>
<symlink link="${basedir}/exe/linux/bin" resource="${tools_home}"/>
</target>
<target name="start" description="starts the server" depends="create_symlinks,stop">
<exec executable="bin/LoginServer" dir="${exe}/linux">
<arg value="--"/>
<arg value="@servercommon.cfg &amp;"/>
</exec>
<exec executable="sleep" dir="${exe}/linux">
<arg value="5"/>
</exec>
<exec executable="bin/TaskManager" dir="${exe}/linux">
<arg value="--"/>
<arg value="@servercommon.cfg"/>
</exec>
</target>
<target name="stop" description="stops the login server">
<exec executable="killall" dir="${basedir}">
<arg value="LoginServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="CentralServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="ChatServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="CommoditiesServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="ConnectionServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="CustomerServiceServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="LogServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="MetricsServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="PlanetServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="ServerConsole"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="SwgDatabaseServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="-9"/>
<arg value="SwgGameServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="TransferServer"/>
</exec>
<exec executable="killall" dir="${basedir}">
<arg value="TaskManager"/>
</exec>
</target>
<!-- Cleans up empty folders from the build folder -->
<target name="cleanup" description="Clean up">
<delete includeemptydirs="true">
<fileset dir="${data}">
<and>
<size value="0"/>
<type type="dir"/>
</and>
</fileset>
</delete>
</target>
</project>

View File

@@ -1,179 +0,0 @@
#!/bin/bash
basedir=$PWD
PATH=$PATH:$basedir/build/bin
DBSERVICE=
DBUSERNAME=
DBPASSWORD=
HOSTIP=
CLUSTERNAME=
NODEID=
DSRC_DIR=
DATA_DIR=
# Public facing - builds profdata
#MODE=RELWITHDEBINFO
# Public facing, builds heavily optimized bins
#MODE=MINSIZEREL
if [ ! -d $basedir/build ]
then
mkdir $basedir/build
fi
echo -e "\n";
echo -e "\033[1;33m ___ __ __ ___ ___ _ ___ ";
echo -e "\033[1;33m/ __|\ \ / // __| / __| ___ _ _ _ _ __ ___ __ __/ | |_ )";
echo -e "\033[1;33m\__ \ \ \/\/ /| (_ | \__ \/ _ \| || || '_|/ _|/ -_) \ V /| | _ / /";
echo -e "\033[1;33m|___/ \_/\_/ \___| |___/\___/ \_,_||_| \__|\___| \_/ |_|(_)/___|";
echo -e "\033[1;31m";
echo -e "\033[1;36m";
#Commenting this for now... This script doesn't pull anyways.
#read -p "What is your GIT username (so we can get the code correctly): " response
#GIT_USER=${response,,}
#GIT_URL=https://${GIT_USER}@github.com/SWG-Source/
#GIT_REPO_DEPEND=${GIT_URL}dependencies.git
#GIT_REPO_SRC=${GIT_URL}src.git
#GIT_REPO_DSRC=${GIT_URL}dsrc.git
#GIT_REPO_CONFIG=${GIT_URL}configs.git
#GIT_REPO_CLIENTDATA=${GIT_URL}clientdata.git
# specify git branches for each repo
#GIT_REPO_DEPEND_BRANCH=master
#GIT_REPO_SRC_BRANCH=master
#GIT_REPO_DSRC_BRANCH=master
#GIT_REPO_CONFIG_BRANCH=master
#GIT_REPO_CLIENTDATA_BRANCH=master
echo -e "\033[2;31m******************************************************************
Begin individual building of scripts for /dsrc to /data
******************************************************************";
echo -e "\033[2;36m";
read -p "Do you want to recompile the scripts (.java)? (y/n) " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
#prepare environment to run data file builders
oldPATH=$PATH
PATH=$basedir/build/bin:$PATH
read -p "Do you wanna use multi-core building (default) or stick with the safe option? You may need to rerun the single version if there are stragglers. (multi/safe) " response
response=${response,,}
if [[ $response =~ ^(multi|m| ) ]]; then
$basedir/utils/build_java_multi.sh
else
$basedir/utils/build_java.sh
fi
PATH=$oldPATH
fi
buildTemplates=false
read -p "Do you want to build the mIFF files (.mif)? (y/n) " response
response=${response,,}
if [[ $response =~ ^(yes|y| ) ]]; then
#prepare environment to run data file builders
oldPATH=$PATH
PATH=$basedir/build/bin:$PATH
$basedir/utils/build_miff.sh
buildTemplates=true
PATH=$oldPATH
fi
read -p "Do you want to build the datatables (.tab)? (y/n) " response
response=${response,,}
if [[ $response =~ ^(yes|y| ) ]]; then
#prepare environment to run data file builders
oldPATH=$PATH
PATH=$basedir/build/bin:$PATH
read -p "Do you wanna use multi-core building (default) or stick with the safe option? You may need to rerun the single version if there are stragglers. (multi/safe) " response
response=${response,,}
if [[ $response =~ ^(multi|m| ) ]]; then
$basedir/utils/build_tab_multi.sh
else
$basedir/utils/build_tab.sh
fi
buildTemplates=true
PATH=$oldPATH
fi
read -p "Do you want to build the template files (.tpf)? (y/n) " response
response=${response,,}
if [[ $response =~ ^(yes|y| ) ]]; then
#prepare environment to run data file builders
oldPATH=$PATH
PATH=$basedir/build/bin:$PATH
read -p "Do you wanna use multi-core building (default) or stick with the safe option? You may need to rerun the single version if there are stragglers. (multi/safe) " response
response=${response,,}
if [[ $response =~ ^(multi|m| ) ]]; then
$basedir/utils/build_tpf_multi.sh
else
$basedir/utils/build_tpf.sh
fi
buildTemplates=true
PATH=$oldPATH
fi
if [[ $buildTemplates = false ]]; then
read -p "Do you want to build the Object Template or Quest CRC files? (y/n) " response
response=${response,,}
if [[ $response =~ ^(yes|y| ) ]]; then
$buildTemplates=true
fi
fi
templatesLoaded=false
if [[ $buildTemplates = true ]]; then
echo "Object Template and Quest CRC files will now be built and re-imported into the database."
if [[ -z "$DBSERVICE" ]]; then
echo "Enter the DSN for the database connection e.g. //127.0.0.1/swg"
read DBSERVICE
fi
if [[ -z "$DBUSERNAME" ]]; then
echo "Enter the database username "
read DBUSERNAME
fi
if [[ -z "$DBPASSWORD" ]]; then
echo "Enter the database password "
read DBPASSWORD
fi
#prepare environment to run data file builders
oldPATH=$PATH
PATH=$basedir/build/bin:$PATH
$basedir/utils/build_object_template_crc_string_tables.py
$basedir/utils/build_quest_crc_string_tables.py
cd $basedir/src/game/server/database
echo "Loading template list"
perl ./templates/processTemplateList.pl < $basedir/dsrc/sku.0/sys.server/built/game/misc/object_template_crc_string_table.tab > $basedir/build/templates.sql
sqlplus ${DBUSERNAME}/${DBPASSWORD}@${DBSERVICE} @$basedir/build/templates.sql > $basedir/build/templates.out
templatesLoaded=true
cd $basedir
PATH=$oldPATH
fi
echo -e "\033[2;36m";
echo -e "\033[1;31m******************************************************************
END of individual building of scripts for /dsrc to /data
******************************************************************"

View File

@@ -1,541 +0,0 @@
#!/bin/bash
basedir=$PWD
PATH=$PATH:$basedir/build/bin
DBSERVICE=
DBUSERNAME=
DBPASSWORD=
HOSTIP=
CLUSTERNAME=
NODEID=
DSRC_DIR=
DATA_DIR=
# Public facing - builds profdata
#MODE=RELWITHDEBINFO
# Public facing, builds heavily optimized bins
#MODE=MINSIZEREL
if [ ! -d $basedir/build ]
then
mkdir $basedir/build
fi
echo -e "\n";
echo -e "\033[1;33m ___ __ __ ___ ___ _ ___ ";
echo -e "\033[1;33m/ __|\ \ / // __| / __| ___ _ _ _ _ __ ___ __ __/ | |_ )";
echo -e "\033[1;33m\__ \ \ \/\/ /| (_ | \__ \/ _ \| || || '_|/ _|/ -_) \ V /| | _ / /";
echo -e "\033[1;33m|___/ \_/\_/ \___| |___/\___/ \_,_||_| \__|\___| \_/ |_|(_)/___|";
echo -e "\033[1;31m";
echo -e "\033[1;36m";
#read -p "What is your GIT username (so we can get the code correctly): " response
#GIT_USER=${response,,}
GIT_URL=https://github.com/SWG-Source/
GIT_REPO_DEPEND=${GIT_URL}dependencies.git
GIT_REPO_SRC=${GIT_URL}src.git
GIT_REPO_DSRC=${GIT_URL}dsrc.git
GIT_REPO_CONFIG=${GIT_URL}configs.git
GIT_REPO_CLIENTDATA=${GIT_URL}clientdata.git
GIT_REPO_STATIONAPI=${GIT_URL}stationapi.git
# specify git branches for each repo
GIT_REPO_DEPEND_BRANCH=master
GIT_REPO_SRC_BRANCH=master
GIT_REPO_DSRC_BRANCH=master
GIT_REPO_CONFIG_BRANCH=master
GIT_REPO_CLIENTDATA_BRANCH=master
GIT_REPO_STATIONAPI_BRANCH=master
echo -e "\033[1;31m";
if [ ! -f $basedir/.setup ]; then
if [[ $(lsb_release -a) =~ .*Ubuntu.* ]] || [ -f "/etc/debian_version" ]
then
read -p "******************************************************************
This section of the build script will install latest dependencies
******************************************************************
******************************************************************
!!!ONLY RUN ONCE!!! Do you want to install dependencies (y/n)?" response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
if [[ $(git lfs install) = *"Git LFS initialized." ]]; then
if [ ! -d $basedir/dependencies ]; then
git clone -b $GIT_REPO_DEPEND_BRANCH $GIT_REPO_DEPEND dependencies
cd $basedir/dependencies
git lfs install
git lfs pull
cd $basedir
else
cd $basedir/dependencies
git pull
git lfs pull
cd $basedir
fi
$basedir/utils/init/debian.sh
source /etc/profile.d/java.sh
source /etc/profile.d/oracle.sh
touch $basedir/.setup
echo "Please login and out or reboot as changes have been made to your PATH "
else
echo "Please install Git LFS and try again."
fi
fi
fi
fi
echo -e "\033[1;36m";
read -p "******************************************************************
This section of script will pull latest src/dsrc from our github
repo. https://github.com/SWG-Source
******************************************************************
******************************************************************
Do you want to pull/update git? (y/n) " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
# update main repo
git pull
# update or clone each sub-repo
if [ ! -d $basedir/src ]; then
git clone -b $GIT_REPO_SRC_BRANCH $GIT_REPO_SRC src
else
cd $basedir/src
git pull
cd $basedir
fi
if [ ! -d $basedir/dsrc ]; then
git clone -b $GIT_REPO_DSRC_BRANCH $GIT_REPO_DSRC dsrc
else
cd $basedir/dsrc
git pull
cd $basedir
fi
if [ ! -d $basedir/configs ]; then
git clone -b $GIT_REPO_CONFIG_BRANCH $GIT_REPO_CONFIG configs
else
cd $basedir/configs
git pull
cd $basedir
fi
if [ ! -d $basedir/clientdata ]; then
git clone -b $GIT_REPO_CLIENTDATA_BRANCH $GIT_REPO_CLIENTDATA clientdata
else
cd $basedir/clientdata
git pull
cd $basedir
fi
if [ ! -d $basedir/stationapi/.git ]; then
rm -rf $basedir/stationapi
git clone -b $GIT_REPO_STATIONAPI_BRANCH $GIT_REPO_STATIONAPI stationapi
else
cd $basedir/stationapi
git pull
cd $basedir
fi
fi
read -p "Is this for DEBUG mode or RELEASE mode? (d/r): " response
response=${response,,}
if [[ $response =~ ^(debug|d| ) ]]; then
MODE=Debug
else
MODE=Release
fi
echo -e "\033[1;32m";
read -p "******************************************************************
G++ ONLY COMPILE METHOD!!!
This secton of script will compile the src to binaries. The new
binaries will be located in /home/swg/swg-main/build/bin
******************************************************************
******************************************************************
Do you want to recompile the server code (C++) (GCC) now? (y/n) " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
unset ORACLE_HOME;
unset ORACLE_SID;
unset JAVA_HOME;
export ORACLE_HOME=/usr/lib/oracle/12.2/client;
export JAVA_HOME=/usr/java;
export ORACLE_SID=swg;
rm -rf $basedir/build
mkdir $basedir/build
mkdir $basedir/build/bin
cd $basedir/build
if [ $(arch) == "x86_64" ]; then
export LDFLAGS=-L/usr/lib32
export CMAKE_PREFIX_PATH="/usr/lib32:/lib32:/usr/lib/i386-linux-gnu:/usr/include/i386-linux-gnu"
cmake -DCMAKE_C_FLAGS=-m32 \
-DCMAKE_CXX_FLAGS=-m32 \
-DCMAKE_EXE_LINKER_FLAGS=-m32 \
-DCMAKE_MODULE_LINKER_FLAGS=-m32 \
-DCMAKE_SHARED_LINKER_FLAGS=-m32 \
-DCMAKE_BUILD_TYPE=$MODE \
$basedir/src
else
cmake $basedir/src -DCMAKE_BUILD_TYPE=$MODE
fi
make -j$(nproc)
# This option strips the bins of debug to make smaller size
if [[ $MODE =~ ^(Release) ]]; then
strip -s bin/*
fi
cd $basedir
fi
#echo -e "\033[2;33m";
#read -p "******************************************************************
#CLANG ONLY COMPILER METHOD!!!
#This secton of script will compile the src to binaries. The new
#binaries will be located in /home/swg/swg-main/build/bin
#******************************************************************
#******************************************************************
#Do you want to recompile the server code (C++) (CLANG) now? (y/n) " response
#response=${response,,} # tolower
#if [[ $response =~ ^(yes|y| ) ]]; then
#
# unset ORACLE_HOME;
# unset ORACLE_SID;
# unset JAVA_HOME;
# export ORACLE_HOME=/usr/lib/oracle/12.2/client;
# export JAVA_HOME=/usr/java;
# export ORACLE_SID=swg;
# rm -rf /home/swg/swg-main/build
# mkdir /home/swg/swg-main/build
# mkdir /home/swg/swg-main/build/bin
# cd $basedir/build
#
# if type clang &> /dev/null; then
# export CC=clang
# export CXX=clang++
# fi
#
# if [ $(arch) == "x86_64" ]; then
# export LDFLAGS=-L/usr/lib32
# export CMAKE_PREFIX_PATH="/usr/lib32:/lib32:/usr/lib/i386-linux-gnu:/usr/include/i386-linux-gnu"
#
# cmake -DCMAKE_C_FLAGS=-m32 \
# -DCMAKE_CXX_FLAGS=-m32 \
# -DCMAKE_EXE_LINKER_FLAGS=-m32 \
# -DCMAKE_MODULE_LINKER_FLAGS=-m32 \
# -DCMAKE_SHARED_LINKER_FLAGS=-m32 \
# -DCMAKE_BUILD_TYPE=$MODE \
# $basedir/src
# else
# cmake $basedir/src -DCMAKE_BUILD_TYPE=$MODE
# fi
#
# make -j$(nproc)
#
# # This option strips the bins of debug to make smaller size
# if [[ $MODE =~ ^(Release) ]]; then
# strip -s bin/*
# fi
#
# cd $basedir
#
#fi
echo -e "\033[1;36m";
read -p "******************************************************************
This section of script will add your VM's IP to NGE Server configs
New configs will be built in /home/swg/swg-main/exe/linux
******************************************************************
******************************************************************
Do you want to build the config environment now? (y/n) " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
# Prompt for configuration environment.
# read -p "Configure environment (local, live, tc)? " config_env
#
# Make sure the configuration environment exists.
# if [ ! -d $basedir/configs/$config_env ]; then
# echo "Invalid configuration environment."
# exit
# fi
#
echo "Enter your IP address (LAN for port forwarding or internal, outside IP for DMZ)"
read HOSTIP
echo "Enter the DSN for the database connection. i.e. //127.0.0.1/swg "
read DBSERVICE
echo "Enter the database username. i.e. swg "
read DBUSERNAME
echo "Enter the database password. i.e. swg "
read DBPASSWORD
echo "Enter a name for the galaxy cluster. Use the same name for importing your swg database. "
read CLUSTERNAME
if [ -d $basedir/exe ]; then
rm -rf $basedir/exe
fi
mkdir -p $basedir/exe/linux/logs
mkdir -p $basedir/exe/shared
ln -s $basedir/build/bin $basedir/exe/linux/bin
cp -u $basedir/configs/$config_env/linux/* $basedir/exe/linux
cp -u $basedir/configs/$config_env/shared/* $basedir/exe/shared
for filename in $(find $basedir/exe -name '*.cfg'); do
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
done
#
# Generate other config files if their template exists.
#
# Generate at least 1 node that is the /etc/hosts IP.
$basedir/utils/build_node_list.sh
fi
echo -e "\033[2;32m";
read -p "******************************************************************
This section of script will compile your /dsrc to /data. It will
basically convert your Java scripts, tabs & tpf to .iff that server
will be able to read.
NOTE: It will do all the conversions at once, or you can skip this
section of the script and run each individually with next sections
of script.
******************************************************************
******************************************************************
Do you want to build all the scripts now? (y/n) " response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]]; then
#prepare environment to run data file builders
oldPATH=$PATH
PATH=$basedir/build/bin:$PATH
read -p "Do you wanna use multicore scripts or the safe option?
Recommended you use safe for this VM operation.(multi/safe) " response
response=${response,,}
if [[ $response =~ ^(multi|m| ) ]]; then
$basedir/utils/build_java_multi.sh
$basedir/utils/build_miff.sh
$basedir/utils/build_tab_multi.sh
$basedir/utils/build_tpf_multi.sh
else
$basedir/utils/build_java.sh
$basedir/utils/build_miff.sh
$basedir/utils/build_tab.sh
$basedir/utils/build_tpf.sh
fi
$basedir/utils/build_object_template_crc_string_tables.py
$basedir/utils/build_quest_crc_string_tables.py
PATH=$oldPATH
fi
#echo -e "\033[2;31m******************************************************************
#Begin individual building of scripts for /dsrc to /data
#******************************************************************";
#echo -e "\033[2;36m";
#read -p "Do you want to recompile the scripts (.java)? (y/n) " response
#response=${response,,} # tolower
#if [[ $response =~ ^(yes|y| ) ]]; then
#prepare environment to run data file builders
# oldPATH=$PATH
# PATH=$basedir/build/bin:$PATH
#
# read -p "Do you wanna use multi-core building (default) or stick with the safe option? You may need to rerun the single version if there are stragglers. (multi/safe) " response
# response=${response,,}
# if [[ $response =~ ^(multi|m| ) ]]; then
# $basedir/utils/build_java_multi.sh
# else
# $basedir/utils/build_java.sh
# fi
#
# PATH=$oldPATH
#fi
#
#buildTemplates=false
#
#read -p "Do you want to build the mIFF files (.mif)? (y/n) " response
#response=${response,,}
#if [[ $response =~ ^(yes|y| ) ]]; then
# #prepare environment to run data file builders
# oldPATH=$PATH
# PATH=$basedir/build/bin:$PATH
#
# $basedir/utils/build_miff.sh
#
# buildTemplates=true
#
# PATH=$oldPATH
#fi
#
#read -p "Do you want to build the datatables (.tab)? (y/n) " response
#response=${response,,}
#if [[ $response =~ ^(yes|y| ) ]]; then
#prepare environment to run data file builders
# oldPATH=$PATH
# PATH=$basedir/build/bin:$PATH
#
# read -p "Do you wanna use multi-core building (default) or stick with the safe option? You may need to rerun the single version if there are stragglers. (multi/safe) " response
# response=${response,,}
# if [[ $response =~ ^(multi|m| ) ]]; then
# $basedir/utils/build_tab_multi.sh
# else
# $basedir/utils/build_tab.sh
# fi
#
# buildTemplates=true
#
# PATH=$oldPATH
#fi
#
#read -p "Do you want to build the template files (.tpf)? (y/n) " response
#response=${response,,}
#if [[ $response =~ ^(yes|y| ) ]]; then
# #prepare environment to run data file builders
# oldPATH=$PATH
# PATH=$basedir/build/bin:$PATH
#
# read -p "Do you wanna use multi-core building (default) or stick with the safe option? You may need to rerun the single version if there are stragglers. (multi/safe) " response
# response=${response,,}
# if [[ $response =~ ^(multi|m| ) ]]; then
# $basedir/utils/build_tpf_multi.sh
# else
# $basedir/utils/build_tpf.sh
# fi
#
# buildTemplates=true
#
# PATH=$oldPATH
#fi
#
#if [[ $buildTemplates = false ]]; then
# read -p "Do you want to build the Object Template or Quest CRC files? (y/n) " response
# response=${response,,}
# if [[ $response =~ ^(yes|y| ) ]]; then
# buildTemplates=true
# fi
#fi
#
#templatesLoaded=false
#
#if [[ $buildTemplates = true ]]; then
# echo "Object Template and Quest CRC files will now be built and re-imported into the database."
#
# if [[ -z "$DBSERVICE" ]]; then
# echo "Enter the DSN for the database connection "
# read DBSERVICE
# fi
#
# if [[ -z "$DBUSERNAME" ]]; then
# echo "Enter the database username "
# read DBUSERNAME
# fi
#
# if [[ -z "$DBPASSWORD" ]]; then
# echo "Enter the database password "
# read DBPASSWORD
# fi
#
# #prepare environment to run data file builders
# oldPATH=$PATH
# PATH=$basedir/build/bin:$PATH
#
# $basedir/utils/build_object_template_crc_string_tables.py
# $basedir/utils/build_quest_crc_string_tables.py
#
# cd $basedir/src/game/server/database
#
# echo "Loading template list"
#
# perl ./templates/processTemplateList.pl < $basedir/dsrc/sku.0/sys.server/built/game/misc/object_template_crc_string_table.tab > $basedir/build/templates.sql
# sqlplus ${DBUSERNAME}/${DBPASSWORD}@${DBSERVICE} @$basedir/build/templates.sql > $basedir/build/templates.out
#
# templatesLoaded=true
#
# cd $basedir
# PATH=$oldPATH
#fi
#echo -e "\033[2;36m";
#echo -e "\033[1;31m******************************************************************
#END of individual building of scripts for /dsrc to /data
#******************************************************************"
#
echo -e "\033[2;32m";
read -p "******************************************************************
This script will (re)build your stationapi (chat server)
******************************************************************
******************************************************************
Do you want to build stationapi chat server now? (y/n) " response
response=${response,,}
if [[ $response =~ ^(yes|y| ) ]]; then
cd $basedir/stationapi
./build.sh
mv -T $basedir/stationapi/build/bin $basedir/chat
cd $basedir
fi
echo -e "\033[0;37m";
read -p "******************************************************************
This script will import the SWG database into Oracle 12.2 R2.
******************************************************************
******************************************************************
Do you want to import the database to Oracle? (y/n) " response
response=${response,,}
if [[ $response =~ ^(yes|y| ) ]]; then
cd $basedir/src/game/server/database/build/linux;
unset ORACLE_HOME;
unset ORACLE_SID;
unset JAVA_HOME;
export JAVA_HOME=/usr/java;
export ORACLE_HOME=/usr/lib/oracle/12.2/client;
export ORACLE_SID=swg;
export PATH=$ORACLE_HOME/bin:$PATH;
if [[ -z "$DBSERVICE" ]]; then
echo "Enter the DSN for the database connection i.e. //127.0.0.1/swg "
read DBSERVICE
fi
if [[ -z "$DBUSERNAME" ]]; then
echo "Enter the database username i.e. swg "
read DBUSERNAME
fi
if [[ -z "$DBPASSWORD" ]]; then
echo "Enter the database password i.e. swg "
read DBPASSWORD
fi
./database_update.pl --username=$DBUSERNAME --password=$DBPASSWORD --service=$DBSERVICE --goldusername=$DBUSERNAME --loginusername=$DBUSERNAME --createnewcluster --packages
if [[ $templatesLoaded = false ]]; then
echo "Loading template list from object_template_crc_string table "
perl $basedir/src/game/server/database/templates/processTemplateList.pl < $basedir/dsrc/sku.0/sys.server/built/game/misc/object_template_crc_string_table.tab > $basedir/build/templates.sql
sqlplus ${DBUSERNAME}/${DBPASSWORD}@${DBSERVICE} @$basedir/build/templates.sql > $basedir/build/templates.out
cd $basedir
fi
fi
read -p "******************************************************************
This section will link your clientdata folder to sys.client in the server
***************************************************************************
******************************************************************
Do you want to create the symlink for the clientdata folder? (y/n) " response
response=${response,,}
if [[ $response =~ ^(yes|y| ) ]]; then
cd $basedir/data/sku.0/sys.client
mkdir compiled
ln -s $basedir/clientdata/ $basedir/data/sku.0/sys.client/compiled/
fi
echo -e "\033[1;33m";
echo "Congratulations build_linux script is complete!"

View File

@@ -1,41 +0,0 @@
#!/bin/bash
server=$(find ./dsrc/sku.0/sys.server/compiled/game/datatables -name '*.tab')
inc=$(find ./dsrc/sku.0/sys.shared/compiled/game/datatables/include -name '*.tab')
shared=$(find ./dsrc/sku.0/sys.shared/compiled/game/datatables -name '*.tab')
filenames=("${server[@]}" "${inc[@]}" "${shared[@]}")
spinstr='|/-\'
i=0
current=0
total=$(ls ${filenames[@]} | wc -l)
compile () {
ofilename=${filename/dsrc/data}
ofilename=${ofilename/.tab/.iff}
mkdir -p $(dirname $ofilename)
[ -e $ofilename ] && rm "$ofilename"
result=$(./exe/linux/bin/DataTableTool -i "$filename" -- -s SharedFile searchPath10=data/sku.0/sys.shared/compiled/game searchPath10=data/sku.0/sys.server/compiled/game 2>&1)
if [[ ! $result =~ .*SUCCESS.* ]]; then
printf "\r$filename\n"
printf "$result\n\n"
fi
}
for filename in ${filenames[@]}; do
current=$((current+1))
i=$(( (i+1) %4 ))
perc=$(bc -l <<< "scale=0; $current*100/$total")
printf "\rGenerating Datatables: [${spinstr:$i:1}] $perc%%"
while [ `jobs | wc -l` -ge 12 ]
do
sleep 5
done
compile $filename & done
wait
echo ""

1
clientdata Submodule

Submodule clientdata added at e345de3e1f

1
dsrc Submodule

Submodule dsrc added at 5c2e112349

1
exe Submodule

Submodule exe added at 2f5013dea3

195
git_targets.xml Executable file
View File

@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="git_targets" basedir="." >
<!-- ===============================
Git tasks
==================================== -->
<macrodef name = "git">
<attribute name = "command" />
<attribute name = "dir" default = "" />
<element name = "args" optional = "true" />
<sequential>
<echo message = "git @{command}" />
<exec executable = "git" dir = "@{dir}" failonerror="true">
<arg value = "@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name = "git-clone-pull">
<attribute name = "repository" />
<attribute name = "dest" />
<attribute name = "branch" />
<sequential>
<git command = "clone">
<args>
<arg value = "@{repository}" />
<arg line = "-b @{branch}" />
<arg value = "@{dest}" />
</args>
</git>
<git-pull branch="@{branch}" dir="@{dest}" />
</sequential>
</macrodef>
<macrodef name = "git-pull">
<attribute name = "dir" />
<attribute name = "branch" />
<sequential>
<echo>Pulling @{dir}, branch: @{branch}</echo>
<git command = "pull" dir="@{dir}" >
<args>
<arg value = "origin" />
<arg value = "@{branch}" />
</args>
</git>
</sequential>
</macrodef>
<macrodef name = "git-push">
<attribute name = "dir" />
<attribute name = "branch" />
<sequential>
<echo>Pushing @{dir} to @{branch}</echo>
<git command = "push" dir="@{dir}" >
<args>
<arg value = "origin" />
<arg value = "@{branch}" />
</args>
</git>
</sequential>
</macrodef>
<macrodef name = "git-checkout">
<attribute name = "branch" />
<attribute name = "dir" />
<sequential>
<echo>Checking out @{branch} branch</echo>
<git command="checkout" dir="@{dir}">
<args>
<arg value="@{branch}" />
</args>
</git>
</sequential>
</macrodef>
<macrodef name = "git-commit">
<attribute name = "comment" />
<attribute name = "file" />
<attribute name = "dir" />
<attribute name = "branch" />
<sequential>
<echo>Commiting @{file} to git on branch @{branch}</echo>
<git command="add" dir="@{dir}">
<args>
<arg value="@{file}" />
</args>
</git>
<git command="commit" dir="@{dir}">
<args>
<arg value="@{file}" />
<arg line="-m '${comment}'" />
</args>
</git>
<git-push branch="${branch}" dir="@{dir}" />
</sequential>
</macrodef>
<macrodef name = "git-tag">
<attribute name = "comment" />
<attribute name = "dir" />
<attribute name = "version" />
<sequential>
<if>
<isset property="dont_zip" />
<then/>
<else>
<echo>Tagging @{dir} @{version} </echo>
<git command="tag" dir="@{dir}">
<args>
<arg line="-a @{version}" />
<arg line="-m '@{comment}'" />
</args>
</git>
<git-push branch="@{version}" dir="@{dir}" />
</else>
</if>
</sequential>
</macrodef>
<macrodef name = "git-update-submods">
<attribute name = "dir" default = "" />
<sequential>
<git command = "submodule" dir="@{dir}">
<args>
<arg line="update"/>
<arg line="--init"/>
<arg line="--recursive"/>
</args>
</git>
</sequential>
</macrodef>
<!--
<target name="git_tag">
<git command="tag" dir="staging/${extn}">
<args>
<arg line="-a ${next_version}" />
<arg line="-m '${comment}'" />
</args>
</git>
<git-push-tag branch="${next_version}" dir="staging/${extn}" />
</target>-->
<!-- ===============================
Modman tasks
==================================== -->
<macrodef name="modman">
<attribute name="command" />
<attribute name="dir" default="" />
<element name="args" optional="true" />
<sequential>
<echo message="modman @{command} in @{dir}" />
<exec executable="modman" dir="@{dir}">
<arg value="@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<macrodef name="modman-clone">
<attribute name="repos" />
<attribute name="dest" />
<attribute name="branch" />
<sequential>
<modman command="clone" dir="@{dest}">
<args>
<arg value="@{repos}" />
<arg line="--branch @{branch}" />
</args>
</modman>
</sequential>
</macrodef>
<macrodef name="modman-clone-overlay">
<attribute name="extn" />
<attribute name="dest" />
<attribute name="branch" />
<attribute name="repos" />
<sequential>
<echo>Cloning @{extn} with branch @{branch} (named: @{extn}@{branch})</echo>
<modman command="clone" dir="@{dest}">
<args>
<arg value="@{extn}@{branch}" />
<arg value="@{repos}" />
<arg line="--branch @{branch}" />
</args>
</modman>
</sequential>
</macrodef>
<macrodef name="modman-update">
<attribute name="dir" />
<attribute name="extn" />
<sequential>
<echo>Updating @{dir}, extn: @{extn}</echo>
<modman command="update" extn="@{extn}" dir="@{dest}" />
</sequential>
</macrodef>
</project>

1
src Submodule

Submodule src added at a66c0d1a91

1
stationapi Submodule

Submodule stationapi added at ae46b8a617

View File

@@ -1,104 +0,0 @@
#!/bin/bash
basedir=$PWD
PATH=$PATH:$basedir/build/bin
DBSERVICE=
DBUSERNAME=
DBPASSWORD=
HOSTIP=
CLUSTERNAME=
NODEID=
DSRC_DIR=
DATA_DIR=
# Public facing - builds profdata
#MODE=RELWITHDEBINFO
# Public facing, builds heavily optimized bins
#MODE=MINSIZEREL
if [ ! -d $basedir/build ]
then
mkdir $basedir/build
fi
echo -e "\n";
echo -e "\033[1;33m ___ __ __ ___ ___ _ ___ ";
echo -e "\033[1;33m/ __|\ \ / // __| / __| ___ _ _ _ _ __ ___ __ __/ | |_ )";
echo -e "\033[1;33m\__ \ \ \/\/ /| (_ | \__ \/ _ \| || || '_|/ _|/ -_) \ V /| | _ / /";
echo -e "\033[1;33m|___/ \_/\_/ \___| |___/\___/ \_,_||_| \__|\___| \_/ |_|(_)/___|";
echo -e "\033[1;31m";
#GIT_USER=${response,,}
GIT_URL=https://github.com/SWG-Source/
GIT_REPO_DEPEND=${GIT_URL}dependencies.git
GIT_REPO_SRC=${GIT_URL}src.git
GIT_REPO_DSRC=${GIT_URL}dsrc.git
GIT_REPO_CONFIG=${GIT_URL}configs.git
GIT_REPO_CLIENTDATA=${GIT_URL}clientdata.git
GIT_REPO_DEPEND_BRANCH=master
GIT_REPO_SRC_BRANCH=master
GIT_REPO_DSRC_BRANCH=master
GIT_REPO_CONFIG_BRANCH=master
GIT_REPO_CLIENTDATA_BRANCH=master
git pull
cd $basedir/src
git pull
cd $basedir
cd $basedir/dsrc
git pull
cd $basedir
cd $basedir/configs
git pull
cd $basedir
cd $basedir/clientdata
git pull
cd $basedir
MODE=Release
unset ORACLE_HOME;
unset ORACLE_SID;
unset JAVA_HOME;
export ORACLE_HOME=/usr/lib/oracle/12.2/client;
export JAVA_HOME=/usr/java;
export ORACLE_SID=swg;
rm -rf /home/swg/swg-main/build
mkdir /home/swg/swg-main/build
mkdir /home/swg/swg-main/build/bin
cd $basedir/build
export LDFLAGS=-L/usr/lib32
export CMAKE_PREFIX_PATH="/usr/lib32:/lib32:/usr/lib/i386-linux-gnu:/usr/include/i386-linux-gnu"
cmake -DCMAKE_C_FLAGS=-m32 \
-DCMAKE_CXX_FLAGS=-m32 \
-DCMAKE_EXE_LINKER_FLAGS=-m32 \
-DCMAKE_MODULE_LINKER_FLAGS=-m32 \
-DCMAKE_SHARED_LINKER_FLAGS=-m32 \
-DCMAKE_BUILD_TYPE=$MODE \
$basedir/src
make -j$(nproc)
strip -s bin/*
cd $basedir
oldPATH=$PATH
PATH=$basedir/build/bin:$PATH
$basedir/utils/build_java_multi.sh
$basedir/utils/build_miff.sh
$basedir/utils/build_tab_multi.sh
$basedir/utils/build_tpf_multi.sh
$basedir/utils/build_object_template_crc_string_tables.py
$basedir/utils/build_quest_crc_string_tables.py
PATH=$oldPATH
cd $basedir/stationapi
./build.sh
mv -T /home/swg/swg-main/stationapi/build/bin /home/swg/swg-main/chat
cd $basedir
echo -e "\033[1;33m";
echo "Congratulations the latest server updates have been downloaded and compiled!"