games:linux:2004scape_localhost
This is an old revision of the document!
Table of Contents
Information
Media
Prerequisites
Resources
Web
- Info post (Jul 3, 2024)
- Lost City Forums (Jan 14th, 2025)
Dependencies
sudo dnf install git nodejs-npm java-openjdk-headless
Download Source
cd ~ && mkdir -p ~/'Projects' && rm -Rf ~/'Projects/2004Scape-Server/src' && git clone --branch 'main' --depth '1' --recurse-submodules 'https://github.com/2004Scape/Server.git' ~/'Projects/2004Scape-Server/src' && sync
World Map
rm -f '/tmp/2004Scape-worldmap2.jpg' && mkdir -p ~/'Projects/2004Scape-Server/ext' && wget -O '/tmp/2004Scape-worldmap2.jpg' 'https://2004scape.org/img/rs2/worldmap/worldmap2.jpg' && mv -f '/tmp/2004Scape-worldmap2.jpg' ~/'Projects/2004Scape-Server/ext/worldmap2.jpg'
Initial Build
cd ~/'Projects/2004Scape-Server/src' && npm install --verbose
Settings
NODE_PORT=44594
seems like an easy fix to simultaneously-host 2009Scape
nano ~/'Projects/2004Scape-Server/src/.env'
WEB_PORT=8888 NODE_PORT=43594 NODE_PRODUCTION=false NODE_ALLOW_CHEATS=false NODE_DEBUG=false NODE_STAFF=Test
NODE_PORT=44594
Scripts
Server Start
mkdir -p ~/'Projects/2004Scape-Server/scripts' && nano ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh' && chmod +x ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'
#!/bin/bash cd ~/'Projects/2004Scape-Server/src' npm start # End
Server Update
mkdir -p ~/'Projects/2004Scape-Server/scripts' && nano ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh' && chmod +x ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh'
#!/bin/bash git -C ~/'Projects/2004Scape-Server/src' reset --hard git -C ~/'Projects/2004Scape-Server/src' pull origin 'main' --rebase cd ~/'Projects/2004Scape-Server/src' npm run 'clean' notify-send -i ~/'Projects/2004Scape-Server/src/public/favicon.ico' '2004Scape localhost server update complete' # End
Save Data Back-up
mkdir -p ~/'Projects/2004Scape-Server/scripts' && nano ~/'Projects/2004Scape-Server/scripts/localhost-save-backup.sh' && chmod +x ~/'Projects/2004Scape-Server/scripts/localhost-save-backup.sh'
#!/bin/bash tar -cvzf ~/'Downloads/'$(date +%Y-%m-%d-%s)'-2004Scape-Server-localhost-Saves.tar.gz' -C ~/'Projects/2004Scape-Server/src/data' 'players' sync notify-send -i ~/'Projects/2004Scape-Server/src/public/favicon.ico' '2004Scape Save Data Backed-up Successfully to Downloads' # End
Desktop Launcher
2004Scape
mkdir -p ~/'.local/share/applications' && nano ~/'.local/share/applications/2004Scape-localhost.desktop' && sed -i 's/'CHANGEME'/'$USER'/g' ~/'.local/share/applications/2004Scape-localhost.desktop' && update-desktop-database --quiet ~/'.local/share/applications'
[Desktop Entry] Name=2004Scape Categories=Game; Exec='/bin/bash' -c "gio open 'http://localhost:8888'" Type=Application StartupNotify=false Icon=/home/CHANGEME/Projects/2004Scape-Server/src/public/favicon.ico Actions=Map;Server;Saves;Update;Notes; [Desktop Action Map] StartupNotify=false Exec='/bin/bash' -c "gio open ~/'Projects/2004Scape-Server/ext/worldmap2.jpg'" Name=World map [Desktop Action Server] Exec='/bin/bash' -c "ptyxis --standalone --title='2004Scape Server — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'" Name=Launch Local Server [Desktop Action Saves] StartupNotify=false Exec='/bin/bash' -c "~/'Projects/2004Scape-Server/scripts/localhost-save-backup.sh'" Name=Save Data Back-up [Desktop Action Update] Exec='/bin/bash' -c "ptyxis --standalone --title='2004Scape Updater — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh'" Name=Update Local Server [Desktop Action Notes] StartupNotify=false Exec='/bin/bash' -c "gio open 'https://wiki.realmofespionage.xyz/games:linux:2004scape_localhost'" Name=Install Notes # End
Quick Commands
Execute
Server
cd ~/'Projects/2004Scape-Server/src' && npm start --verbose
~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'
ptyxis --standalone --title='2004Scape Server — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'
Client
Update
- Running
npm run clean
requires starting the server once afterwards with an internet connection to download packages to start the server for playing offline
git -C ~/'Projects/2004Scape-Server/src' reset --hard && git -C ~/'Projects/2004Scape-Server/src' pull origin 'main' --rebase && cd ~/'Projects/2004Scape-Server/src' && npm run 'clean'
~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh'
ptyxis --standalone --title='2004Scape Updater — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh'
Save Data Back-up
tar -cvzf ~/'Downloads/'$(date +%Y-%m-%d-%s)'-2004Scape-Server-localhost-Saves.tar.gz' -C ~/'Projects/2004Scape-Server/src/data' 'players'
~/'Projects/2004Scape-Server/scripts/localhost-save-backup.sh'
World Map
gio open ~/'Projects/2004Scape-Server/ext/worldmap2.jpg'
npm
cd ~/'Projects/2004Scape-Server/src' && npm run --verbose
cd ~/'Projects/2004Scape-Server/src' && npm run 'clean' --verbose
File Manager
Root
gio open ~/'Projects/2004Scape-Server/src'
Saves
mkdir -p ~/'Projects/2004Scape-Server/src/data/players' && gio open ~/'Projects/2004Scape-Server/src/data/players'
Troubleshooting
Specific Commit Rebase
git -C ~/'Projects/2004Scape-Server/src' reset --hard '42af1c2d152c9cfa174a49f56b51906d8a2c8374'
git -C ~/'Projects/2004Scape-Server/src' pull origin --rebase '42af1c2d152c9cfa174a49f56b51906d8a2c8374'
cd ~/'Projects/2004Scape-Server/src' && npm run 'clean'
C:/www/wiki/data/attic/games/linux/2004scape_localhost.1736978426.txt.gz · Last modified: by Sean Rhone