From f89947f604e1a4d423132a140548a1bb33f45920 Mon Sep 17 00:00:00 2001 From: vddCore Date: Tue, 10 Jan 2023 17:07:51 +0100 Subject: [PATCH] update gitignore, add linux launch script --- .gitignore | 7 +++++++ launch.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 launch.sh diff --git a/.gitignore b/.gitignore index 2a8b9b4..a2864ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,9 @@ **/.idea db/data + +game/data/global_kill_stats.json +game/data/eco/grandexchange.db + +game/data/logs/ +game/data/players/ +game/data/serverstore/ diff --git a/launch.sh b/launch.sh new file mode 100755 index 0000000..43be26b --- /dev/null +++ b/launch.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +export _JAVA_OPTIONS= +SCRIPT_DIR=$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P) + +lsof -i:43595 + +if [ $? -ne 1 ]; then + echo "Something is already listening on port 43595. Cannot start the server." + exit +fi + +cd $SCRIPT_DIR/game +java -jar -Xmx2G -Xms2G -jar server.jar & +SERVER_PID=$! + +lsof -i:43595 +while [ $? -eq 1 ]; do + lsof -i:43595 + echo "Still waiting for the server to start..." + sleep 2 +done; + +java -Xmx1G -Xms1G -jar client.jar & +CLIENT_PID=$! + +wait $CLIENT_PID +kill $SERVER_PID +exit +