Associate game replay files, joining multiplayer servers to a custom URL protocol
Description
Currently, one has to launch the game manually if they want to watch a replay or connect to a multiplayer server.
It would be pretty cool if we are to associate a url schema such as bsreplay://path/to/replay.brp with bombsquad and then have the player just double-click a .brp file and it would automatically launch bombsquad to play this replay all by itself. Similarly an "open with bombsquad" when trying to open .brp files on Android would be nice. This could also in some way provide a workaround for non-rooted Android devices to have a way for playing foreign replay files.
Similarly, it would be also be nice if we are to associate url schema such as bs://65.0.8.128:43211 to be handled with bombsquad. This would automatically open up bombsquad and attempt to connect to the multiplayer server running on 65.0.8.128 on port 43211.
All this stuff should probably make sharing replay files and testing servers with friends a little more mainstream. Players could then share servers online on reddit/discord by just sharing the above url schema and other players could join them by tapping the link. Although I believe this won't work as is. I think we'll need to have players reaching a link like https://bombsquadgame.com/server/65.0.8.128?port=43211 which the webserver would attempt to open up bs://65.0.8.128:43211 on the client device which would then get handled by the bombsquad app.
Solution
Desktop builds are standalone right now. We'll probably need some kind of batch or a shell script installer that would create registry/desktop entries to handle the above url schemas.
I experimented a bit on Linux by having the following Desktop Entry:
[Desktop Entry]
Type=Application
Name=Bombsquad
Exec=cd /path/to/BombSquad_Linux_x86_64_1.6.12; ./bombsquad -exec "import _ba; (lambda ip, port=43210: _ba.connect_to_party(ip, int(port)))(*'%u'.lstrip('bs://').split(':'))"
StartupNotify=false
MimeType=x-scheme-handler/bs;
which needs to be then installed and registered (https://unix.stackexchange.com/a/497147/236637).
Once done, the following launches bombsquad and connects to the given server:
$ xdg-open bs:///65.0.8.128:43211
I haven't confirmed but it's very likely also possible to play replay files through ./bombsquad -exec on game launch. Also the Exec from the desktop entry could also be modified to call an external script, and this script could call a different routine depending on whether the input url schema starts with bs:// or bsreplay://, as well as make everything more readable.
Any updates on this? It would be more easy to share replays to friends.
This would be cool to have when deeplink support is done Eric has plans for this so closing issue
@efroemling another usecase of deeplink
Awesome! Let's close it after it has been implemented?
This would be cool to have when deeplink support is done Eric has plans for this so closing issue
Please only close issues if/when they're actually implemented or rejected; planned issues and not rejected issues should stay open so that implementation details can be discussed further if people want to add onto it.