1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

easy kag:// redirects in BBS/etc

Discussion in 'Community Dev Corner' started by FliesLikeABrick, Jul 5, 2012.

Mods: Downburst, Mazey
  1. FliesLikeABrick

    FliesLikeABrick THD Team THD Team Administrator Global Moderator

    Messages:
    952
    So in my last thread here, I showed a way to create URLs which join a (currently Windows-only) client to the server which someone is playing on along with the code that can be used to do so, including the API calls

    This leaves a simple but well-defined gap in features - there isn't a way to easily create a http:// URL which will take someone to a specified server in a similar fashion! There are some situations, like on this forum software, where kag:// and other arbitrary application URIs don't work. For this, I created the following:

    https://poc.kag2d.com/joinserver/ip/67.23.118.185/port/50314

    Which is actually rewritten to:
    https://poc.kag2d.com/joinserver/joinserver.php?IPAddress=67.23.118.185&port=50314

    There are few situations where this is probably helpful, but around these forums is one of them.

    Here's the stupidly simple php source:
    https://poc.kag2d.com/joinserver/joinserver.phps

    And the .htaccess file I have which does this rewrite:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/joinserver/ip/[0-9\.:]+/port/[0-9]+
    RewriteRule ^joinserver/ip/([0-9\.]+)/port/([0-9]+) joinserver/joinserver.php?IPAddress=$1&port=$2
     
  2. Downburst

    Downburst Mindblown Global Moderator Forum Moderator Donator Tester

    Messages:
    1,814
    Would it be possible to add passwords to this? :)
     
    Boxpipe and soulrealm like this.
  3. VanHuek

    VanHuek KAG Guard Tester

    Messages:
    751
    So had do I get it to work in Chrome? Would be very helpful for gather.
     
    Boxpipe likes this.
  4. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    You can also try KAG:// IP : port
     
    Boxpipe likes this.
  5. VanHuek

    VanHuek KAG Guard Tester

    Messages:
    751
    That doesn't work, it does in IE though.
     
    Boxpipe likes this.
  6. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    Pretty sure it works for my firefox and chrome
     
    Boxpipe likes this.
  7. Downburst

    Downburst Mindblown Global Moderator Forum Moderator Donator Tester

    Messages:
    1,814
    I should work on all windows clients as long as you've KAG installed correctly afaik. (fresh install within last 12 months)
     
    Boxpipe likes this.
  8. VanHuek

    VanHuek KAG Guard Tester

    Messages:
    751
    Why would it then work in IE? And probably the way i've installed it as I have about 12 different KAGs.
     
    Boxpipe likes this.
  9. Conquerer

    Conquerer Shark Slayer

    Messages:
    360
    Amazing! :p
     
    Boxpipe likes this.
Mods: Downburst, Mazey