agario-client.js
function(client, packet) {
            var highlights = [];
            var names = [];
            var count = packet.readUInt32LE();

            for(var i=0;i<count;i++) {
                var highlight = packet.readUInt32LE();

                var name = '';
                while(1) {
                    var char = packet.readUInt16LE();
                    if(char == 0) break;
                    name += String.fromCharCode(char);
                }

                highlights.push(highlight);
                names.push(name);
            }

            if(JSON.stringify(client.leaderHighlights) == JSON.stringify(highlights) &&
                JSON.stringify(client.leaderNames) == JSON.stringify(names)) {
                return;
            }
			
            var old_highlights  = client.leaderHighlights; 
            var old_leaderNames = client.leaderNames;
			client.leaderHighlights = highlights;
            client.leaderNames      = names;

            if(client.debug >= 3)
                client.log('leaders update: ' + JSON.stringify(highlights) + ',' + JSON.stringify(names));

            client.emitEvent('leaderBoardUpdate', old_highlights, highlights, old_leaderNames, names);
        }
function(client, packet) {
            var highlights = [];
            var names = [];
            var count = packet.readUInt32LE();

            for(var i=0;i<count;i++) {
                var highlight = packet.readUInt32LE();

                var name = '';
                while(1) {
                    var char = packet.readUInt16LE();
                    if(char == 0) break;
                    name += String.fromCharCode(char);
                }

                highlights.push(highlight);
                names.push(name);
            }

            if(JSON.stringify(client.leaderHighlights) == JSON.stringify(highlights) &&
                JSON.stringify(client.leaderNames) == JSON.stringify(names)) {
                return;
            }
			
            var old_highlights  = client.leaderHighlights; 
            var old_leaderNames = client.leaderNames;
			client.leaderHighlights = highlights;
            client.leaderNames      = names;

            if(client.debug >= 3)
                client.log('leaders update: ' + JSON.stringify(highlights) + ',' + JSON.stringify(names));

            client.emitEvent('leaderBoardUpdate', old_highlights, highlights, old_leaderNames, names);
        }
function ( client , packet ) { var highlights = [ ] ; var names = [ ] ; var count = packet . readUInt32LE ( ) ; for ( var i = 0 ; i < count ; i ++ ) { var highlight = packet . readUInt32LE ( ) ; var name = '' ; while ( 1 ) { var char = packet . readUInt16LE ( ) ; if ( char == 0 ) break ; name += String . fromCharCode ( char ) ; } highlights . push ( highlight ) ; names . push ( name ) ; } if ( JSON . stringify ( client . leaderHighlights ) == JSON . stringify ( highlights ) && JSON . stringify ( client . leaderNames ) == JSON . stringify ( names ) ) { return ; } var old_highlights = client . leaderHighlights ; var old_leaderNames = client . leaderNames ; client . leaderHighlights = highlights ; client . leaderNames = names ; if ( client . debug >= 3 ) client . log ( 'leaders update: ' + JSON . stringify ( highlights ) + ',' + JSON . stringify ( names ) ) ; client . emitEvent ( 'leaderBoardUpdate' , old_highlights , highlights , old_leaderNames , names ) ; }
leaderboard update in FFA mode
leaderboard update in FFA mode