From e0e3b5d4bb531c15c0c7398332ab9131feed70ac Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Sun, 11 Oct 2026 16:18:07 -0700 Subject: [PATCH] Run Windows games from LocalGames under Wine fp-launch runs a LocalGames .exe with Flashpoint's bundled Wine from a writable copy, linking its Prefs directory, where Director projectors save, into the synced saves directory. Players without a save start from the Prefs the game ships with. The image adds the X, font and PulseAudio libraries the bundled Wine loads. --- streaming/streamer/Dockerfile | 12 ++++++++++++ streaming/streamer/README.md | 17 ++++++++++++----- .../streamer/root/usr/local/bin/fp-launch | 18 ++++++++++++++++++ 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/streaming/streamer/Dockerfile b/streaming/streamer/Dockerfile index 9bc8d81..9edcedf 100644 --- a/streaming/streamer/Dockerfile +++ b/streaming/streamer/Dockerfile @@ -11,9 +11,21 @@ RUN apt-get update && \ fontconfig \ fonts-dejavu-core \ libasound2-plugins \ + libfontconfig1 \ + libfreetype6 \ + libgl1 \ + libpulse0 \ + libx11-6 \ + libxcomposite1 \ + libxcursor1 \ + libxext6 \ + libxfixes3 \ libxi6 \ + libxinerama1 \ + libxrandr2 \ libxrender1 \ libxtst6 \ + libxxf86vm1 \ sqlite3 && \ rm -rf /var/lib/apt/lists/* diff --git a/streaming/streamer/README.md b/streaming/streamer/README.md index 556078c..dcdc970 100644 --- a/streaming/streamer/README.md +++ b/streaming/streamer/README.md @@ -2,13 +2,15 @@ Runs a Flashpoint game natively on the server and streams it to the browser with [Selkies](https://github.com/selkies-project/selkies), for platforms that cannot -run in a browser. One container plays one game, set by `GAME_ID`. Only Java -applets are supported so far. +run in a browser. One container plays one game, set by `GAME_ID`. It supports +Java applets, and Windows games installed under `LocalGames/` (see +[local-games](../local-games/README.md)). ## Requirements A Linux Flashpoint install at `FLASHPOINT_HOST_PATH`. The streamer uses the -Infinity build's `Server/FlashpointGameServer` and `FPSoftware/Java`, which +Infinity build's `Server/FlashpointGameServer`, `FPSoftware/Java` and +`FPSoftware/Wine`, which Ultimate's packed zips do not include on Linux. To add them to an extracted Ultimate without overwriting its data, copy an extracted [Infinity for Linux](https://flashpointarchive.org/downloads) over it: @@ -37,6 +39,11 @@ Selkies restarts the game when it exits (`RESTART_APP`). `appletviewer` lacks two things applets got from the browser's Java plugin, so the image adds them: a `netscape.javascript.JSObject` stand-in whose window has -a `document.cookie` that persists to `/config/saves/cookies.txt`, and a policy allowing HTTP requests through the -game server's proxy. The same jar (`applet-support/`) is loaded as a Java agent +a `document.cookie` that persists to `/config/saves/cookies.txt`, and a policy +allowing HTTP requests through the game server's proxy. The same jar (`applet-support/`) is loaded as a Java agent that removes appletviewer's menu bar and status line. + +Windows games run under Flashpoint's bundled Wine from a writable copy of the +game's directory. Its `Prefs` directory, where Director projectors save, is +linked into `/config/saves`, so the session manager syncs it to the player's +browser. A player without a save starts from the `Prefs` the game ships with. diff --git a/streaming/streamer/root/usr/local/bin/fp-launch b/streaming/streamer/root/usr/local/bin/fp-launch index 2a77ab9..c05e90f 100755 --- a/streaming/streamer/root/usr/local/bin/fp-launch +++ b/streaming/streamer/root/usr/local/bin/fp-launch @@ -38,6 +38,24 @@ case ${app,,} in # and a window holding only the applet export JAVA_TOOL_OPTIONS="-javaagent:/opt/flashpoint/applet-support.jar -Djava.security.policy=/opt/flashpoint/applet.policy" FP_PATH=$FP_PATH exec "$FP_PATH/FPSoftware/startJava.sh" "$cmd" ;; + 'localgames\'*.exe) + # Windows games run under Flashpoint's bundled Wine from a writable copy. + # Prefs, where Director projectors save, lives in the synced saves directory. + exe=${app//\\//} + work=$HOME/game + [[ -d $work ]] || cp -r "$FP_PATH/$(dirname "$exe")" "$work" + if [[ ! -L $work/Prefs ]]; then + mkdir -p "$HOME/saves/Prefs" + # Players without a save start from the one the game ships with + if [[ -d $work/Prefs && -z $(ls -A "$HOME/saves/Prefs") ]]; then + cp -r "$work/Prefs/." "$HOME/saves/Prefs" + fi + rm -rf "$work/Prefs" + ln -s "$HOME/saves/Prefs" "$work/Prefs" + fi + export WINEPREFIX=$HOME/.wine WINEDEBUG=-all WINEDLLOVERRIDES='mscoree,mshtml=' + cd "$work" + exec "$FP_PATH/FPSoftware/Wine/bin/wine" "$(basename "$exe")" ;; *) echo "Unsupported application: $app" >&2; exit 1 ;; esac