| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| games:bsd:wine:2004scape_localhost [2024/10/03 17:10] – [Java] Sean Rhone | games:bsd:wine:2004scape_localhost [2024/11/21 17:44] (current) – Works fine without Wine now Sean Rhone |
|---|
| <code> | |
| |
| cd ~ && mkdir -p ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server' && rm -Rf ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && git clone --branch 'main' --depth '1' --recurse-submodules 'https://github.com/2004Scape/Server.git' ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && sync | |
| |
| cd ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && WINEPREFIX=~/'.wine/2004Scape-Server' WEB_PORT='8888' wine npm start --verbose | |
| </code> | |
| |
| ====== Information ====== | |
| |
| * 2004Scape Server ((https://github.com/2004Scape/Server)) | |
| * :!: ''no-dev-watcher'' Branch ((https://github.com/2004Scape/Server/tree/no-dev-watcher)) | |
| |
| * These notes provide a local singleplayer server for 2004Scape ((RSPS/RuneScape Private Server based on cache ''225'' from May 18th, 2004)) on FreeBSD 14.1 ((Server runs in Wine)) | |
| * :!: 2024/10/03: This works but notes are messy | |
| |
| ===== Prerequisites ===== | |
| |
| * [[bsd:freebsd_14.1_xfce|FreeBSD 14.1 (Xfce)]] | |
| |
| ===== Resources ===== | |
| |
| * [[https://www.2004scape.org/img/rs2/worldmap/worldmap2.jpg|World Map]] | |
| |
| ==== Web ==== | |
| |
| * [[https://github.com/2004scape/Server/wiki/Feature-Complete-Progress|Feature Complete Progress]] | |
| * [[https://github.com/orgs/2004Scape/projects/3|Progress - Quests]] | |
| * [[https://github.com/orgs/2004Scape/projects?query=is%3Aopen|Projects List]] | |
| |
| * [[https://rune-server.org/threads/lost-city-225-emulation.701698/|Rune-Server Forums]] | |
| * [[https://rune-server.org/threads/lost-city-225-emulation.701698/page-4#post-5805881|Info post]] (Jul 3, 2024) | |
| |
| ====== Dependencies ====== | |
| |
| * https://github.com/2004Scape/Server?tab=readme-ov-file#getting-started | |
| * https://github.com/2004Scape/Server?tab=readme-ov-file#environment-dependencies | |
| |
| * 2024/10/03: Git (native), Java (win64), NodeJS (win64) | |
| |
| ===== Git ===== | |
| |
| su -l | |
| |
| pkg install git-lite | |
| |
| ===== Java ===== | |
| |
| * https://adoptium.net/temurin/releases/?os=windows&arch=x64&version=23 | |
| * Last tested: 2024/10/03: ''OpenJDK23U-jdk_x64_windows_hotspot_23_37.msi'' | |
| * All users, all-defaults | |
| |
| ~/Downloads/OpenJDK23U-jdk_x64_windows_hotspot_23_37.msi | |
| |
| ==== Install ==== | |
| |
| **** | |
| |
| WINEPREFIX=~/'.wine/2004Scape-Server' WINEARCH='win64' wine ~/'Downloads/OpenJDK23U-jdk_x64_windows_hotspot_23_37.msi' | |
| |
| ===== Node.js ===== | |
| |
| * https://nodejs.org/en/download/prebuilt-installer | |
| * Last tested: 2024/10/03: ''node-v22.9.0-x64.msi'' | |
| |
| ~/Downloads/node-v22.9.0-x64.msi | |
| |
| ==== Install ==== | |
| |
| * Node.js runtime, npm package manager, Add to PATH (corepack manager and Online documentation not required) | |
| * Tools for Native Modules not required (leave "Automatically install the tools" unchecked) | |
| |
| WINEPREFIX=~/'.wine/2004Scape-Server' WINEARCH='win64' wine ~/'Downloads/node-v22.9.0-x64.msi' | |
| |
| ====== Download Source ====== | |
| |
| cd ~ && mkdir -p ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server' && rm -Rf ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && git clone --branch 'no-dev-watcher' --depth '1' --recurse-submodules 'https://github.com/2004Scape/Server.git' ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && sync | |
| |
| gio open ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' | |
| |
| ====== Extra Deps ====== | |
| |
| * :!: 2024/10/03: Requires manually moving files | |
| |
| ===== npm Deps ===== | |
| |
| * This is expected to fail at first | |
| |
| cd ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && WINEPREFIX=~/'.wine/2004Scape-Server' WEB_PORT='8888' wine npm start --verbose | |
| |
| ===== bcrypt ===== | |
| |
| * https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.1.1/bcrypt_lib-v5.1.1-napi-v3-win32-x64-unknown.tar.gz | |
| * Extract from ''tar.gz''; ''napi-v3'' folder goes into ''binding'' folder | |
| |
| mkdir -p ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src/node_modules/bcrypt/lib/binding' | |
| |
| gio open ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src/node_modules/bcrypt/lib/binding' | |
| |
| ls ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' | |
| |
| ===== Runescript Compiler ===== | |
| |
| * https://github.com/2004Scape/RuneScriptCompiler/releases/download/19/RuneScriptCompiler.jar | |
| * Move ''RuneScriptCompiler.jar'' to ''src'' root | |
| |
| gio open ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' | |
| |
| ls ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src/RuneScriptCompiler.jar' | |
| |
| ===== npm ===== | |
| |
| cd ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && WINEPREFIX=~/'.wine/2004Scape-Server' WEB_PORT='8888' wine npm run clean --verbose | |
| |
| cd ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && WINEPREFIX=~/'.wine/2004Scape-Server' WEB_PORT='8888' wine npm run build --verbose | |
| |
| ====== Quick Commands ====== | |
| |
| ===== Execute ===== | |
| |
| ==== Server ==== | |
| |
| **** | |
| |
| cd ~/'.wine/2004Scape-Server/drive_c/2004Scape-Server/src' && WINEPREFIX=~/'.wine/2004Scape-Server' WEB_PORT='8888' wine npm run clean --verbose | |
| |
| ==== Client ==== | |
| |
| * http://localhost:8888 | |
| * :!: Everything below TODO | |
| |
| ===== Update ===== | |
| |
| * 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 "%UserProfile%\Projects\2004scape-server\src" reset --hard && git -C "%UserProfile%\Projects\2004scape-server\src" pull origin "main" --rebase && CD "%UserProfile%\Projects\2004scape-server\src\" && npm run "clean" | |
| |
| "%UserProfile%\Projects\2004scape-server\scripts\localhost-server-update.bat" | |
| |
| ===== Save Data ===== | |
| |
| ==== Back-up ==== | |
| |
| * :!: The ''tar'' command replaces ''Downloads\2004Scape-Server-localhost-Saves.tar.gz'' each time without back-up or date codes | |
| |
| explorer "%UserProfile%\Projects\2004scape-server\src\data\players\" | |
| |
| tar -cvzf "%UserProfile%\Downloads\2004Scape-Server-localhost-Saves.tar.gz" -C "%UserProfile%\Projects\2004scape-server\src\data" "players" | |
| |
| "%UserProfile%\Projects\2004scape-server\scripts\localhost-save-backup.bat" | |
| |
| ==== Restore ==== | |
| |
| * Expects ''Downloads\2004Scape-Server-localhost-Saves.tar.gz'' ((contents should look like ''\Downloads\2004Scape-Server-localhost-Saves.tar.gz\2004Scape-Server-localhost-Saves.tar\players\espionage724.sav'')) | |
| * :!: Backups made from the above [[#save_data_back-up|batch file]] need renamed to remove the ''%RANDOM%-'' characters to work as-is for the following ''tar'' command | |
| * :!: The ''DEL'' command deletes existing files in the ''data\players'' folder | |
| |
| DEL /Q "%UserProfile%\Projects\2004scape-server\src\data\players\*" | |
| |
| tar -xvzf "%UserProfile%\Downloads\2004Scape-Server-localhost-Saves.tar.gz" -C "%UserProfile%\Projects\2004scape-server\src\data" "players" | |
| |
| ===== npm ===== | |
| |
| * Lists available ''npm'' commands | |
| |
| CD "%UserProfile%\Projects\2004scape-server\src\" && npm run | |
| |
| ===== File Manager ===== | |
| |
| ==== Root ==== | |
| |
| **** | |
| |
| explorer "%UserProfile%\Projects\2004scape-server\src\" | |
| |
| ==== Save Data ==== | |
| |
| **** | |
| |
| explorer "%UserProfile%\Projects\2004scape-server\src\data\players\" | |
| |