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> <dd>
<text>Searches for a network game on the specified address and joins it. No local scenario (*.ocs) should be specified. Implies --network.</text> <text>Searches for a network game on the specified address and joins it. No local scenario (*.ocs) should be specified. Implies --network.</text>
</dd> </dd>
<dt id="clonkp">clonk://&lt;<em>Address</em>&gt;/</dt> <dt id="clonkp">[open]clonk://&lt;<em>Address</em>&gt;/</dt>
<dd> <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> <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> </dd>

View File

@ -9,4 +9,4 @@ Icon=openclonk
Exec=openclonk Exec=openclonk
Categories=Game;ActionGame;StrategyGame;ArcadeGame; Categories=Game;ActionGame;StrategyGame;ArcadeGame;
StartupNotify=true 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); Game.RecordStream.Copy(szParameter);
} }
// Direct join by URL // Direct join by URL
if (SEqual2NoCase(szParameter, "clonk:")) if (SEqual2NoCase(szParameter, "clonk:") || SEqual2NoCase(szParameter, "openclonk:"))
{ {
// Store address // Store address
SCopy(szParameter + 6, Game.DirectJoinAddress, _MAX_PATH); SCopy(SAdvancePast(szParameter, ':'), Game.DirectJoinAddress, _MAX_PATH);
SClearFrontBack(Game.DirectJoinAddress, '/'); SClearFrontBack(Game.DirectJoinAddress, '/');
// Special case: if the target address is "update" then this is used for update initiation by url // Special case: if the target address is "update" then this is used for update initiation by url
if (SEqualNoCase(Game.DirectJoinAddress, "update")) if (SEqualNoCase(Game.DirectJoinAddress, "update"))