[INFO] How To Open Replay Links

Discussion in 'Videos And Replays!' started by cptconundrum, May 1, 2014.

  1. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Now that this forum allows links to game replays, I want to let you all know how you can open those links in PA.

    I think you will need PA stats installed to use these links.

    @cola_colin has set up a system with PA Stats that will allow links in the format "http://pastats.com/replay/############". In order to take advantage of links you see in this format, you will need to so a few quick steps. On Windows, just do this;
    • Make a new .txt file on your desktop. (You can use Notepad for this)
    • Copy and paste this into the file:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Wow6432Node\startpa]
    @=""
    "URL Protocol"=""
    
    [HKEY_CLASSES_ROOT\Wow6432Node\startpa\shell]
    
    [HKEY_CLASSES_ROOT\Wow6432Node\startpa\shell\open]
    
    [HKEY_CLASSES_ROOT\Wow6432Node\startpa\shell\open\command]
    @="C:\\Program Files (x86)\\PA\\Planetary Annihilation\\stable\\PA.exe --uioptions \"%1\""
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\startpa]
    @=""
    "URL Protocol"=""
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\startpa\shell]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\startpa\shell\open]
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\startpa\shell\open\command]
    @="C:\\Program Files (x86)\\PA\\Planetary Annihilation\\stable\\PA.exe --uioptions \"%1\""
    
    • Find both places with this string: "C:\\Program Files (x86)\\PA\\Planetary Annihilation\\stable\\PA.exe" and replace it with the actual path to your PA.exe (Don't forget to use double backslashes like in the original example.)
      • If you use Steam and need to find the game files, follow these instructions:
        • Open the Steam library and right click on PA, then select "Properties".
        • Go to the Local Files tab and click "Browse local files".
    • Save the file. Go to the desktop and rename it to "pastats.reg"
      • If you can't rename the file "pastats.reg", go to a folder window, click top left "organize", go down to "folder and search options", go to the "view" tab, scroll down to "Hide recognized file extensions" and UNCHECK it. Then you can see ".file" file extensions, such as .txt at the end of text files. Change that to ".reg", then you may revert the changes to hide them again.
    • Double-click on the file to run it as a program.
    Trouble shooting
    If you have told chrome to never open startpa:// links and you want to revoke that look here: https://forums.uberent.com/threads/rel-external-ui.59469/page-2#post-928776
    Last edited by a moderator: September 1, 2014
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Mac Instructions

    https://github.com/pamods/pastats-macos-replaylinks-handler

    Last edited: May 1, 2014
  3. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Linux Instructions

    Thanks to @DeathByDenim for the Linux instructions.
    Last edited: May 1, 2014
  4. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    thanks, I was going to make this. good going!
  5. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Great! Now I just need to be able to start these games mid-way with me as a player and my friends/the ai (which happen to be the same, don't judge me) as the other players.

    Here's to hoping for that.
    stormingkiwi likes this.
  6. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    ADD THIS TO INSTRUCTIONS FOR WINDOWS:

    If you can't rename the file "pastats.reg", go to a folder window, click top left "organize", go down to "folder and search options", go to the "view" tab, scroll down to "Hide recognized file extensions" and UNCHECK it. Then you can see ".file" file extensions, such as .txt at the end of text files. Change that to ".reg", then you may revert the changes to hide them again.
    cptconundrum likes this.
  7. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Browsers don't seem to listen to what the OS is saying it seems. So, first create a script to start PA. I called it startpahandler and put it in my PA dir.
    Code:
    #!/bin/bash
    
    /home/jarno/Games/PA/PA --username $@
    where you should replace "/home/jarno/Games/PA/PA" with wherever your PA binary is located. Then make that script executable:
    Code:
    chmod +x startpahandler
    Then for the browser specific stuff:
    Opera
    Go to Tools -> Preferences -> Advanced -> Programs. Press "Add". Then fill in the following fields:
    Protocol: startpa
    Open with other application: /home/jarno/Games/PA/startpahandler

    Firefox
    Just open a startpa:// link and it will ask you which program to use. Choose the startpahandler program you just made.

    And similar for other browsers.
  8. MindALot

    MindALot Member

    Messages:
    38
    Likes Received:
    5
    I can't seem to get the link to work on window 8, using Steam.
    Before using the registry change, the link just failed (I usually test before and after)
    After the registry change, I was prompted for a program - I selected PA.exe. Maybe that was the mistake?
    I can't seem to figure out how to undo that link.

    PA loads, but the replay does not load.
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I think the select PA.exe is the problem. If setup properly it should just know what to do.
    What browser are you using? Can you have a look at the taskmanager to check what parameters pa.exe is given?
    It should look like this:
    [​IMG]
    If it does look like that it is steam which is at fault. The autologin may result in a different order of internal events or something like that, so the code to launch the replay never triggers. But I can't test that. I am surprised that it does do anything with steam in the first place if you directly start pa.exe
  10. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    There's been a new command line parameter added to PA.exe in the PTE stream:
    --uioptions : optional data sent to the ui on start
    cptconundrum and cola_colin like this.
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Uber really should tell us when they fullfil our wishes :D
  12. nguk9

    nguk9 New Member

    Messages:
    27
    Likes Received:
    9
    I have try to do this manipulation but it didn't work. When I'm clicking on the sparta chrome says : run this application or cancel, i run this application and nothing happens ! The problem is now i can't watch replays directly on PA because Pa is always crashing since the changement of the register. What can I do to fix this problem ?

    Thanks per advance !
  13. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    PA is crashing because you changed that part of the registry?
    I can't make any sense of that, should not happen.
    Can you show us the full content of the exact registry file you imported? Most of these issues have been people (like myself) forgetting some random \ or the like somewhere.
  14. brianpurkiss

    brianpurkiss Post Master General

    Messages:
    7,879
    Likes Received:
    7,438
    This isn't working for me.

    I'm on OSX with the latest version of Mavericks. I edited the path to the game as I'm using the Uber Launcher.

    PA launches just fine, but it only launches. It launches and doesn't go to the replay.

    Any ideas on what's going on?
  15. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I get the same thing on Windows. I think the PA Stats mod might no longer support those links.
  16. brianpurkiss

    brianpurkiss Post Master General

    Messages:
    7,879
    Likes Received:
    7,438
    RARGH!

    There's a video I really wanted to commentate... :-(

    @cola_colin is this fixable?
  17. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    For now it might be possible to copy the replay id from the link and enter that into the search box on the replay page in the game. It's not convenient at all, but at least you should be able to watch the game.
  18. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I have a local fix. Give me 15min or so to verify a few more things. ...hopefully

    Until then you can enter this in the debugger console to start a replay after you logged in:

    window.location.href = "coui://ui/main/game/connect_to_game/connect_to_game.html?action=start&replayid=<replay-id-here>"
    brianpurkiss likes this.
  19. brianpurkiss

    brianpurkiss Post Master General

    Messages:
    7,879
    Likes Received:
    7,438
    That only works for matches that take place within... minutes. The search function is crap and doesn't show results for even slightly old gameplay.
    Quitch likes this.
  20. brianpurkiss

    brianpurkiss Post Master General

    Messages:
    7,879
    Likes Received:
    7,438
    You rock.

Share This Page