Bug #269

Support for et:// protocol handling and registration

Added by Radegast about 6 years ago. Updated over 5 years ago.

Status:Fixed% Done:

100%

Priority:NormalSpent time:-
Assignee:Radegast
Category:Client
Target version:2.71rc2
OS:Linux Arch:

Description

Windows installer and Mac OS X package specification are done, but the mechanism and URI handling needs to be implemented for linux.

We’ll use Freedesktop standard XDG tools for protocol association with ET:L.

Associated revisions

Revision 3969c25e
Added by Spyhawk about 6 years ago

misc: add linux support for et:// protocol, fixes #269

This provides necessary files for Freedesktop XDG protocol handling.

Revision 84443bcf
Added by Jan Šimek about 6 years ago

Merge pull request #39 from Spyhawk/etprotocol

misc: add linux support for et:// protocol, fixes #269

History

#1 Updated by Spyhawk about 6 years ago

Radegast wrote:

We’ll use Freedesktop standard XDG tools for protocol association with ET:L.

This can simply done within the .desktop file shipped by the package maintainers (on a per distribution basis).
It’s probable a good idea to provide a standardized etlegacy.desktop in /misc.

More info about this can be found on stackexchange. And if I am not mistaken, here are the official Freedesktop desktop entry spec and a MIME tutorial.

Below is the current .desktop file I’ve created for my own Arch package:


[Desktop Entry]
Name=ET: Legacy
GenericName=A team-based multiplayer WWII tactical first-person shooter
Comment=A team-based multiplayer WWII tactical first-person shooter
Icon=etlegacy.xpm
Exec=etl
Terminal=false
Type=Application
Categories=Application;Game
StartupNotify=false

This could be further expanded to handle the et:// protocole, and also the localization.


MimeType=x-scheme-handler/et-protocol
GenericName[de]=
GenericName[fr]=
...
Comment[de]=
Comment[fr]=
...

#2 Updated by Spyhawk about 6 years ago

  • % Done changed from 10 to 90

Here’s a working implementation. Necessary files are provided in the /misc directory (see GH request).

- etlegacy.desktop (usually in /usr/share/applications/):
[Desktop Entry]
Type=Application
Name=ET:Legacy
GenericName=A team-based multiplayer WWII tactical first-person shooter
Comment=A team-based multiplayer WWII tactical first-person shooter
Icon=etlegacy.xpm
Exec=etl +connect %u
Terminal=false
MimeType=x-scheme-handler/et;
Categories=Application;Game
StartupNotify=false

- etlegacy.xml (usually in /usr/share/mime/packages/):

<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="x-scheme-handler/et">
<comment xml:lang="et">Enemy Territory connexion protocol</comment>
</mime-type>
</mime-info>

To make this working, the mime cache needs to be updated by the installer (# update-mime-database /usr/share/mime).

A few notes:
- Freedesktop specifies that [GenericName] and [Comment] must be different. In practice, [Comment] is used by Gnome while [GenericName] is used by KDE so both are included.
- A single .desktop file is provided for both menu entries and et:// protocol handling. As a result, the menu icon launches etl with an empty server IP ("etl +connect").
- The translation aren’t provided yet. These can be added later.
- I’ll update the Distribution package wiki page once these files are reviewed and committed to master.

#3 Updated by Spyhawk about 6 years ago

  • Status changed from New to Fixed
  • % Done changed from 90 to 100

#4 Updated by IR4T4 about 6 years ago

  • Target version changed from 2.78 to 2.71rc2

#5 Updated by Radegast over 5 years ago

  • OS set to Linux

Also available in: Atom PDF