Index: ps/trunk/binaries/data/mods/public/gui/lobby/lobby.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/lobby/lobby.js +++ ps/trunk/binaries/data/mods/public/gui/lobby/lobby.js @@ -1044,7 +1044,8 @@ if (!game) return; - let username = g_UserRating ? g_Username + " (" + g_UserRating + ")" : g_Username; + let rating = getRejoinRating(game); + let username = rating ? g_Username + " (" + rating + ")" : g_Username; if (game.state == "init" || stringifiedTeamListToPlayerData(game.players).some(player => player.Name == username)) joinSelectedGame(); @@ -1097,13 +1098,27 @@ "ip": ip, "port": port, "name": g_Username, - "rating": g_UserRating, + "rating": getRejoinRating(game), "useSTUN": !!game.stunIP, "hostJID": game.hostUsername + "@" + g_LobbyServer + "/0ad" }); } /** + * Rejoin games with the original playername, even if the rating changed meanwhile. + */ +function getRejoinRating(game) +{ + for (let player of stringifiedTeamListToPlayerData(game.players)) + { + let [nick, rating] = splitRatingFromNick(player.Name); + if (nick == g_Username) + return rating; + } + return g_UserRating; +} + +/** * Open the dialog box to enter the game name. */ function hostGame()