Trailing slash when using the armagetronad protocol on win

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
Post Reply
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Trailing slash when using the armagetronad protocol on win

Post by AI-team »

I've been experimenting with the "--connect" command line option and I noticed that if you actually register the "armagetronad" protocol and open a sample URI in the browser (armagetronad://69.162.170.184:4539), windows will always append a trailing slash to it, therefore making Armagetron unable to parse the port. To fix this behaviour, all you need to is apply this small patch:

Code: Select all

=== verändert Datei src/tron/gCommandLineJumpStart.cpp
--- src/tron/gCommandLineJumpStart.cpp	2008-01-16 10:27:25 +0000
+++ src/tron/gCommandLineJumpStart.cpp	2013-07-07 16:16:14 +0000
@@ -99,6 +99,10 @@
     {
         servername = raw.SubStr( 0, portStart );
         port       = raw.SubStr( portStart + 1 );
+
+        // windows appends a trailing forward slash to all URIs which mean we need to remove these
+        if(port.EndsWith("/"))
+            port = port.SubStr(0, port.Size()-1);
     }
     else
     {

P.S. If you would like to register the protocol but don't know how, check out this small application I wrote, it's really easy to use:
http://therealplayer1.com/aisb/protocol.exe
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Re: Trailing slash when using the armagetronad protocol on w

Post by epsy »

Erm, we'd rather have the source than a closed-source binary. Isn't it simply a matter of adding a few items in the registry anyway?
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Re: Trailing slash when using the armagetronad protocol on w

Post by AI-team »

epsy wrote:Erm, we'd rather have the source than a closed-source binary.
https://github.com/gitnik/aisb/blob/mas ... l/Form1.cs
epsy wrote:Isn't it simply a matter of adding a few items in the registry anyway?
Yes, it's pretty easy if you know your way around the registry, but if you've never done anything with it before and are not too tech-savvy, this small app will certainly help you
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Re: Trailing slash when using the armagetronad protocol on w

Post by epsy »

Right. The installer we use has a few macros related to setting registry keys. I'll look into it next time I boot into Windows, unless another developer does so before me.
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Re: Trailing slash when using the armagetronad protocol on w

Post by epsy »

Done. armagetronad:// links are now supported in the windows installers on the 0.4 branch.
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Re: Trailing slash when using the armagetronad protocol on w

Post by AI-team »

Awesome, now we just need to add the little code snippet from the OP
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Re: Trailing slash when using the armagetronad protocol on w

Post by dlh »

Trailing slashes get removed in the code epsy committed.
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Re: Trailing slash when using the armagetronad protocol on w

Post by AI-team »

Ah sweet, I must have somehow overlooked that commit
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
Post Reply