Add openclonk:// protocol handler (#1657)

master
Lukas Werling 2019-01-02 17:16:09 +01:00
parent d7ea9acfea
commit 3a59c15250
3 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@
<dd>
<text>Searches for a network game on the specified address and joins it. No local scenario (*.ocs) should be specified. Implies --network.</text>
</dd>
<dt id="clonkp">clonk://&lt;<em>Address</em>&gt;/</dt>
<dt id="clonkp">[open]clonk://&lt;<em>Address</em>&gt;/</dt>
<dd>
<text>Same as --join if an address is specified. If "update" is specified as an address, this will cause the engine to perform an update check instead.</text>
</dd>

View File

@ -9,4 +9,4 @@ Icon=openclonk
Exec=openclonk
Categories=Game;ActionGame;StrategyGame;ArcadeGame;
StartupNotify=true
MimeType=x-scheme-handler/clonk;
MimeType=x-scheme-handler/clonk;x-scheme-handler/openclonk;

View File

@ -428,10 +428,10 @@ void C4Application::ParseCommandLine(int argc, char * argv[])
Game.RecordStream.Copy(szParameter);
}
// Direct join by URL
if (SEqual2NoCase(szParameter, "clonk:"))
if (SEqual2NoCase(szParameter, "clonk:") || SEqual2NoCase(szParameter, "openclonk:"))
{
// Store address
SCopy(szParameter + 6, Game.DirectJoinAddress, _MAX_PATH);
SCopy(SAdvancePast(szParameter, ':'), Game.DirectJoinAddress, _MAX_PATH);
SClearFrontBack(Game.DirectJoinAddress, '/');
// Special case: if the target address is "update" then this is used for update initiation by url
if (SEqualNoCase(Game.DirectJoinAddress, "update"))