User
- Joined
- Jan 17, 2025
- Messages
- 5
- Thread Author
- #1
Hello here a smal Tutorial how to Compile my 1.5.2 - 1.7.2 Sourcecode
Make sure you are login as root!
Install the Software (no X32 libs anymore)
1.
Inside this
2.
3.
Next stepp you need to create a script
Put this Code inside
aster you put into the code press CTRL + X and save the File
then give the file acess to 777
Final run the script
Make sure you are login as root!
Install the Software (no X32 libs anymore)
1.
Bash:
cd /root/; nano install_packages.sh
2.
Bash:
#!/bin/bash
# Aktualisiere die Paketliste
apt-get update
# Installiere die Pakete
apt-get install -y \
strace mc screen htop default-jdk mono-complete exim4 p7zip-full libpcap-dev curl wget ipset net-tools tzdata ntpdate mariadb-server mariadb-client \
make gcc g++ libssl-dev libcrypto++-dev libpcre3 libpcre3-dev libtesseract-dev libx11-dev gcc-multilib libc6-dev build-essential libtemplate-plugin-xml-perl libxml2-dev \
libdb++-dev libdb-dev libdb5.3 libdb5.3++ libdb5.3++-dev libdb5.3-dbg libdb5.3-dev \
apache2 php php-cli php-fpm php-json php-pdo php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-cgi php-mysqli php-common php-phpseclib php-mysql
# Überprüfen, ob die Installation erfolgreich war
if [ $? -eq 0 ]; then
echo "Alle Pakete wurden erfolgreich installiert."
else
echo "Es gab ein Problem bei der Installation der Pakete. Bitte überprüfe die Ausgabe oben."
exit 1
fi
l
Bash:
chmod 777 install_packages.sh
Next stepp you need to create a script
Bash:
cd/root/; nano server-build.sh
Put this Code inside
Bash:
#!/bin/bash
set -e # Stop the script if any command fails
set -o pipefail # Ensure pipes return an error if any command fails
trace() {
local msg="$1"
echo "[TRACE] $(date '+%Y-%m-%d %H:%M:%S') - $msg"
}
trace "Starting script execution."
GS=$(echo *game)
NET=$(echo *net)
SKILL=$(echo *skill)
trace "Detected directories: GS=$GS, NET=$NET, SKILL=$SKILL"
trace "=========================== setup $NET ==========================="
cd "$NET"
for dir in common io perf mk storage rpc rpcgen lua; do
trace "Removing old $dir and creating symlink."
rm -f "$dir"
ln -s ~/share/$dir/ "$dir"
trace "Symlink created for $dir."
done
cd ..
trace "=========================== setup iolib ==========================="
if [ ! -d iolib ]; then
trace "Creating iolib directory."
mkdir iolib
fi
cd iolib
if [ ! -d inc ]; then
trace "Creating inc directory inside iolib."
mkdir inc
fi
cd inc
trace "Removing old includes and creating new symlinks."
rm -f *
includes=(
"$NET/gamed/auctionsyslib.h"
"$NET/gamed/sysauctionlib.h"
"$NET/gdbclient/db_if.h"
"$NET/gamed/factionlib.h"
"$NET/common/glog.h"
"$NET/gamed/gsp_if.h"
"$NET/gamed/mailsyslib.h"
"$NET/gamed/privilege.hxx"
"$NET/gamed/sellpointlib.h"
"$NET/gamed/stocklib.h"
"$NET/gamed/webtradesyslib.h"
"$NET/gamed/kingelectionsyslib.h"
"$NET/gamed/pshopsyslib.h"
"$NET/io/luabase.h"
)
for inc in "${includes[@]}"; do
ln -s "../../$inc" .
trace "Symlink created for $inc."
done
cd ..
rm -f lib*
trace "Creating library symlinks."
ln -s ../$NET/io/libgsio.a
ln -s ../$NET/gdbclient/libdbCli.a
ln -s ../$NET/gamed/libgsPro2.a
ln -s ../$NET/logclient/liblogCli.a
ln -s ../$SKILL/libskill.a
cd ..
trace "======================== modify Rules.make ========================"
EPWD=$(pwd | sed -e 's/\//\\\//g')
trace "Current working directory: $EPWD"
cd "$GS"
sed -i -e "s/IOPATH=.*$/IOPATH=$EPWD\/iolib/g" -e "s/BASEPATH=.*$/BASEPATH=$EPWD\/$GS/g" Rules.make
cd ..
trace "====================== softlink libskill.so ======================="
cd "$GS/gs"
rm -f libskill.so
ln -s "../../$SKILL/libskill.so"
trace "Symlink created for libskill.so."
cd ../../
trace "Script setup completed successfully."
# Function Definitions with Trace Logs
buildrpcgen() {
trace "========================== $NET rpcgen ============================"
cd "$NET"
./rpcgen rpcalls.xml
trace "RPC generation completed."
cd ..
}
buildgslib() {
trace "======================= build liblogCli.a ========================="
cd "$NET/logclient"
make clean
make -f Makefile.gs -j$(nproc)
trace "liblogCli.a built successfully."
cd ..
trace "======================== build libgsPro2.a ========================="
cd gamed
make clean
make lib -j$(nproc)
trace "libgsPro2.a built successfully."
cd ..
trace "======================== build libdbCli.a =========================="
cd gdbclient
make clean
make lib -j$(nproc)
trace "libdbCli.a built successfully."
cd ..
}
# Add similar tracing to all functions as necessary
if [ $# -gt 0 ]; then
case "$1" in
deliver)
trace "Starting delivery rebuild."
buildrpcgen
builddeliver
;;
gs)
trace "Starting GS rebuild."
buildrpcgen
buildshared
buildgsio
buildgslib
buildskill
buildgame
install
;;
all)
trace "Starting full rebuild."
rebuildall
;;
install)
trace "Starting installation."
install
;;
*)
echo "Invalid option."
;;
esac
fi
trace "Script execution finished."
aster you put into the code press CTRL + X and save the File
then give the file acess to 777
Bash:
chmod 777 server-build.sh
Final run the script
Bash:
./server-build.sh