This project is a server-side implementation for the flash game "Classic 8-Ball Multiplayer", found at https://www.speeleiland.nl/classic-8-ball-multiplayer.htm.
Open the project in MonoDevelop or Visual Studio and click run. Currently there are no binaries provided.
This has been tested under Mono 6.12, but it should run on much earlier versions of both Mono and .NET.
The swf file is not provided in this repository. It can be downloaded from here.
Simply run the ruffle binary with the correct flashvars.
ruffle -Psurl=localhost -Psport=6890 -Puser=MyUsername sdjkl2389asl19.swf
Since browsers do not allow direct TCP connections, Ruffle needs to be configured to convert the connection to a WebSocket. The server implements a plaitnext only WebSocket server on the same port as the normal TCP one. Ideally, the port will be proxied behind nginx and encrypted using a configuration like follows:
location /gepot/ws {
proxy_pass http://[::1]:6890;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Then, the SWF can be embedded by configuring Ruffle appropriately. This assumes nginx is listening on port 443, serving the WebSocket over TLS, and the HTML is served from the same path the WebSocket exists in.
let params = new URLSearchParams(window.location.search);
let el = document.getElementById("gepot");
if(params.get("surl") === null)
params.append("surl", window.location.hostname);
if(params.get("sport") === null)
params.append("sport", 6890);
if(params.get("hash") === null)
params.append("hash", "ignoreme");
if(params.get("user") === null)
params.append("user", "user" + Math.round(Math.random()*10000));
if(params.get("sound") === null)
params.append("sound", 1);
window.RufflePlayer.config = {
socketProxy: [{
host: params.get("surl"),
port: params.get("sport"),
proxyUrl: `wss://${params.get("surl")}${location.pathname}ws`,
}]
};
swfobject.embedSWF(`sdjkl2389asl19.swf?${params.toString()}`, el, "100%", "100%", 10);
Don't forget the script tags for Ruffle and SWFObject. Ensure SWFObject is included after Ruffle.
The standalone Flash Player first needs to be allowed to connect to the internet. Unfortunately, clicking the "Settings" button in the prompt simply opens a 404 page, meaning it can not be configured that way.
Instead, .minerva can be used. A live instance of it can be found at https://mariani.life/projects/minerva/.
- Go to the .minerva website, or run it locally.
- Click on Open and select the
settings.sol
file.On Linux, it is located at
~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/settings.sol
.If it doesn't exist, make sure you have ran
flashplayer
at least once. - Select
crossdomainAllow
from the left panel. - On the right panel, change the slider to
YES
. - Repeat steps 3 & 4 for
crossdomainAlways
. - Click on Save and overwrite the
settings.sol
file at the same location.
It might be possible to distribute a preconfigured settings.sol
with a specific domain name allowed only, however this has not been investigated.
Once this has been configured, the game can now be ran using the standalone flashplayer
binary.
Either navigate to the path containing the swf using a terminal and run
flashplayer "file:///$PWD/sdjkl2389asl19.swf?surl=localhost&sport=6890&user=Desired%20Username"
or open the standalone Flash Player and manually fill in the URL with the required parameters.
Because you lose it when you keep seeing "geen bal gepot..." repeatedly :)