Javascript command using the coui to join server no longer works

Discussion in 'Support!' started by cheezeit, November 23, 2016.

  1. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    So the command that I was given a long time ago to join a server (running Titans) was:

    sessionStorage['gameHostname'] = '"<IP>"'; sessionStorage['gamePort'] = '<port>';window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?content=PAExpansion1&local=false'

    Ever since the last 2 patches this now has failed to work. It seems that for some reason the command no longer works as the scripts seem to have changed. The mods that rely on this command also have stopped working.

    Do we have an updated command to use to join by IP straight?

    I did some troubleshooting, and I am no coder by any stretch but....I am thinking there's an issue on passing gameHostname and gamePort onto the file that is referenced as connect_to_game.html. It doesn't seem like the information that is passed is getting to the connect_to_game.js file......
    Last edited: November 23, 2016
  2. mikeyh

    mikeyh Post Master General

    Messages:
    1,869
    Likes Received:
    1,509
  3. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    That's cool, thank you sir.

    In the mean time, is there a workaround? Maybe an equivalent Coherent UI script like the one that was used before for direct connection?
  4. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    So I did some more troubleshooting....and I figured out the debugger works with the game coherent UI.....which is kinda cool...

    So when I do the above command to connect to the game via IP on the console I get the following output and errors....

    From looking at the HTML file it SEEMS like jQuery is no longer referenced in there.....which is odd.....I'm guessing it should be?

    I see the _trigger under the boot.js file......so it's kind of odd that the other files can't see it....


    Code:
    sessionStorage['gameHostname'] = '"10.0.0.250"'; sessionStorage['gamePort'] = '27050';window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?content=PAExpansion1&local=false';
    "coui://ui/main/game/connect_to_game/connect_to_game.html?content=PAExpansion1&local=false"
    Uncaught TypeError: Object #<Object> has no method '_trigger'
    mods loaded in 0 seconds boot.js:44386
    loading Community Mods Manager in connect_to_game
    coui://download/community-mods-jszip.custom.min.js loaded in 0.02 seconds boot.js:44348
    coui://download/community-mods-manager.js loaded in 0.073 seconds boot.js:44348
    coui://download/community-mods-connect_to_game.js loaded in 0.082 seconds boot.js:44348
    connect_to_game ?content=PAExpansion1&local=false
    failed to join game 10.0.0.250 27050
    Uncaught TypeError: Object #<Object> has no method '_trigger'
    mods loaded in 0 seconds boot.js:44386
    loading CommunityModsManager in transit
    coui://download/community-mods-jszip.custom.min.js loaded in 0.02 seconds boot.js:44348
    coui://download/community-mods-manager.js loaded in 0.066 seconds boot.js:44348
    downloadOfflineFiles
    resetServerMods
    coui://download/community-mods-transit.js loaded in 0.075 seconds boot.js:44348
    updateActiveZipMods
    updateZipMods
    downloadMany 0
    0.002 seconds to update installed zip mods
    download community-mods-client.zip with md5: undefined from data
    download community-mods-server.zip with md5: undefined from data
    downloadMany 13
    download community-mods-jszip.custom.min.js with md5: 459ee49f5a208773d772853d76724979 from https://cdn.palobby.com/community-mods/js/jszip.custom.min.js
    download community-mods-manager.js with md5: 4cefe1023e8a307125835b846220e09e from https://cdn.palobby.com/community-mods/js/community-mods-manager.js
    download community-mods-main.js with md5: ee52de5a8abb5eb1bc6b0a765825141f from https://cdn.palobby.com/community-mods/js/main.js
    download community-mods-start.css with md5: be80acc81326d7047ae3b311bf365975 from https://cdn.palobby.com/community-mods/css/start.css
    download community-mods-start.js with md5: 1dc0e3395800e7d74b90cc4fe834029b from https://cdn.palobby.com/community-mods/js/start.js
    download community-mods.css with md5: 5d45d0defa6b20198018204edb0a5b51 from https://cdn.palobby.com/community-mods/css/community-mods.css
    download community-mods.html with md5: 6a02a3d904285695be882f0804ad3f16 from https://cdn.palobby.com/community-mods/html/community-mods.html
    download community-mods.js with md5: ff51a29932f6caca9b3036a96bf79ef8 from https://cdn.palobby.com/community-mods/js/community-mods.js
    download community-mods-server_browser.js with md5: c5fa235f9d694b77102cf56495e35a3e from https://cdn.palobby.com/community-mods/js/server_browser.js
    download community-mods-connect_to_game.js with md5: c233967f662526ec97d441d2565dc251 from https://cdn.palobby.com/community-mods/js/connect_to_game.js
    download community-mods-transit.js with md5: 964323d1134a7c0bcc4831413157db67 from https://cdn.palobby.com/community-mods/js/transit.js
    download community-mods-replay_loading.js with md5: de870f5199e7ad4fdc88e532bdc966b6 from https://cdn.palobby.com/community-mods/js/replay_loading.js
    download community-mods-gw_referee.js with md5: 758c8c27623a8218b52710be27251d5b from https://cdn.palobby.com/community-mods/js/gw_referee.js
    download community-mods-client.zip completed in 0.037 seconds
    remountClientMods
    download community-mods-server.zip completed in 0.038 seconds
    community-mods-jszip.custom.min.js up to date
    community-mods-manager.js up to date
    community-mods-main.js up to date
    community-mods-start.css up to date
    community-mods-start.js up to date
    community-mods.css up to date
    community-mods.html up to date
    community-mods.js up to date
    community-mods-server_browser.js up to date
    community-mods-connect_to_game.js up to date
    community-mods-transit.js up to date
    community-mods-replay_loading.js up to date
    community-mods-gw_referee.js up to date
    0.178 seconds to download offline files
    mountClientMods
    mountZipMod community-mods-client /download/community-mods-client.zip
    mounting /download/community-mods-client.zip to /client_mods/ OK
    0.013 seconds to mount client zip mods
    0.117 seconds to mount client mods and remount
    0.133 seconds to remount client mods
    0.296 seconds to transit done
    Uncaught TypeError: Object #<Object> has no method '_trigger'
    mods loaded in 0 seconds boot.js:44386
    loading CommunityModsManager in start
    coui://download/community-mods-jszip.custom.min.js loaded in 0.02 seconds boot.js:44348
    coui://download/community-mods-manager.js loaded in 0.092 seconds boot.js:44348
    0 seconds to startup ready
    coui://download/community-mods-start.js loaded in 0.102 seconds boot.js:44348
    Community Mods is checking user systems database
    Community Mods is preventing unmountAllMemoryFiles
    Hmm....interesting...

    What is the trigger method that is no longer there....hmm...

    Uber peeps? mikeyh?
    Last edited: November 27, 2016
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I don't know the exact cause of
    but it is not your issue. That error means nothing, has been around in ages and can just be ignored.

    I can't tell you how to fix the piece of code though, haven't had a look at PAs UI code in quite a while. The questions you need to answer is:
    Where does the UI code print "failed to join game 10.0.0.250 27050" and why does it do that? I.e. why does it fail?
  6. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    Ok, so I did it again just to absolutely double check and here's the results I get:

    Code:
    sessionStorage['gameHostname'] = '"10.0.0.250"'; sessionStorage['gamePort'] = '27050';window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?content=PAExpansion1&local=false'
    "coui://ui/main/game/connect_to_game/connect_to_game.html?content=PAExpansion1&local=false"
    Uncaught TypeError: Object #<Object> has no method '_trigger'
    (anonymous function)
    mods loaded in 0 seconds boot.js:44386
    loading Community Mods Manager in connect_to_game
    coui://download/community-mods-jszip.custom.min.js loaded in 0.019 seconds boot.js:44348
    coui://download/community-mods-manager.js loaded in 0.069 seconds boot.js:44348
    coui://download/community-mods-connect_to_game.js loaded in 0.08 seconds boot.js:44348
    connect_to_game ?content=PAExpansion1&local=false
    failed to join game 10.0.0.250 27050
    CommunityMods.model.setup
    (anonymous function) connect_to_game.js:487
    fire boot.js:3130
    self.fireWith boot.js:3242
    jQuery.extend.ready boot.js:3448
    completed boot.js:3464
    Uncaught TypeError: Object #<Object> has no method '_trigger'
    mods loaded in 0 seconds boot.js:44386
    loading CommunityModsManager in transit
    coui://download/community-mods-jszip.custom.min.js loaded in 0.02 seconds boot.js:44348
    coui://download/community-mods-manager.js loaded in 0.069 seconds boot.js:44348
    downloadOfflineFiles
    resetServerMods
    coui://download/community-mods-transit.js loaded in 0.08 seconds boot.js:44348
    downloadMany 13
    download community-mods-jszip.custom.min.js with md5: 459ee49f5a208773d772853d76724979 from https://cdn.palobby.com/community-mods/js/jszip.custom.min.js
    download community-mods-manager.js with md5: 4cefe1023e8a307125835b846220e09e from https://cdn.palobby.com/community-mods/js/community-mods-manager.js
    download community-mods-main.js with md5: ee52de5a8abb5eb1bc6b0a765825141f from https://cdn.palobby.com/community-mods/js/main.js
    download community-mods-start.css with md5: be80acc81326d7047ae3b311bf365975 from https://cdn.palobby.com/community-mods/css/start.css
    download community-mods-start.js with md5: 1dc0e3395800e7d74b90cc4fe834029b from https://cdn.palobby.com/community-mods/js/start.js
    download community-mods.css with md5: 5d45d0defa6b20198018204edb0a5b51 from https://cdn.palobby.com/community-mods/css/community-mods.css
    download community-mods.html with md5: 6a02a3d904285695be882f0804ad3f16 from https://cdn.palobby.com/community-mods/html/community-mods.html
    download community-mods.js with md5: ff51a29932f6caca9b3036a96bf79ef8 from https://cdn.palobby.com/community-mods/js/community-mods.js
    download community-mods-server_browser.js with md5: c5fa235f9d694b77102cf56495e35a3e from https://cdn.palobby.com/community-mods/js/server_browser.js
    download community-mods-connect_to_game.js with md5: c233967f662526ec97d441d2565dc251 from https://cdn.palobby.com/community-mods/js/connect_to_game.js
    download community-mods-transit.js with md5: 964323d1134a7c0bcc4831413157db67 from https://cdn.palobby.com/community-mods/js/transit.js
    download community-mods-replay_loading.js with md5: de870f5199e7ad4fdc88e532bdc966b6 from https://cdn.palobby.com/community-mods/js/replay_loading.js
    download community-mods-gw_referee.js with md5: 758c8c27623a8218b52710be27251d5b from https://cdn.palobby.com/community-mods/js/gw_referee.js
    updateActiveZipMods
    updateZipMods
    downloadMany 0
    0.002 seconds to update installed zip mods
    download community-mods-client.zip with md5: undefined from data
    download community-mods-server.zip with md5: undefined from data
    community-mods-jszip.custom.min.js up to date
    community-mods-manager.js up to date
    community-mods-main.js up to date
    community-mods-start.css up to date
    community-mods-start.js up to date
    community-mods.css up to date
    community-mods.html up to date
    community-mods.js up to date
    community-mods-server_browser.js up to date
    community-mods-connect_to_game.js up to date
    community-mods-transit.js up to date
    community-mods-replay_loading.js up to date
    community-mods-gw_referee.js up to date
    0.123 seconds to download offline files
    download community-mods-client.zip completed in 0.028 seconds
    remountClientMods
    download community-mods-server.zip completed in 0.028 seconds
    mountClientMods
    mountZipMod community-mods-client /download/community-mods-client.zip
    mounting /download/community-mods-client.zip to /client_mods/ OK
    0.012 seconds to mount client zip mods
    0.127 seconds to mount client mods and remount
    0.138 seconds to remount client mods
    0.28 seconds to transit done
    Uncaught TypeError: Object #<Object> has no method '_trigger'
    (anonymous function)
    mods loaded in 0 seconds boot.js:44386
    loading CommunityModsManager in start
    coui://download/community-mods-jszip.custom.min.js loaded in 0.019 seconds boot.js:44348
    coui://download/community-mods-manager.js loaded in 0.071 seconds boot.js:44348
    0 seconds to startup ready
    coui://download/community-mods-start.js loaded in 0.078 seconds boot.js:44348
    Community Mods is checking user systems database
    Community Mods is preventing unmountAllMemoryFiles
    
    
  7. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    Ok cool, thank you for the response cola_colin. I am not much of a programmer but I figured that it might have been something that looked odd.

    So I have attached more output from the failure from the console.

    The UI code print of that.....is something of a mystery. I do not know why it is saying that to be honest.

    The things I have noticed and troubleshot are this.

    I have verified connectivity to 10.0.0.250, on that port number as well (using a TCP ping on that port specifically when the PA server is running). Those all work properly. The PA server itself is working properly. The part I have verified is that my computer (that is running the PA game in full) is *NOT* sending a join request to the server on that port as it should do. I have noticed that there is absolutely no traffic that the game generates locally to send to the server. It's almost as if the game locally isn't able to establish a socket and send the information it needs to send to the server to join. However that is all speculation on my part, but I have some reason to believe that is what is happening as I don't see the TCP session even open on my local computer.

    Is there something I can do to help reproduce this symptom? Like a video or a screen capture?
  8. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    When I load a local server on my computer, I see this....which is different than before using api.net.connect.

    It seems that the connect is different now than it was before.


    Code:
    mods loaded in 0 seconds boot.js:44386
    loading Community Mods Manager in connect_to_game
    coui://download/community-mods-jszip.custom.min.js loaded in 0.02 seconds boot.js:44348
    coui://download/community-mods-manager.js loaded in 0.084 seconds boot.js:44348
    coui://download/community-mods-connect_to_game.js loaded in 0.091 seconds boot.js:44348
    connect_to_game ?action=start&content=PAExpansion1&local=true
    mountServerZipMods
    mountZipMod community-mods-server /download/community-mods-server.zip
    mounting /download/community-mods-server.zip to /server_mods/ OK
    0.089 seconds to mount server zip mods
    api.net.connect localhost:20545 PAExpansion1 boot.js:39051
    Uncaught TypeError: Object #<Object> has no method '_trigger'
    mods loaded in 0 seconds boot.js:44386
    
  9. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    Holy crap I figured it out....

    So the command now is:
    Code:
    sessionStorage['gameHostname'] = '"10.0.0.250"'; sessionStorage['gamePort'] = '27050';window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?action=start&content=PAExpansion1&local=false'
    Whereas the old command was:
    Code:
    sessionStorage['gameHostname'] = '"10.0.0.250"'; sessionStorage['gamePort'] = '27050';window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?content=PAExpansion1&local=false'
    There y'all go. When you guys make the mods, please use the above command that works (the first code snippet)

    w00t w00t w00t w00t.....
  10. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    I take it back, it doesn't seem to work. It seems to connect to a local instance when I use that and NOT the remote instance of the server....
  11. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    After doing more searching, it seems that for what it's worth the parameters to pass into the "connect_to_game.html" have indeed changed.

    I am not quite sure what to pass into there but I believe that for things to work we need to pass the proper parameters. I'm just looking through the scripts and yeah....it's definitely not very simple for my not very programming savvy mind.

    Ok, so after I looked through the join script I think I see what's going on.

    It seems that the functionality for private dedicated servers has been taken out. It seems the API call to join a server only accepts two options...


    // local parameter overrides
    if (local) {
    self.isLocalGame(true);
    self.serverType('local');
    }
    else if (start) {
    self.isLocalGame(false);
    self.serverType('uber');
    }


    Either local, or uber. If it doesn't fall into one of those two then the script terminates and the join to the IP address and port specified fails. Does this mean that Uber has disallowed private dedicated servers?
    Last edited: November 28, 2016
  12. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    There never was code that worked with "dedicated private servers", it always was a hack.

    Basically by setting the host:ip directly before switching into the connect scene you'd skip the resolution of those values from an uber server "lobby" id and go straight to the "connect to the server" part. With respect to the if else statement you posted: Custom servers simply don't need to do either of those things.

    From a quick look at the new code, they now actually do consider custom servers a little. At least those words pop up in the comments.

    My -blind- guess on a new command, with some new lines for better readability, is:

    Code:
    sessionStorage['gameHostname'] = '"<IP>"';
    sessionStorage['gamePort'] = '<Port>';
    sessionStorage['game_type'] = 'custom';
    window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?content=PAExpansion1&local=false'
    
    The idea here is that the if-else branch you want to get into is most likely the one around line 277 and that now checks !needsJoinGame, which is true for game_type = custom (or any other string that is not 'uber')

    That "needsJoinGame" seems to be about joining the game on the ubernet backend, which you simply don't need to.
  13. cheezeit

    cheezeit Member

    Messages:
    30
    Likes Received:
    7
    Going through that it seems that the custom game type doesn't exist. A quick search doesn't yield anything as game_type = custom. I also even changed it in the sense of gameType and serverType to be 'custom' and yeah still no go.

    It seems that copyliu (who is AWESOME for updating his mod) has just updates his "connect via IP" mod and now it works. I verified it working now and connecting to my server...

    It seems that the things that needed to be set are (from the mod that copyliu so graciously has made....all props to him):

    Code:
      model.LANCONNECT=function LANCONNECT(e){
      model.gameHostname(model.LANSERVERIP)
      model.gamePort( model.LANSERVERPORT);
      model.isLocalGame(true);
      model.serverType("custom");
      model.serverSetup('game');
      sessionStorage['game_content'] = '"'+model.VERSION+'"';
      sessionStorage['active_content'] = '"'+model.VERSION+'"';
      sessionStorage['unlocked_content'] = '"["PAExpansion1"]"';
      sessionStorage['gameType'] = 'custom';
      window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?content='+model.VERSION;
    };
    Now I need to see if I can figure out how to make this in that command line for the console....

    The PA community is truly awesome. Thank you cola_colin and thank you to copyliu ....
    Last edited: November 28, 2016
  14. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    It doesn't need to exist. It just needs to be not equal to "uber" and some other ladder related value.

Share This Page