====== Information ======
* Lost City ''244'' Server + Client
* [[https://lostcity.rs/t/singleplayer-main-branch-scripts-and-desktop-start-launchers-on-windows-linux-freebsd/54|Lost City Forums]]
* :!: 2025/08/20: ''bun'' isn't compatible with FreeBSD ([[https://github.com/oven-sh/bun/issues/1524|#1524]]) ((commits locked at last ''npm'' support around May/June 2025; no update script))
===== Media =====
* [[https://media.realmofespionage.xyz/index/category/2|Progress Pics]]
===== Prerequisites =====
* [[bsd:freebsd_14.3_xfce|FreeBSD 14.3 (Xfce)]]
====== Dependencies ======
* https://github.com/LostCityRS/Engine-TS/blob/244/README.md#dependencies
su -
pkg install git openjdk24 npm-node24
====== Download Source ======
===== Engine-TS =====
* https://github.com/LostCityRS/Engine-TS/commits/244/
* https://github.com/LostCityRS/Engine-TS/commit/0fb09fb0506fd884d82b8fec556a822e69d25e14
cd ~ && mkdir -p ~/'Projects' && rm -Rf ~/'Projects/LostCity-244-EngineTS/src' && git clone --rev '0fb09fb0506fd884d82b8fec556a822e69d25e14' --depth '1' --recurse-submodules 'https://github.com/LostCityRS/Engine-TS.git' ~/'Projects/LostCity-244-EngineTS/src'
===== Content =====
* https://github.com/LostCityRS/Content/commits/244/
* https://github.com/LostCityRS/Content/commit/69a88f534e9f43dcfe651d62467f9760ad021428
cd ~ && mkdir -p ~/'Projects' && rm -Rf ~/'Projects/LostCity-244-EngineTS/content' && git clone --rev '69a88f534e9f43dcfe651d62467f9760ad021428' --depth '1' --recurse-submodules 'https://github.com/LostCityRS/Content.git' ~/'Projects/LostCity-244-EngineTS/content'
====== Initial Build ======
****
cd ~/'Projects/LostCity-244-EngineTS/src' && npm install --verbose
====== Set-up ======
* Set up as a development world
npm --prefix ~/'Projects/LostCity-244-EngineTS/src' run 'setup'
====== Settings ======
* Last commit: [[https://github.com/LostCityRS/Engine-TS/commit/143ff378c5843b200927b976ae31b9d774de26ed|Mar 6, 2025]] ''143ff37''
mkdir -p ~/'Projects/LostCity-244-EngineTS/conf' && ee ~/'Projects/LostCity-244-EngineTS/conf/localhost.env'
NODE_XPRATE=1
NODE_PROFILE=localhost
NODE_STAFF=Test
NODE_DEBUGPROC_CHAR=:
NODE_CLIENT_ROUTEFINDER=false
====== Scripts ======
===== Server Start =====
mkdir -p ~/'Projects/LostCity-244-EngineTS/scripts' && ee ~/'Projects/LostCity-244-EngineTS/scripts/localhost-server-start.sh' && chmod +x ~/'Projects/LostCity-244-EngineTS/scripts/localhost-server-start.sh'
#!/bin/sh
export JAVA_HOME='/usr/local/openjdk24'
export _JAVA_OPTIONS='--sun-misc-unsafe-memory-access=allow'
node --env-file=$HOME/'Projects/LostCity-244-EngineTS/conf/localhost.env' '/usr/local/lib/node_modules/npm/bin/npm-cli.js' --prefix ~/'Projects/LostCity-244-EngineTS/src' run 'quickstart'
# End
~/'Projects/LostCity-244-EngineTS/scripts/localhost-server-start.sh'
===== Save Data Back-up =====
mkdir -p ~/'Projects/LostCity-244-EngineTS/scripts' && ee ~/'Projects/LostCity-244-EngineTS/scripts/localhost-save-backup.sh' && chmod +x ~/'Projects/LostCity-244-EngineTS/scripts/localhost-save-backup.sh'
#!/bin/sh
tar -czf ~/'Downloads/'$(date +%Y-%m-%d-%s)'-2004Scape-localhost-Saves.tar.gz' -C ~/'Projects/LostCity-244-EngineTS/src/data/players' 'localhost'
notify-send -i ~/'Projects/LostCity-244-EngineTS/ext/favicon.ico' '2004Scape Save Data Backed-up Successfully to Downloads'
# End
~/'Projects/LostCity-244-EngineTS/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/LostCity-244-EngineTS/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/LostCity-244-EngineTS/ext/favicon.ico' && ls ~/'Projects/LostCity-244-EngineTS/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/LostCity-244-EngineTS/ext' && wget -O '/tmp/June_2004_Map.jpg' 'https://runescape.wiki/images/June_2004_Map.jpg?35d17' --user-agent='script' && sha384sum '/tmp/June_2004_Map.jpg' | grep 'abfdfe4597975addbb9d79d2cce2e56f0054f2742f351bd9dc700f55e91157e6c2142749f113927b027ed42efb8ad833' > '/dev/null' && mv -f '/tmp/June_2004_Map.jpg' ~/'Projects/LostCity-244-EngineTS/ext/June_2004_Map.jpg' && ls ~/'Projects/LostCity-244-EngineTS/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''
mkdir -p ~/'Projects/LostCity-244-EngineTS/ext' && sha384sum ~/'Downloads/SC55_zzdenis_v0.5.sf2' | grep 'f386f638777072fc220e39afbd7efcd227ca2bfcf13403bf47fbb2e2b8f4d151239710cc36c8530a75c3b4c3f55066b7' > '/dev/null' && mv -f ~/'Downloads/SC55_zzdenis_v0.5.sf2' ~/'Projects/LostCity-244-EngineTS/ext'
ln -s -f ~/'Projects/LostCity-244-EngineTS/ext/SC55_zzdenis_v0.5.sf2' ~/'Projects/LostCity-244-EngineTS/src/public/client/SCC1_Florestan.sf2'
===== Login Autofill =====
* [[https://github.com/2004Scape/Server/issues/1498|#1498]]
sed -i -e 's/usernameInput="";passwordInput=""/usernameInput="Espionage724";passwordInput="1"/g' ~/'Projects/LostCity-244-EngineTS/src/public/client/client.js'
===== LAN Firewall =====
==== ipfw ====
* ''workstation'' deny all
* Opens firewall to allow browser connections on LAN
su -
ipfw add '09000' 'allow' 'tcp' from '192.168.1.0/24' 'any' to '192.168.1.0/24' '8888' 'in'
=== Delete Rule ===
su -
ipfw delete '09000'
====== Desktop Launcher ======
===== 2004Scape =====
mkdir -p ~/'.local/share/applications' && ee ~/'.local/share/applications/lostcity-244-localhost.desktop' && sed -i -e 's/'CHANGEME'/'$USER'/g' ~/'.local/share/applications/lostcity-244-localhost.desktop' && update-desktop-database --quiet ~/'.local/share/applications'
[Desktop Entry]
Name=2004Scape
Categories=Game;
Exec='/bin/sh' -c "gio open 'http://localhost:8888/rs2.cgi'"
Type=Application
StartupNotify=false
SingleMainWindow=false
Icon=/home/CHANGEME/Projects/LostCity-244-EngineTS/ext/favicon.ico
Actions=Map;Server;Saves;Notes;
[Desktop Action Map]
StartupNotify=false
Exec='/bin/sh' -c "gio open ~/'Projects/LostCity-244-EngineTS/ext/June_2004_Map.jpg'"
Name=World Map
[Desktop Action Server]
Exec='/bin/sh' -c "xfce4-terminal -T '2004Scape - Server' -I ~/'Projects/LostCity-244-EngineTS/ext/favicon.ico' -e ~/'Projects/LostCity-244-EngineTS/scripts/localhost-server-start.sh'"
Name=Server - Start
[Desktop Action Saves]
StartupNotify=false
Exec='/bin/sh' -c "~/'Projects/LostCity-244-EngineTS/scripts/localhost-save-backup.sh'"
Name=Save Data Back-up
[Desktop Action Notes]
StartupNotify=false
Exec='/bin/sh' -c "gio open 'https://wiki.realmofespionage.xyz/games;bsd;2004scape_localhost'"
Name=Install Notes
====== Quick Commands ======
===== Save Restore =====
****
mkdir -p ~/'Projects/LostCity-244-EngineTS/src/data/players/localhost' && gio open ~/'Projects/LostCity-244-EngineTS/src/data/players/localhost'
====== Tests ======
===== bun =====
* Wine
* [[https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64.zip|bun-windows-x64.zip]]
* 2025/08/28: Worked on [[linux;distros;opensuse_tumbleweed_gnome|openSUSE TW (GNOME)]]
WINEPREFIX=~/'.wine/bun' WINEARCH='win64' wineboot -i
WINEPREFIX=~/'.wine/bun' wine ~/'Downloads/bun-windows-x64/bun.exe' -v