This repository contains scripts for managing the 2011Scape game server and file server. The scripts are installed in the /opt/2011Scape directory.
Before using these scripts, you need to install the following dependencies:
sudo apt update
sudo apt install openjdk-11-jdk -ysudo mkdir /opt/gradle
sudo wget https://services.gradle.org/distributions/gradle-7.2-bin.zip -P /tmp
sudo unzip -d /opt/gradle /tmp/gradle-7.2-bin.zip
sudo ln -s /opt/gradle/gradle-7.2/bin/gradle /usr/bin/gradlesudo apt install git -y- Clone the server management repository with the
--recursiveoption to automatically initialize and clone the submodules:
sudo git clone --recursive https://github.com/2011Scape/2011scape-linux-server-management.git /opt/2011Scape- Ensure that the scripts are executable by running the following command:
sudo chmod +x /opt/2011Scape/*.shTo start the game server, run the game-server.sh script:
/opt/2011Scape/game-server.shThis script will start a new screen session named "game-server" and run the game server in that session. The game server will be started in the /opt/2011Scape/game/ directory, and the ./gradlew game:run build -x test command will be executed.
To start the file server, run the file-server.sh script:
/opt/2011Scape/file-server.shThis script will start a new screen session named "file-server" and run the file server in that session. The file server will be started in the /opt/2011Scape/file-server/ directory, and the ./gradlew run command will be executed.
To update the game server, follow these steps:
- Run the
backup.shscript to create a backup of the player files, cache, and xteas:
/opt/2011Scape/backup.sh- Run the
update-game.shscript to update the game server:
/opt/2011Scape/update-game.shThis script will attempt to compile the updated game server code. If there are any issues with compiling, follow these steps:
- Remove the existing
gamedirectory:
sudo rm -rf /opt/2011Scape/game- Re-clone the
gamesubmodule:
cd /opt/2011Scape
sudo git submodule update --init --recursive- Run the
restore.shscript to restore the player files, cache, and xteas from the backup:
/opt/2011Scape/restore.sh- The
restart.shscript will run automatically after a successful update to restart the game server.
To restart the game server manually, run the restart.sh script:
/opt/2011Scape/restart.shThis script will check if a screen session named "game-server" exists. If the session exists, it will send a Ctrl+C command to gracefully stop the server, wait for 5 seconds, and then kill the session. After terminating the existing session, the script will start a new "game-server" session and run the game server in that session, similar to the game-server.sh script.
- To attach to the "game-server" or "file-server"
screensessions, runscreen -r game-serverorscreen -r file-server, respectively. - This will allow you to view the output of the servers and interact with them if needed.
- To detach from a
screensession, pressCtrl+Afollowed byCtrl+D. - If you need to stop the game server or file server manually, attach to the respective
screensession and send aCtrl+Ccommand to stop the process gracefully.
Note: These scripts assume that the necessary dependencies and configurations are already in place for running the game server and file server. Make sure to set up the required environments and configurations before using these scripts.