From 8f4daa9dd05596ed714ea005e040b51dab235340 Mon Sep 17 00:00:00 2001 From: elexis Date: Mon, 21 Mar 2016 03:44:01 +0000 Subject: [PATCH] Lobby performance improvement. Since 8b437a0b1c, updatePlayerList() is called everytime a muc-message is received, calling playersBox.SelectionChange(), calling displayProfile() which requests the profile from the server again. Similar cases should be handled in #3840. This was SVN commit r17924. --- binaries/data/mods/public/gui/lobby/lobby.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binaries/data/mods/public/gui/lobby/lobby.js b/binaries/data/mods/public/gui/lobby/lobby.js index 038024de6a..572f5f495f 100644 --- a/binaries/data/mods/public/gui/lobby/lobby.js +++ b/binaries/data/mods/public/gui/lobby/lobby.js @@ -353,7 +353,10 @@ function updatePlayerList() playersBox.list_status = presenceList; playersBox.list_rating = ratingList; playersBox.list = nickList; - playersBox.selected = playersBox.list.indexOf(g_SelectedPlayer); + + // To reduce rating-server load, only send the GUI event if the selection actually changed + if (playersBox.selected != playersBox.list.indexOf(g_SelectedPlayer)) + playersBox.selected = playersBox.list.indexOf(g_SelectedPlayer); } /**