[REL] [CLIENT] [SERVER] [LOBBY] Game Invites

Discussion in 'Mod Discussions' started by mikeyh, April 4, 2015.

  1. mikeyh

    mikeyh Post Master General

    Messages:
    1,884
    Likes Received:
    1,537
    The client mod fixes game invites for LAN and custom servers is required for players.

    The server mod is for custom servers and hosts who want control over invites with the Allow Players to Send Game Invites checkbox.

    Technical Details

    /ui/main/shared/js/helper.js globalHandlers.join_lobby discards the game hostname and port causing clients that accept a custom server game invite to freeze on requesting permission forever while trying to resolve a fake lobbyId from the custom server.

    Code:
            gameHostname(null);
            gamePort(null);
            joinLocalServer(false);
    
    This handler is replaced with a version that preserves the game hostname and port.

    /ui/main/uberbar/uberbar.js handlers.lobby_info will discard the lobby_info if there is no lobby_id for a non local games.

    Code:
        handlers.lobby_info = function (payload) {
            var info_ok = (payload.local_game)
                    ? (payload.game_hostname && payload.game_port)
                    : (payload.lobby_id);
    
            model.lobbyInfo(info_ok ? payload : false);
        }
    
    Local game invites would still fail without the fix to helpers.js as the game hostname and port are discarded.

    Custom server support is added with the following:

    Code:
            var info_ok = (payload.local_game || payload.custom_server )
    
    Original post...

    Last edited: December 18, 2015
    Quitch, stawos and mishtakashi like this.
  2. mikeyh

    mikeyh Post Master General

    Messages:
    1,884
    Likes Received:
    1,537
    Game invites now work for custom servers.
  3. mikeyh

    mikeyh Post Master General

    Messages:
    1,884
    Likes Received:
    1,537
    As requested by @stawos added my game name changes should not unready players.

    Workaround implemented by making player ready again based on the following:
    • player was ready
    • game name has changed
    • game name was not empty (may change this)
    On the server in server-script/states/lobby.js the default behaviour for modify_settings is to unready all players.
  4. mikeyh

    mikeyh Post Master General

    Messages:
    1,884
    Likes Received:
    1,537
    1.1.x now supports Titans and includes fixes for LAN and custom server games.

    Players needs the client mod to receive LAN and custom server invites.

    Hosts need the server mod for custom servers or if they want to control invites with the Allow Players to Send Game Invites checkbox.

    Updated original post with technical details.

    @cola_colin we should probably remove lobbyIds from custom servers... they are not needed.
    DeathByDenim likes this.
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Not gonna touch anything PA related any time soon, especially not if it works right now. Busy with other stuff, sorry.
    Pretty sure however that PA Stats uses the lobbyid for managing the games, so you'd need to fill in some other ID instead.
  6. mikeyh

    mikeyh Post Master General

    Messages:
    1,884
    Likes Received:
    1,537
    Move the zip over to the PA Stats server and I'll update.

    I strip the lobbyId to fix game invites.
  7. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    O ;un upu mikr​
  8. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    You can put in the zip as well, as of now there is no code repository with it anywhere. When I made it I just hacked stuff together and put it in a zip because I was too lazy. I never made a repository.
  9. Killerkiwijuice

    Killerkiwijuice Post Master General

    Messages:
    3,882
    Likes Received:
    3,625
    wat
  10. xankar

    xankar Post Master General

    Messages:
    752
    Likes Received:
    1,009
    Pretty sure he was wasted when he posted that. He was posting some strange things throughout the forums at the time.
    Killerkiwijuice likes this.
  11. xankar

    xankar Post Master General

    Messages:
    752
    Likes Received:
    1,009
    rip, double post.
    Killerkiwijuice likes this.
  12. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Nah. I know that kiwi likes to be a grammar nazi from time to time so I though I'd give him a challange
    [​IMG]
    Killerkiwijuice likes this.
  13. Killerkiwijuice

    Killerkiwijuice Post Master General

    Messages:
    3,882
    Likes Received:
    3,625
    Challenge* kappa
    xankar likes this.

Share This Page