update gitignore, add linux launch script

This commit is contained in:
vddCore 2023-01-10 17:07:51 +01:00
parent 89140083b7
commit f89947f604
2 changed files with 37 additions and 0 deletions

7
.gitignore vendored
View file

@ -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/

30
launch.sh Executable file
View file

@ -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