From 37c9caabd8c4e3bce61c72a3f14b39daa7fb21bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 26 Dec 2014 16:18:21 +0100 Subject: [PATCH 1/4] this has already been resolved in #7121 and #7187 --- launch-replay.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/launch-replay.sh b/launch-replay.sh index 6c1af06098..2190b61bb6 100755 --- a/launch-replay.sh +++ b/launch-replay.sh @@ -1,4 +1,3 @@ #!/bin/bash -# TODO choose the correct Game.Mod instead of crashing cd ${0%/*} exec mono OpenRA.Game.exe Launch.Replay="$@" \ No newline at end of file From 417b499472cff030fcb23a7a858d23a635047f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 5 Dec 2013 23:21:19 +0100 Subject: [PATCH 2/4] register Linux MIME type to directly load replays --- Makefile | 8 ++++++++ packaging/linux/openra-mimeinfo.xml | 11 +++++++++++ packaging/linux/openra-replays.desktop | 12 ++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 packaging/linux/openra-mimeinfo.xml create mode 100755 packaging/linux/openra-replays.desktop diff --git a/Makefile b/Makefile index 2608652128..d8418cdf5c 100644 --- a/Makefile +++ b/Makefile @@ -391,6 +391,13 @@ install-linux-desktop: @$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications" @$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications" +install-linux-mime: + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/mime/packages/" + @$(INSTALL_DATA) packaging/linux/openra-mimeinfo.xml "$(DESTDIR)$(datadir)/mime/packages/openra.xml" + + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DATA) packaging/linux/openra-replays.desktop "$(DESTDIR)$(datadir)/applications" + install-linux-scripts: @echo "#!/bin/sh" > openra @echo 'cd "$(gameinstalldir)"' >> openra @@ -426,6 +433,7 @@ uninstall: @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra-editor.png" @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/openra.png" @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/mime/packages/openra.xml" help: @echo to compile, run: diff --git a/packaging/linux/openra-mimeinfo.xml b/packaging/linux/openra-mimeinfo.xml new file mode 100644 index 0000000000..b6a124a23e --- /dev/null +++ b/packaging/linux/openra-mimeinfo.xml @@ -0,0 +1,11 @@ + + + + + + + OpenRA Replay + + + + diff --git a/packaging/linux/openra-replays.desktop b/packaging/linux/openra-replays.desktop new file mode 100755 index 0000000000..58e8d9f637 --- /dev/null +++ b/packaging/linux/openra-replays.desktop @@ -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.Replay=%f +Terminal=false +NoDisplay=true +Categories=Game;StrategyGame; +MimeType=application/x-openra-replay; \ No newline at end of file From 1b5928879c2c4ee5c2a9809be9cb191ad7bd7faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 28 Dec 2014 10:04:48 +0100 Subject: [PATCH 3/4] save replays in a less generic file extension --- OpenRA.Game/FileFormats/ReplayMetadata.cs | 2 +- OpenRA.Game/Network/ReplayRecorderConnection.cs | 2 +- OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs | 2 +- packaging/linux/openra-mimeinfo.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/FileFormats/ReplayMetadata.cs b/OpenRA.Game/FileFormats/ReplayMetadata.cs index bdbbb8b411..d8e0be7449 100644 --- a/OpenRA.Game/FileFormats/ReplayMetadata.cs +++ b/OpenRA.Game/FileFormats/ReplayMetadata.cs @@ -71,7 +71,7 @@ namespace OpenRA.FileFormats public void RenameFile(string newFilenameWithoutExtension) { - var newPath = Path.Combine(Path.GetDirectoryName(FilePath), newFilenameWithoutExtension) + ".rep"; + var newPath = Path.Combine(Path.GetDirectoryName(FilePath), newFilenameWithoutExtension) + ".orarep"; File.Move(FilePath, newPath); FilePath = newPath; } diff --git a/OpenRA.Game/Network/ReplayRecorderConnection.cs b/OpenRA.Game/Network/ReplayRecorderConnection.cs index 104c282f4d..b42f07404e 100644 --- a/OpenRA.Game/Network/ReplayRecorderConnection.cs +++ b/OpenRA.Game/Network/ReplayRecorderConnection.cs @@ -57,7 +57,7 @@ namespace OpenRA.Network var id = -1; while (file == null) { - var fullFilename = Path.Combine(dir, id < 0 ? "{0}.rep".F(filename) : "{0}-{1}.rep".F(filename, id)); + var fullFilename = Path.Combine(dir, id < 0 ? "{0}.orarep".F(filename) : "{0}-{1}.orarep".F(filename, id)); id++; try { diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index 840c92b21b..c8d30833ac 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic using (new Support.PerfTimer("Load replays")) { replays = Directory - .GetFiles(dir, "*.rep") + .GetFiles(dir, "*.orarep") .Select(ReplayMetadata.Read) .Where(r => r != null) .OrderByDescending(r => r.GameInfo.StartTimeUtc) diff --git a/packaging/linux/openra-mimeinfo.xml b/packaging/linux/openra-mimeinfo.xml index b6a124a23e..9a5fba69a1 100644 --- a/packaging/linux/openra-mimeinfo.xml +++ b/packaging/linux/openra-mimeinfo.xml @@ -5,7 +5,7 @@ OpenRA Replay - + From 411446f9bd2309e66399f0808a2d846efc4957da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 17 Jan 2015 11:23:53 +0100 Subject: [PATCH 4/4] package the XML files --- packaging/linux/buildpackage.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 112a0380cf..944e4fb754 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -22,6 +22,7 @@ make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" # Install startup scripts, desktop files and icons make install-linux-shortcuts prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" +make install-linux-mime prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" # Documentation mkdir -p $PWD/packaging/linux/$ROOTDIR/usr/share/doc/openra/