Announce an EDI game
Games with an EDI mod call an EDI server over HTTP to play named scenes. RustyFunPlayer can be that server. When the game announces itself, RustyFunPlayer offers to play it, starts serving EDI on the game’s port and loads its gallery.
Announce the edi service on the port the game calls, and tell the hub where the game is installed with the org.rustyfunplayer.edi extension:
{
"id": "castle-of-temptation",
"name": "Castle of Temptation",
"services": [{ "protocol": "edi", "endpoint": "http://127.0.0.1:5000/" }],
"ext": {
"org.rustyfunplayer.edi": {
"root": "/games/Castle",
"executable": "/games/Castle/Castle.exe",
"config": "/games/Castle/Edi/EdiConfig.json"
}
}
}
ext field | Meaning |
|---|---|
root | The game folder. |
executable | The game’s program, inside root. |
config | The game’s EdiConfig.json, inside root. RustyFunPlayer recognizes the game by it, so your card replaces the one its own game detector shows. |
Paths are absolute paths of the host system. Under Wine or Proton, translate Z:\games\Castle to /games/Castle first.
announce({
id: "castle-of-temptation",
name: "Castle of Temptation",
services: [{ protocol: "edi", endpoint: "http://127.0.0.1:5000/" }],
ext: { "org.rustyfunplayer.edi": { root, executable, config } },
});
#![allow(unused)]
fn main() {
funlink::announce(
Announcement::new("castle-of-temptation", "Castle of Temptation")
.service(Protocol::Edi, "http://127.0.0.1:5000/")
.ext("org.rustyfunplayer.edi", serde_json::json!({
"root": root, "executable": executable, "config": config,
})),
)?;
}
FunlinkPeer.Announce(new Announcement("castle-of-temptation", "Castle of Temptation",
[new Service(Protocol.Edi, "http://127.0.0.1:5000/")])
{
Ext = new Dictionary<string, JsonElement>
{
["org.rustyfunplayer.edi"] = JsonSerializer.SerializeToElement(new { root, executable, config }),
},
});
Funlink.announce(Announcement.of("castle-of-temptation", "Castle of Temptation",
Service.of(Protocol.EDI, "http://127.0.0.1:5000/"))
.withExt("org.rustyfunplayer.edi", Map.of("root", root, "executable", executable, "config", config)));
EDI games run on the computer and announce over loopback, which the C library does not do. Use one of the other libraries, the Godot add-on, or plain HTTP.
var funlink := FunlinkPeer.new()
func _ready() -> void:
var executable := OS.get_executable_path()
var root := executable.get_base_dir()
funlink.app_id = "castle-of-temptation"
funlink.app_name = "Castle of Temptation"
funlink.services = [{"protocol": "edi", "endpoint": "http://127.0.0.1:5000/"}]
funlink.ext = {"org.rustyfunplayer.edi": {
"root": root, "executable": executable, "config": root.path_join("Edi/EdiConfig.json")}}
add_child(funlink)
Under Wine or Proton, OS.get_executable_path() returns a Windows path; translate it first.
Unity games can do this from a BepInEx plugin; any HTTP client works, see Without a library.