Author Topic: Support for web links to connect to a given MG server (helper application)  (Read 1331 times)

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
It would be nice to have a glest: URL protocol handler so that you could create web pages with links to game servers using something along the line of
Code: [Select]
<a href="glest:127.0.0.1:61357">my server</a>How to do this on Windoze is explained at MSDN. This could then feed into MG via ./glest --connect=%1. I have not checked how to do this on Linux, yet, but then that's usually the easier part...
« Last Edit: 15 April 2016, 21:03:45 by filux »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Re: Add a glest: URL protocol handler
« Reply #1 on: 23 January 2011, 20:59:48 »
sounds nice but i think it might bring up problems with installation (installer only !!! or on every Glest startup?)

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Yes it would only work for builds with installer. But a script could be added to non-installer releases to make the neccessary customizations and thus achieve the same. Anyway, I consider this just an implementation detail.
« Last Edit: 25 January 2011, 01:51:59 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
There are actually two ways to implement this:
What I suggested above is a glest: URL scheme / protocol handler. The other, and probably better option, is registering a MIME-type / content-type and file extension with the OS.
I.e. when you would click on a server entry on the list this would point you to something like http://play.megaglest.org/connect.glest?server=127.0.0.1&port=61357 and that would trigger a file download of Content-Type: application/x-glest
You would need to make MG the handler for this content-type (this is also referred to as a "helper application") - which will work differently across different OS. But it's probably less of a hassle and security issue than a glest: URL scheme... and it would probably work cross-browser, too, so you only need to tell the OS (not every single web browser installed on every system) about it, since web browsers already have a way to retrieve this information from the OS.

https://developer.mozilla.org/en/How_Mozilla_determines_MIME_Types#Helper_Applications
http://msdn.microsoft.com/en-us/library/ms775148%28v=vs.85%29.aspx
http://stackoverflow.com/questions/136948/launching-a-registered-mime-helper-application
http://kb.mozillazine.org/File_types_and_download_actions
« Last Edit: 25 January 2011, 01:51:38 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
The seversided code (PHP) would be easy ... but registering a MIME-type ist almost the same as a Protocol-handler

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Well the difference between protocol handler and MIME type registration is that in addition to having to register both with the OS, you also have to explicitly whitelist protocol handlers on some web browsers, such as Firefox. But aside form that, it can involve the same efforts, I agree. Just that I think a helper application is a less intrusive and thus nicer way to achieve it.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·