Ticket #3171: test1.patch

File test1.patch, 1.2 KB (added by elexis, 9 years ago)

I used this patch to dump the playerlist received by the c++ xmpp client. That one seems to work fine. Each time I got an update, there were no dupes in the dump, although there were dupes in the GUI (even an offline player displayed 2 times as busy).

  • binaries/data/mods/public/gui/lobby/lobby.js

     
    151151/**
    152152 * Do a full update of the player listing, including ratings from C++.
    153153 *
    154154 * @return Array containing the player, presence, nickname, and rating listings.
    155155 */
    156156function updatePlayerList()
    157157{
    158158    var playersBox = Engine.GetGUIObjectByName("playersBox");
    159159    var playerList = [];
    160160    var presenceList = [];
    161161    var nickList = [];
    162162    var ratingList = [];
    163163    var cleanPlayerList = Engine.GetPlayerList();
     164    error(JSON.stringify(cleanPlayerList));
    164165    // Sort the player list, ignoring case.
    165166    cleanPlayerList.sort(function(a,b)
    166167    {
    167168        var aName = a.name.toLowerCase();
    168169        var bName = b.name.toLowerCase();
    169170        return ((aName > bName) ? 1 : (bName > aName) ? -1 : 0);
    170171    } );
    171172    for (var i = 0; i < cleanPlayerList.length; i++)
    172173    {
    173174        // Identify current user's rating.
    174175        if (cleanPlayerList[i].name == g_Name && cleanPlayerList[i].rating)
    175176            g_userRating = cleanPlayerList[i].rating;
    176177        // Add a "-" for unrated players.