====== Information ====== * 2004Scape Server ((https://github.com/2004Scape/Server)) * 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/bfbfb8e5b34d53456058aa2f898ab11130977e49|bfbfb8e]] ===== Media ===== * [[https://www.youtube.com/watch?v=RFmbHS4w9mU|Desktop and Start Menu Shortcuts Presentation Video]] * [[https://media.realmofespionage.xyz/index/category/2|Progress Pics]] ===== Prerequisites ===== * [[windows:10|Windows 10 (21H2)]] * [[windows;notes;edge_tweaks|Microsoft Edge]] ===== Resources ===== * [[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://osrs.world/?cache=rs2-225_2004-05-18|OSRS Map Viewer]] (3D aerial view) * [[https://2004hq.com/|2004HQ]] ([[https://lostcity.rs/t/2004hq-a-runehq-2004-inspired-aio-website/5721|info]]) ====== Dependencies ====== * https://github.com/2004Scape/Server?tab=readme-ov-file#dependencies ===== Git ===== * https://gitforwindows.org/ * Last tested: ''Git-2.49.0-64-bit.exe'' * No components required * Git from the command line and also from 3rd-party software ===== Java ===== * https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-21 * Last tested: ''microsoft-jdk-21.0.7-windows-x64.msi'' * Entire feature install of ''Microsoft Build of OpenJDK'' ===== Node.js ===== * https://nodejs.org/en/download * Last tested: ''node-v22.15.0-x64.msi'' * ''[x]'' Node.js runtime * ''[ ]'' corepack manager * ''[x]'' npm package manager * ''[ ]'' Online documentation shortcuts * ''[~]'' Add to PATH * ''[x]'' Node.js and npm * ''[ ]'' npm modules * ''[ ]'' Automatically install the necessary tools. ====== Download Source ====== * https://github.com/2004Scape/Server/commits/main/ "%ProgramFiles%\Git\bin\git.exe" clone --branch "main" --depth "1" --recurse-submodules "https://github.com/2004Scape/Server.git" "%UserProfile%\Projects\2004Scape-Server\src" ====== Initial Build ====== **** CD "%UserProfile%\Projects\2004Scape-Server\src" && "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" install --verbose ====== Set-up ====== * Set up as a development world "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "setup" ====== Scripts ====== **** MKDIR "%UserProfile%\Projects\2004Scape-Server\scripts" ===== Server Start ===== "notepad.exe" "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-start.bat" @echo off "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "quickstart" :: End "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-start.bat" ===== Server Update ===== "notepad.exe" "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-update.bat" @echo off "%ProgramFiles%\Git\bin\git.exe" -C "%UserProfile%\Projects\2004Scape-Server\src" reset --hard "%ProgramFiles%\Git\bin\git.exe" -C "%UserProfile%\Projects\2004Scape-Server\src" pull origin "main" --rebase "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "clean" CD "%UserProfile%\Projects\2004Scape-Server\src" "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" install "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "setup" :: Custom SoundFont :: SF End "netsh.exe" advfirewall firewall delete rule name="2004Scape localhost Server (node.exe)" "netsh.exe" advfirewall firewall add rule name="2004Scape localhost Server (node.exe)" dir="in" action="block" profile="any" program="%ProgramFiles%\nodejs\node.exe" protocol="tcp" localport="80" :: End "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-update.bat" ===== Save Data Back-up ===== "notepad.exe" "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-save-backup.bat" @echo off "tar.exe" -czf "%UserProfile%\Downloads\%RANDOM%-2004Scape-Server-localhost-Saves.tar.gz" -C "%UserProfile%\Projects\2004Scape-Server\src\data\players" "main" :: End "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-save-backup.bat" ===== LAN Open ===== * Removes [[#sc55_zzdenis_soundfont|custom SoundFont]] and opens Firewall for LAN access "notepad.exe" "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-lan-prep.bat" @echo off "%ProgramFiles%\Git\bin\git.exe" -C "%UserProfile%\Projects\2004Scape-Server\src" reset --hard "%ProgramFiles%\Git\bin\git.exe" -C "%UserProfile%\Projects\2004Scape-Server\src" pull origin "main" --rebase "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "clean" CD "%UserProfile%\Projects\2004Scape-Server\src" "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" install "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "setup" "netsh.exe" advfirewall firewall delete rule name="2004Scape localhost Server (node.exe)" "netsh.exe" advfirewall firewall add rule name="2004Scape localhost Server (node.exe)" dir="in" action="allow" profile="any" program="%ProgramFiles%\nodejs\node.exe" protocol="tcp" localport="80" remoteip="localsubnet" :: End "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-lan-prep.bat" ====== Extras ====== **** MKDIR "%UserProfile%\Projects\2004Scape-Server\ext" ===== Map ===== * https://runescape.wiki/images/June_2004_Map.jpg?35d17 ([[https://runescape.wiki/w/World_map#/media/File:June_2004_Map.jpg|Source]]) * ''781,684 June_2004_Map.jpg'' "%UserProfile%\Projects\2004Scape-Server\ext\June_2004_Map.jpg" ===== Icon ===== * https://raw.githubusercontent.com/2004Scape/Server/7b0f1ec303dc1f76c7b29a2fff83b5797dafa01b/public/favicon.ico * ''9,662 favicon.ico'' "%UserProfile%\Projects\2004Scape-Server\ext\favicon.ico" ===== Save Back to Downloads ===== * For Firefox to go back to default ''Downloads'' folder after above downloads * https://raw.githubusercontent.com/2004Scape/Server/7b0f1ec303dc1f76c7b29a2fff83b5797dafa01b/public/favicon.ico "%UserProfile%\Downloads\favicon.ico" DEL /Q "%UserProfile%\Downloads\favicon.ico" ===== SC55_zzdenis SoundFont ===== * [[https://lostcity.rs/t/different-soundfonts-midi/4861|Lost City Forums]] ([[https://www.youtube.com/watch?v=mVPLVDXJjUY|Video]]) * 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 * ''298,185,428 SC55_zzdenis_v0.5.sf2'' * :!: Increases browser RAM usage notably ((''msedge_proxy.exe'' does ''1.1GB'')) MOVE /Y "%UserProfile%\Downloads\SC55_zzdenis_v0.5.sf2" "%UserProfile%\Projects\2004Scape-Server\ext" DEL /Q "%UserProfile%\Projects\2004Scape-Server\src\public\client\SCC1_Florestan.sf2" && MKLINK "%UserProfile%\Projects\2004Scape-Server\src\public\client\SCC1_Florestan.sf2" "%UserProfile%\Projects\2004Scape-Server\ext\SC55_zzdenis_v0.5.sf2" ==== Update Script ==== * Add below ''Custom SoundFont'' line "notepad.exe" "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-update.bat" :: SC55_zzdenis_v0.5.sf2 DEL /Q "%UserProfile%\Projects\2004Scape-Server\src\public\client\SCC1_Florestan.sf2" MKLINK "%UserProfile%\Projects\2004Scape-Server\src\public\client\SCC1_Florestan.sf2" "%UserProfile%\Projects\2004Scape-Server\ext\SC55_zzdenis_v0.5.sf2" :: End ====== Launcher Shortcuts ====== ===== Desktop ===== * Right-click Desktop -> New -> Shortcut ==== Server Start ==== "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-start.bat" 2004Scape Server ==== Client ==== "%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge_proxy.exe" --proxy-server="localhost:80" --kiosk --edge-kiosk-type="public-browsing" --new-window --window-size="830,640" --app="http://localhost:80/rs2.cgi" 2004Scape === Icon === **** "%UserProfile%\Projects\2004Scape-Server\ext\favicon.ico" ===== Start Menu ===== * Right-click -> New -> Shortcut MKDIR "%AppData%\Microsoft\Windows\Start Menu\Programs\2004Scape" "explorer.exe" "%AppData%\Microsoft\Windows\Start Menu\Programs\2004Scape" ==== Server Start ==== "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-start.bat" Server Start ==== Client ==== "%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge_proxy.exe" --proxy-server="localhost:80" --kiosk --edge-kiosk-type="public-browsing" --new-window --window-size="830,640" --app="http://localhost:80/rs2.cgi" 2004Scape (localhost) === Icon === **** "%UserProfile%\Projects\2004Scape-Server\ext\favicon.ico" ==== Update ==== "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-update.bat" Updater ==== Save Backup ==== "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-save-backup.bat" Save Back-up ==== Save Folder ==== MKDIR "%UserProfile%\Projects\2004Scape-Server\src\data\players" "%UserProfile%\Projects\2004Scape-Server\src\data\players" Save Folder ==== LAN Open ==== "%UserProfile%\Projects\2004Scape-Server\scripts\localhost-server-lan-prep.bat" Updater (LAN) ==== Commits Check ==== "https://github.com/2004Scape/Server/commits/main/" Updates Check ==== World Map ==== "%UserProfile%\Projects\2004Scape-Server\ext\June_2004_Map.jpg" World Map ==== Install Notes ==== "https://wiki.realmofespionage.xyz/games;windows;2004scape_localhost" Install Notes ====== Quick Commands ====== ===== Execute ===== ==== Server ==== **** "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "quickstart" --verbose ==== Client ==== * http://localhost:80/rs2.cgi "%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge_proxy.exe" --proxy-server="localhost:80" --kiosk --edge-kiosk-type="public-browsing" --new-window --window-size="830,640" --app="http://localhost:80/rs2.cgi" ===== Update ===== * https://github.com/2004Scape/Server/commits/main/ "%ProgramFiles%\Git\bin\git.exe" -C "%UserProfile%\Projects\2004Scape-Server\src" reset --hard && "%ProgramFiles%\Git\bin\git.exe" -C "%UserProfile%\Projects\2004Scape-Server\src" pull origin "main" --rebase && "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "clean" --verbose && "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" "ci" --verbose && "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "setup" --verbose ===== Save Data Back-up ===== * :!: The ''tar'' command replaces ''Downloads\2004Scape-Server-localhost-Saves.tar.gz'' each time without back-up or date codes "explorer.exe" "%UserProfile%\Projects\2004Scape-Server\src\data\players" "tar.exe" -cvzf "%UserProfile%\Downloads\2004Scape-Server-localhost-Saves.tar.gz" -C "%UserProfile%\Projects\2004Scape-Server\src\data\players" "main" ===== Firewall ===== ==== Block ==== **** "netsh.exe" advfirewall firewall add rule name="2004Scape localhost Server (node.exe)" dir="in" action="block" profile="any" program="%ProgramFiles%\nodejs\node.exe" protocol="tcp" localport="80" ==== LAN ==== * Allows loading the game applet/connecting on other devices on LAN ((2024/11/09: Works on Xbox One Edge with physical keyboard for log-in; controller works in-game flawlessly; :?: may work better 2025 with touch/phone improvements)) * :!: Can't have above block rule enabled at the same time "netsh.exe" advfirewall firewall add rule name="2004Scape localhost Server (node.exe)" dir="in" action="allow" profile="any" program="%ProgramFiles%\nodejs\node.exe" protocol="tcp" localport="80" remoteip="localsubnet" ==== Delete Rule ==== **** "netsh.exe" advfirewall firewall delete rule name="2004Scape localhost Server (node.exe)" ===== npm ===== * Lists available ''npm'' commands "%ProgramFiles%\nodejs\node.exe" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run CD "%UserProfile%\Projects\2004Scape-Server\src" && npm run ===== File Manager ===== ==== Save Data ==== * :?: Restoring a ''.sav'' may require logging in once to Tutorial Island, logging out, then re-restoring the ''.sav'' MKDIR "%UserProfile%\Projects\2004Scape-Server\src\data\players\main" "explorer.exe" "%UserProfile%\Projects\2004Scape-Server\src\data\players" ====== Tests ====== ===== Auto Log-in ===== * https://github.com/2004Scape/Server/issues/1498 * :?: Looks settable in update scripts with ''sed'' Linux/FreeBSD * //Technically// 2-click log-in "%ProgramFiles%\Notepad++\notepad++.exe" "%UserProfile%\Projects\2004Scape-Server\src\public\client\client.js" usernameInput="";passwordInput=""; usernameInput="Espionage724";passwordInput="1" ===== Settings ===== * :!: It matters where ''--env-file='' is (Node vs npm), but unknown if all envs are Node-specific or if any apply to npm * Last commit: [[https://github.com/2004Scape/Server/commit/9b8c91ab21edc1a370216cd1322e5456031d7a81|January 12, 2025]] ''9b8c91a'' * [[https://github.com/2004Scape/Server/commits/main/.env.example|New commits check]] * [[https://github.com/2004Scape/Server/blob/main/.env.example|Upstream Settings]] ([[https://raw.githubusercontent.com/2004Scape/Server/refs/heads/main/.env.example|raw]]) * 2025/05/12: Settings below not tested MKDIR "%UserProfile%\Projects\2004Scape-Server\conf" notepad "%UserProfile%\Projects\2004Scape-Server\conf\localhost.env" WEB_PORT=80 NODE_PRODUCTION=false NODE_ALLOW_CHEATS=false NODE_DEBUG=false NODE_STAFF=Test # End * ''node.exe --env-file='' (not after ''npm-cli.js'') * :?: ''npm run start'' works, comes from old notes, but ''npm run quickstart'' was switched to upstream "%ProgramFiles%\nodejs\node.exe" --env-file="%UserProfile%\Projects\2004Scape-Server\conf\localhost.env" "%ProgramFiles%\nodejs\node_modules\npm\bin\npm-cli.js" --prefix "%UserProfile%\Projects\2004Scape-Server\src" run "start" --verbose