Skip to content

srb2:// server URLs

colette requested to merge fickleheart/SRB2:netgame-urls into master

Probably super pointless for most people. I thought it'd be nifty to have available.

There's some manual setup involved to get this working. For Windows, I've written this registry file that registers the protocol without defining an EXE to use: srb2protocol.reg. Please do your due diligence and don't add arbitrary registry entries to your operating system without knowing what they do, since they can easily fuck your shit up!!! Open it in a text editor and look up the keywords you see in there to verify that it's okay. (Other OSes have a different process for this. I'll leave that as an exercise to the interested parties.)

Once you have that set up, you can host a netgame on your local machine, then join it (with an EXE that includes this branch) just by clicking on 👉 srb2://127.0.0.1 👈 this link! I tested the URL handling on Firefox. Presumably it works similarly on all browsers.

"But what's the point of all this???" idk you could put a link into Discord (wrapped in <> so it becomes clickable) and make it quick for people to join?

(The registry file is based on this SO answer: https://stackoverflow.com/questions/389204/how-do-i-create-my-own-url-protocol-e-g-so - I only defined the protocol itself so that the system could let the user choose what program to open it with, so only the first entry mentioned was added.)

Edited by colette

Merge request reports