| |
games:linux:2004scape_localhost [2025/01/17 16:01] – [Media] Sean Rhone | games:linux:2004scape_localhost [2025/05/16 21:39] (current) – external edit 127.0.0.1 |
---|
| |
* These notes provide a local single-player server for 2004Scape ((RSPS/RuneScape Private Server based on cache ''225'' from May 18th, 2004)) | * These notes provide a local single-player server for 2004Scape ((RSPS/RuneScape Private Server based on cache ''225'' from May 18th, 2004)) |
| * Last tested commit: [[https://github.com/2004Scape/Server/commit/402159840ef48b990b1e8ac2ea20aaec16e9e3f5|4021598]] |
| |
===== Media ===== | ===== Media ===== |
===== Prerequisites ===== | ===== Prerequisites ===== |
| |
* [[linux;distros;fedora_workstation_gnome|Fedora Workstation]] | * [[linux;distros;opensuse_tumbleweed_gnome|openSUSE Tumbleweed (GNOME)]] |
| |
===== Resources ===== | ===== Resources ===== |
| |
* [[https://2004scape.org/img/rs2/worldmap/worldmap2.jpg|World Map]] | |
* [[https://2004scape.org/rs2/skills|Skills]] | |
* [[https://2004scape.org/rs2/quests|Quests]] | |
| |
==== Web ==== | |
| |
* [[https://lostcity.rs/t/singleplayer-main-branch-scripts-and-desktop-start-launchers-on-windows-linux-freebsd/54|Lost City Forums]] | * [[https://lostcity.rs/t/singleplayer-main-branch-scripts-and-desktop-start-launchers-on-windows-linux-freebsd/54|Lost City Forums]] |
| * [[https://2004.lostcity.rs/worldmap|World Map]] (interactive) |
| * [[https://github.com/2004Scape/Server/wiki/FAQ|FAQ]] |
| |
* [[https://2004scape.org/news|News]] | * [[https://2004hq.com/|2004HQ]] ([[https://lostcity.rs/t/2004hq-a-runehq-2004-inspired-aio-website/5721|info]]) |
* [[https://rune-server.org/threads/lost-city-225-emulation.701698/|Rune-Server Forums]] | |
| |
====== Dependencies ====== | ====== Dependencies ====== |
* https://github.com/2004Scape/Server?tab=readme-ov-file#dependencies | * https://github.com/2004Scape/Server?tab=readme-ov-file#dependencies |
| |
sudo dnf install git nodejs-npm java-openjdk-headless | sudo zypper install git-core java-21-openjdk-headless nodejs22 npm22 |
| |
====== Download Source ====== | ====== 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 | 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 ===== | |
| |
* https://www.2004scape.org/img/rs2/worldmap/worldmap2.jpg | |
| |
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 ====== | ====== Initial Build ====== |
cd ~/'Projects/2004Scape-Server/src' && npm install --verbose | cd ~/'Projects/2004Scape-Server/src' && npm install --verbose |
| |
====== Settings ====== | ====== Set-up ====== |
| |
* https://github.com/2004Scape/Server/blob/main/.env.example | **** |
* ''NODE_PORT=44594'' seems like an easy fix to simultaneously-host [[servers:linux:games:2009scape_localhost|2009Scape]] | |
| |
nano ~/'Projects/2004Scape-Server/src/.env' | npm --prefix ~/'Projects/2004Scape-Server/src' run 'setup' |
| |
<code> | |
WEB_PORT=8888 | |
NODE_PORT=43594 | |
NODE_PRODUCTION=false | |
NODE_ALLOW_CHEATS=false | |
NODE_DEBUG=false | |
NODE_STAFF=Test</code> | |
| |
<code>NODE_PORT=44594</code> | |
| |
====== Scripts ====== | ====== Scripts ====== |
| |
===== Server Start ===== | ===== Server Start ===== |
| |
* [[#desktop_launcher|Desktop Action Server]] | |
| |
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' | 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 | #!/bin/bash |
| |
cd ~/'Projects/2004Scape-Server/src' | npm --prefix ~/'Projects/2004Scape-Server/src' run 'quickstart' |
npm start | |
| |
# End</code> | # End</code> |
| |
===== Server Update ===== | ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh' |
| |
* [[#desktop_launcher|Desktop Action Update]] | ===== 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' | 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' |
git -C ~/'Projects/2004Scape-Server/src' pull origin 'main' --rebase | git -C ~/'Projects/2004Scape-Server/src' pull origin 'main' --rebase |
| |
cd ~/'Projects/2004Scape-Server/src' | npm --prefix ~/'Projects/2004Scape-Server/src' run 'clean' |
npm run 'clean' | npm --prefix ~/'Projects/2004Scape-Server/src' install |
| npm --prefix ~/'Projects/2004Scape-Server/src' run 'setup' |
| |
notify-send -i ~/'Projects/2004Scape-Server/src/public/favicon.ico' '2004Scape localhost server update complete' | zenity --title '2004Scape Updater' --text 'localhost server update complete' --icon ~/'Projects/2004Scape-Server/ext/favicon.ico' --timeout '2' --info |
| |
# End</code> | # End</code> |
| |
| ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh' |
| |
===== Save Data Back-up ===== | ===== Save Data Back-up ===== |
| |
* [[#desktop_launcher|Desktop Action Saves]] | |
| |
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' | 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 | #!/bin/bash |
| |
tar -cvzf ~/'Downloads/'$(date +%Y-%m-%d-%s)'-2004Scape-Server-localhost-Saves.tar.gz' -C ~/'Projects/2004Scape-Server/src/data' 'players' | tar -czf ~/'Downloads/'$(date +%Y-%m-%d-%s)'-2004Scape-Server-localhost-Saves.tar.gz' -C ~/'Projects/2004Scape-Server/src/data/players' 'main' |
sync | |
notify-send -i ~/'Projects/2004Scape-Server/src/public/favicon.ico' '2004Scape Save Data Backed-up Successfully to Downloads' | zenity --title '2004Scape Save Backup' --text 'Save Data Backed-up to Downloads' --icon ~/'Projects/2004Scape-Server/ext/favicon.ico' --timeout '2' --info |
| |
# End</code> | # End</code> |
| |
| ~/'Projects/2004Scape-Server/scripts/localhost-save-backup.sh' |
| |
| ====== Extras ====== |
| |
| ===== Icon ===== |
| |
| * https://raw.githubusercontent.com/2004Scape/Server/7b0f1ec303dc1f76c7b29a2fff83b5797dafa01b/public/favicon.ico |
| |
| 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' && sha384sum '/tmp/2004Scape-favicon.ico' | grep 'c70ef71357951b3c1895cf205746eb93959cf8031d1f83b6f43d8a9efbb272d79ed6b4a64fb1c39f6898ed56601bfc63' > '/dev/null' && mv -f '/tmp/2004Scape-favicon.ico' ~/'Projects/2004Scape-Server/ext/favicon.ico' && ls ~/'Projects/2004Scape-Server/ext/favicon.ico' |
| |
| ===== Map ===== |
| |
| * https://runescape.wiki/w/World_map#/media/File:June_2004_Map.jpg |
| |
| rm -f '/tmp/June_2004_Map.jpg' && mkdir -p ~/'Projects/2004Scape-Server/ext' && wget -O '/tmp/June_2004_Map.jpg' 'https://runescape.wiki/images/June_2004_Map.jpg?35d17' && sha384sum '/tmp/June_2004_Map.jpg' | grep 'abfdfe4597975addbb9d79d2cce2e56f0054f2742f351bd9dc700f55e91157e6c2142749f113927b027ed42efb8ad833' > '/dev/null' && mv -f '/tmp/June_2004_Map.jpg' ~/'Projects/2004Scape-Server/ext/June_2004_Map.jpg' && ls ~/'Projects/2004Scape-Server/ext/June_2004_Map.jpg' |
| |
| ===== SC55_zzdenis SoundFont ===== |
| |
| * https://www.doomworld.com/forum/topic/129928-new-sc55-soundfont-266mb-all-new-441k-samples/ |
| * https://drive.google.com/file/d/1wdYpwoCka8r7ZuIzPn1CHy13_4aP9oSq/view?usp=sharing |
| * ''SC55_zzdenis_v0.5.sf2'' |
| * Add symlink above ''zenity'' in [[#server_update|Update script]] |
| |
| mkdir -p ~/'Projects/2004Scape-Server/ext' && sha384sum ~/'Downloads/SC55_zzdenis_v0.5.sf2' | grep 'f386f638777072fc220e39afbd7efcd227ca2bfcf13403bf47fbb2e2b8f4d151239710cc36c8530a75c3b4c3f55066b7' > '/dev/null' && mv -f ~/'Downloads/SC55_zzdenis_v0.5.sf2' ~/'Projects/2004Scape-Server/ext' |
| |
| nano ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh' |
| |
| ln -s -f ~/'Projects/2004Scape-Server/ext/SC55_zzdenis_v0.5.sf2' ~/'Projects/2004Scape-Server/src/public/client/SCC1_Florestan.sf2' |
| |
| ls -la ~/'Projects/2004Scape-Server/src/public/client/SCC1_Florestan.sf2' |
| |
====== Desktop Launcher ====== | ====== Desktop Launcher ====== |
Name=2004Scape | Name=2004Scape |
Categories=Game; | Categories=Game; |
Exec='/bin/bash' -c "gio open 'http://localhost:8888'" | Exec='/bin/bash' -c "gio open 'http://localhost:8888/rs2.cgi'" |
Type=Application | Type=Application |
StartupNotify=false | StartupNotify=false |
Icon=/home/CHANGEME/Projects/2004Scape-Server/src/public/favicon.ico | Icon=/home/CHANGEME/Projects/2004Scape-Server/ext/favicon.ico |
Actions=Map;Server;Saves;Update;Notes; | Actions=Map;Server;Update;Saves-Backup;Saves-Folder;Commits;Notes; |
| |
[Desktop Action Map] | [Desktop Action Map] |
StartupNotify=false | StartupNotify=false |
Exec='/bin/bash' -c "gio open ~/'Projects/2004Scape-Server/ext/worldmap2.jpg'" | Exec='/bin/bash' -c "gio open ~/'Projects/2004Scape-Server/ext/June_2004_Map.jpg'" |
Name=World map | Name=World Map |
| |
[Desktop Action Server] | [Desktop Action Server] |
Exec='/bin/bash' -c "ptyxis --standalone --title='2004Scape Server — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'" | Exec='/bin/bash' -c "kgx -T '2004Scape Server' -e ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'" |
Name=Launch Local Server | Name=Server - Start |
| |
[Desktop Action Saves] | [Desktop Action Update] |
| Exec='/bin/bash' -c "kgx -T '2004Scape Updater' -e ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh'" |
| Name=Server - Update |
| |
| [Desktop Action Saves-Backup] |
StartupNotify=false | StartupNotify=false |
Exec='/bin/bash' -c "~/'Projects/2004Scape-Server/scripts/localhost-save-backup.sh'" | Exec='/bin/bash' -c "~/'Projects/2004Scape-Server/scripts/localhost-save-backup.sh'" |
Name=Save Data Back-up | Name=Save Data Back-up |
| |
[Desktop Action Update] | [Desktop Action Saves-Folder] |
Exec='/bin/bash' -c "ptyxis --standalone --title='2004Scape Updater — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh'" | StartupNotify=false |
Name=Update Local Server | Exec='/bin/bash' -c "gio open ~/'Projects/2004Scape-Server/src/data/players'" |
| Name=Save Folder |
| |
| [Desktop Action Commits] |
| StartupNotify=false |
| Exec='/bin/bash' -c "gio open 'https://github.com/2004Scape/Server/commits/main/'" |
| Name=Commits Check |
| |
[Desktop Action Notes] | [Desktop Action Notes] |
===== Execute ===== | ===== Execute ===== |
| |
==== Server ==== | * http://localhost:8888/rs2.cgi |
| |
cd ~/'Projects/2004Scape-Server/src' && npm start --verbose | cd ~/'Projects/2004Scape-Server/src' && npm run 'quickstart' --verbose |
| |
~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh' | |
| |
ptyxis --standalone --title='2004Scape Server — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh' | |
| |
==== Client ==== | |
| |
* http://localhost:8888 | |
| |
===== Update ===== | ===== Update ===== |
| |
* https://github.com/2004Scape/Server/commits/main/ | * https://github.com/2004Scape/Server/commits/main/ |
* :!: 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' | git -C ~/'Projects/2004Scape-Server/src' reset --hard && git -C ~/'Projects/2004Scape-Server/src' pull origin 'main' --rebase && npm --prefix ~/'Projects/2004Scape-Server/src' run 'clean' --verbose && npm --prefix ~/'Projects/2004Scape-Server/src' install --verbose && npm --prefix ~/'Projects/2004Scape-Server/src' run 'setup' --verbose |
| |
~/'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 ===== | ===== 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' | tar -cvzf ~/'Downloads/'$(date +%Y-%m-%d-%s)'-2004Scape-Server-localhost-Saves.tar.gz' -C ~/'Projects/2004Scape-Server/src/data/players' 'main' |
| |
===== World Map ===== | ===== File Manager ===== |
| |
* https://2004scape.org/img/rs2/worldmap/worldmap2.jpg | ==== Save Data ==== |
| |
gio open ~/'Projects/2004Scape-Server/ext/worldmap2.jpg' | * :?: Restoring a ''.sav'' may require logging in once to Tutorial Island, logging out, then re-restoring the ''.sav'' |
| |
==== npm ==== | mkdir -p ~/'Projects/2004Scape-Server/src/data/players' && gio open ~/'Projects/2004Scape-Server/src/data/players' |
| |
cd ~/'Projects/2004Scape-Server/src' && npm run --verbose | ===== Other Terminals ===== |
| |
cd ~/'Projects/2004Scape-Server/src' && npm run 'clean' --verbose | '/bin/bash' -c "gnome-terminal --window -t '2004Scape — Server' -- bash -c ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'" |
| |
===== File Manager ===== | '/bin/bash' -c "konsole -p tabtitle='2004Scape localhost Server' -e ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'" |
| |
==== Root ==== | '/bin/bash' -c "ptyxis --standalone --title='2004Scape Server — ' -- ~/'Projects/2004Scape-Server/scripts/localhost-server-start.sh'" |
| |
**** | '/bin/bash' -c "xfce4-terminal -T '2004Scape — Updater' -I ~/'Projects/2004Scape-Server/ext/favicon.ico' -e ~/'Projects/2004Scape-Server/scripts/localhost-server-update.sh'" |
| |
gio open ~/'Projects/2004Scape-Server/src' | |
| |
==== Saves ==== | |
| |
**** | |
| |
mkdir -p ~/'Projects/2004Scape-Server/src/data/players' && gio open ~/'Projects/2004Scape-Server/src/data/players' | |
| |
====== Troubleshooting ====== | ====== Troubleshooting ====== |