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.
This commit is contained in:
@@ -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/*
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user