User Tools

Site Tools


games:linux:2004scape_localhost

This is an old revision of the document!


Information

  • 2004Scape Server 1)
  • These notes provide a local single-player server for 2004Scape 2)

Media

Prerequisites

Resources

Web

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

Extras

Icon

rm -f '/tmp/2004Scape-favicon.ico' && mkdir -p ~/'Projects/2004Scape-Server/ext' && wget -O '/tmp/2004Scape-favicon.ico' 'https://raw.githubusercontent.com/2004Scape/Server/7b0f1ec303dc1f76c7b29a2fff83b5797dafa01b/public/favicon.ico' && mv -f '/tmp/2004Scape-favicon.ico' ~/'Projects/2004Scape-Server/ext/favicon.ico'

World Map

rm -f '/tmp/2004Scape-worldmap2.jpg' && mkdir -p ~/'Projects/2004Scape-Server/ext' && wget -O '/tmp/2004Scape-worldmap2.jpg' 'https://2004.lostcity.rs/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

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/ext/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 -czf ~/'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/ext/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/ext/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

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'
2)
RSPS/RuneScape Private Server based on cache 225 from May 18th, 2004
C:/www/wiki/data/attic/games/linux/2004scape_localhost.1737454581.txt.gz · Last modified: by Sean Rhone