slavidodo/OpenTibia-Unity

otserv URI scheme support

Opened this issue · 0 comments

Znote commented

An URI scheme allows special clickable links to be used to launch an application and pre-configure input fields in accordance to the URI parameters.

The otserv:// URI scheme is currently in effect for tibialoader on otservlist.org.
otland IP changer also supports it, however otland ip changer doesn't seem to fully support the protocol the same way tibialoader does, which is dictated by Xinn/otservlist.org

https://stackoverflow.com/questions/389204/how-do-i-create-my-own-url-protocol-e-g-so

This is added through the registry.

Registering an Application to a URI Scheme

Current structure:
otserv://ip_domain/port/protocol

On client 11+, port is disregarded, and loginWebService is presumed to be ip_domain/login.php. Gameserver port is then loaded from the json http(s) response.

4 samples from otservlist.org:

otserv://darkot.eu/7171/74
otserv://jogatina.servegame.com/7171/792
otserv://evolunia.net/7171/1098
otserv://login.gunzodus.net/7171/121

client 7.4 = 74
client 7.92 = 792
client 10.98 = 1098
client 12.1 = 121

To determine correct protocol, I suggest:
if protocol / 10 in [valid clients]
else if protocol / 100 in [valid clients]

or
if protocol in [valid clients]
else if protocol * 10 in [valid clients]

depending on how OTU client list is stored.

I would consider overwriting the registry if its already configured for tibialoader/otland ip changer to OTU when program starts. (or during installation, or options button).

Not quite sure how the technical implementation is done.