Move UncivServer to own module (and jar) (#6468)

* Move UncivServer to own module (and jar)

* UncivServer isalive logged

* Separate UncivServer - some wiki hints

* Separate UncivServer - how to build UncivServer.jar

Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
This commit is contained in:
SomeTroglodyte
2022-05-08 20:22:43 +02:00
committed by GitHub
parent 3ea9c6503b
commit 4290373cf1
12 changed files with 336 additions and 23 deletions

View File

@ -0,0 +1,46 @@
#!/bin/sh
CONFIG_DIR="$HOME/.local/share/Unciv"
USAGE="UncivServer [--help | -h | --config-dir PATH]
Run the Unciv Multiplayer Server.
With '--help' or '-h', show this help info and exit.
With '--config-dir PATH', use/make configuration files in PATH instead
of the default of '$CONFIG_DIR'.
"
usage() {
echo "$USAGE"
exit 0
}
fail() {
echo "Error: $1"
usage
exit 1
}
if [ "$#" -gt "0" ]; then
case "$1" in
--help|-h)
shift
usage
;;
--config-dir)
CONFIG_DIR="$2"
shift 2
;;
esac
shift
fi
if ! [ "$#" -eq "0" ]; then
fail "Unknown argument(s): $*"
fi
mkdir -p "$CONFIG_DIR"
cd "$CONFIG_DIR" || fail "Could not 'cd' to '$CONFIG_DIR'"
java -jar /usr/share/Unciv/UncivServer.jar