Skip to content

Commit

Permalink
Linux + misc fixes (zuluhotelaustralia#3)
Browse files Browse the repository at this point in the history
* Add fixes? maybe

* Case renaming, remove weird logon limit, fix ports in docker, use ecompile.cfg in setup folder
  • Loading branch information
jabinb authored Apr 22, 2020
1 parent 21b4933 commit 902f0f0
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 60 deletions.
18 changes: 11 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## ZHA git ignore files.
## Ignore any files that contain configuration or user generated data.
## Ignore any files that contain configuration or user generated data.
## Put a copy in \setup intead for inital setup.
## Use the \dev folder to put any interm scripts or items to not commit to git.

Expand All @@ -9,8 +9,9 @@
/pol.exe
/*.dll
/pol
/uoconvert
/pol.pid
/data/
/data
scripts/ecompile.cfg
scripts/ECOMPILE.BAT
scripts/ecompile.exe
Expand All @@ -19,17 +20,20 @@ scripts/ecall.bat
scripts/Compile-Folder.bat
scripts/Compile-File.bat
scripts/Compile-All.bat
setup/uo-client
setup/ecompile
realm

# Misc pol generated files
leftovers.txt
objtypes.txt
orphans.txt

# Mul generated files
config/tiles.cfg
config/multis.cfg
config/landtiles.cfg
realm/
# Mul generated files
config/tiles.cfg
config/multis.cfg
config/landtiles.cfg
realm/

# Script objects
*.dep
Expand Down
35 changes: 19 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
FROM debian:stable-slim
FROM ubuntu:eoan

ARG LIBMYSQL_DPKG=https://repo.mysql.com/apt/debian/pool/mysql-5.7/m/mysql-community/libmysqlclient20_5.7.29-1debian10_amd64.deb
ARG POL_RELEASE=https://github.com/polserver/polserver/releases/download/NightlyRelease/Nightly-Linux-gcc.zip
ARG LIBMYSQL_DEB=https://repo.mysql.com/apt/debian/pool/mysql-5.7/m/mysql-community/libmysqlclient20_5.7.29-1debian10_amd64.deb
ARG POL_RELEASE=https://github.com/polserver/polserver/releases/download/NightlyRelease/Nightly-Linux-clang.zip
ARG POL_TEMP_DIR=/tmp/poltmp/
ARG POL_DEST=/polserver

RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
ca-certificates wget unzip rsync procps \
libatomic1

RUN cd /tmp && \
wget $POL_RELEASE -O pol.zip \
RUN mkdir -p $POL_TEMP_DIR \
&& cd $POL_TEMP_DIR \
&& wget $POL_RELEASE -O pol.zip \
&& unzip pol.zip \
&& rm *dbg.zip \
&& unzip polserver*.zip \
&& rm -rf *.zip \
&& mkdir -p /polserver/ \
&& mv ./**/* /polserver/ \
&& wget $LIBMYSQL_DPKG -O /tmp/libmysqlclient20.dpkg \
&& dpkg --extract /tmp/libmysqlclient20.dpkg /tmp/libmysqlclient20 \
&& mkdir -p $POL_DEST \
&& mv ./**/* $POL_DEST \
&& rm -rf $POL_TEMP_DIR \
&& wget $LIBMYSQL_DEB -O /tmp/libmysqlclient20.deb \
&& dpkg --extract /tmp/libmysqlclient20.deb /tmp/libmysqlclient20 \
&& cp /tmp/libmysqlclient20/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 \
&& rm -rf /tmp/*

COPY . /app/
WORKDIR /app/


RUN rsync -av /polserver/ . \
&& cp -f setup/config/servers.cfg config/servers.cfg \
&& cp -f setup/pol.cfg pol.cfg \
&& rm -rf /polserver \
&& cp setup/ecompile.cfg scripts/ecompile.cfg \
&& scripts/ecompile -C ./scripts/ecompile.cfg
RUN rsync -av $POL_DEST . \
&& cd setup \
&& cp -f ./config/servers.cfg ../config/servers.cfg \
&& cp -f ./pol.cfg ../pol.cfg \
&& cp -f $POL_DEST/scripts/ecompile ./ecompile \
&& ./ecompile -C ecompile.cfg


CMD ["./run.sh"]
8 changes: 0 additions & 8 deletions Run.bat

This file was deleted.

6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ services:
image: docker.pkg.github.com/zuluhotelaustralia/zha/server:latest
hostname: shard.zuluhotel.com.au
restart: unless-stopped
#command: ["bash", "-c", "tail -f /dev/null"]
ports:
- 5333:5333
environment:
- SERVER_EXTERNAL_IP
volumes:
- ~/shard/client:/app/uo-client # Not needed if you have already run uoconvert
- ~/shard/data:/app/data
- ~/shard/realm:/app/realm
- ~/shard/config:/shard/config
- ../shard/:/shard
File renamed without changes.
28 changes: 21 additions & 7 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
#!/bin/bash

set -e

if [ ! -d ../shard ]; then
echo "Missing shard storage in parent directory"
exit 1
fi

ln -s -f ../shard/realm .
ln -s -f ../shard/data .

if [ ! -d ./realm/britannia ]; then
echo "Generating realm files as they do not exist"


ln -s -f "$(pwd)/../shard/client" setup/uo-client

pushd setup; ./generate_data_files.sh; popd

echo "Storing realm cfg in custom config directory"
cp -f config/multis.cfg /shard/config/
cp -f config/tiles.cfg /shard/config/
cp -f config/landtiles.cfg /shard/config/
cp -f config/multis.cfg ../shard/config/
cp -f config/tiles.cfg ../shard/config/
cp -f config/landtiles.cfg ../shard/config/
fi

if [ -n "${SERVER_EXTERNAL_IP}" ]; then
sed -i "s/--ip--/$SERVER_EXTERNAL_IP/g" /app/config/servers.cfg
sed -i "s/--ip--/$SERVER_EXTERNAL_IP/g" ./config/servers.cfg
echo "Server IP set to $SERVER_EXTERNAL_IP"
fi

if [ -d /shard/config ]; then
if [ -d ../shard/config ]; then
echo "Copying custom configs"
cp -f /shard/config/* /app/config/
cp -f ../shard/config/*.cfg ./config/
fi

cd /app && ./pol
./pol
File renamed without changes.
8 changes: 4 additions & 4 deletions scripts/misc/logon.src
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ program logon( who )
endif

start_script( "::playermanager", who );
if (getexistinglogons(who) == 1)
DisconnectClient(who);
return;
endif
// if (getexistinglogons(who) == 1)
// DisconnectClient(who);
// return;
// endif
endprogram
8 changes: 4 additions & 4 deletions scripts/misc/reconnect.src
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include "include/dotempmods";
include ":logon:logon";

program reconnect( who )

set_critical(1);
enableAosLBRClient(who);
JailCheck(who);
Expand All @@ -21,7 +21,7 @@ program reconnect( who )
start_script(":email:message", who);
endif
SetClasse(who);
if (getexistinglogons(who) == 1)
DisconnectClient(who);
endif
//if (getexistinglogons(who) == 1)
// DisconnectClient(who);
//endif
endprogram
2 changes: 1 addition & 1 deletion setup/config/servers.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
GameServer
{
Name ZH Australia
IP 139.180.168.57
IP --ip--
Port 5333
}
11 changes: 6 additions & 5 deletions setup/ecompile.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ModuleDirectory /app/scripts/modules
IncludeDirectory /app/scripts
PolScriptRoot /app/scripts
PackageRoot /app/pkg
PackageRoot /app/devpkg
ModuleDirectory ../scripts/modules
IncludeDirectory ../scripts
PolScriptRoot ../scripts
PackageRoot ../pkg
PackageRoot ../devpkg
GenerateListing 1
GenerateDebugInfo 0
GenerateDebugTextInfo 0
Expand All @@ -16,3 +16,4 @@ GenerateDependencyInfo 1
DisplayUpToDateScripts 0
ThreadedCompilation 4
ParanoiaWarnings 0
ErrorOnFileCaseMissmatch 1
6 changes: 3 additions & 3 deletions setup/generate_data_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ $BINARY landtiles
mv landtiles.cfg ../config/

# Non Mondain's Legacy use "width=6144" here
$BINARY map realm=britannia mapid=0 usedif=1 width=7168 height=4096
$BINARY map realm=britannia mapid=0 usedif=1 width=6144 height=4096
$BINARY statics realm=britannia
$BINARY maptile realm=britannia

mv -f realm/* ../realm/
echo "Only generating brit realm 1 for zha legacy"
exit 1
exit 0

# Non Mondain's Legacy use "width=6144" here
$BINARY map realm=britannia_alt mapid=1 usedif=1 width=7168 height=4096
$BINARY map realm=britannia_alt mapid=1 usedif=1 width=6144 height=4096
$BINARY statics realm=britannia_alt
$BINARY maptile realm=britannia_alt

Expand Down
2 changes: 1 addition & 1 deletion setup/pol.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# UoDataFileRoot: where the UO client files are located.
# Used by UOConvert.exe to find map, multi, tiledata, statics, etc. files.
#
UoDataFileRoot=/app/uo-client/
UoDataFileRoot=uo-client/


#
Expand Down

0 comments on commit 902f0f0

Please sign in to comment.