Merge pull request #7934 from Mailaender/mime-join
Registered the openra:// protocol to join games on Linux
This commit is contained in:
1
Makefile
1
Makefile
@@ -394,6 +394,7 @@ install-linux-mime:
|
||||
@$(INSTALL_DATA) packaging/linux/openra-mimeinfo.xml "$(DESTDIR)$(datadir)/mime/packages/openra.xml"
|
||||
|
||||
@$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications"
|
||||
@$(INSTALL_DATA) packaging/linux/openra-join-servers.desktop "$(DESTDIR)$(datadir)/applications"
|
||||
@$(INSTALL_DATA) packaging/linux/openra-replays.desktop "$(DESTDIR)$(datadir)/applications"
|
||||
|
||||
install-linux-appdata:
|
||||
|
||||
@@ -61,7 +61,23 @@ namespace OpenRA.Mods.Common.LoadScreens
|
||||
}
|
||||
|
||||
// Join a server directly
|
||||
var connect = args != null ? args.GetValue("Launch.Connect", null) : null;
|
||||
var connect = string.Empty;
|
||||
if (args != null)
|
||||
{
|
||||
if (args.Contains("Launch.Connect"))
|
||||
connect = args.GetValue("Launch.Connect", null);
|
||||
|
||||
if (args.Contains("Launch.URI"))
|
||||
{
|
||||
connect = args.GetValue("Launch.URI", null);
|
||||
if (connect != null)
|
||||
{
|
||||
connect = connect.Replace("openra://", "");
|
||||
connect = connect.TrimEnd('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(connect))
|
||||
{
|
||||
var parts = connect.Split(':');
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd ${0%/*}
|
||||
exec mono OpenRA.Game.exe Launch.Replay="$@"
|
||||
12
packaging/linux/openra-join-servers.desktop
Executable file
12
packaging/linux/openra-join-servers.desktop
Executable file
@@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=OpenRA
|
||||
GenericName=Real Time Strategy Game
|
||||
Comment=Reimagining of early Westwood Games
|
||||
Icon=openra
|
||||
Exec=openra Launch.URI=%U
|
||||
Terminal=false
|
||||
NoDisplay=true
|
||||
Categories=Game;StrategyGame;
|
||||
MimeType=x-scheme-handler/openra;
|
||||
@@ -8,4 +8,11 @@
|
||||
<glob weight="60" pattern="*.orarep"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="x-scheme-handler/openra">
|
||||
<icon name="openra" />
|
||||
<generic-icon name="applications-games"/>
|
||||
<comment>OpenRA connect to server scheme</comment>
|
||||
<glob weight="60" pattern="openra://*"/>
|
||||
</mime-type>
|
||||
|
||||
</mime-info>
|
||||
|
||||
Reference in New Issue
Block a user