<commit_before>var applicationStorage = process.require("core/applicationStorage.js");
var config = process.require("config/config.json");
var lodash = require("lodash");


module.exports.connect = function () {
    var logger = applicationStorage.logger;
    applicationStorage.socketIo.on('connection', function (socket) {
        if (socket.request.user.logged_in == true) {
            logger.info("%s User %s connected", socket.conn.remoteAddress || socket.handshake.headers['x-forwarded-for'], socket.request.user.battleTag);
            if (applicationStorage.users[socket.request.user.id]) {
                applicationStorage.users[socket.request.user.id].push(socket.id);
            } else {
                applicationStorage.users[socket.request.user.id] = [socket.id];
            }
        } else {
            logger.info("%s User anonymous connected", socket.conn.remoteAddress || socket.handshake.headers['x-forwarded-for']);
        }
        socket.on('disconnect', function () {
            if (socket.request.user.logged_in == true) {
                logger.info("%s User %s disconnected",  socket.conn.remoteAddress || socket.handshake.headers['x-forwarded-for'],socket.request.user.battleTag);
                lodash.remove(applicationStorage.users[socket.request.user.id], function (socketId) {
                    return socketId == socket.id
                });
            } else {
                logger.info("%s User anonymous disconnected", socket.conn.remoteAddress || socket.handshake.headers['x-forwarded-for']);
            }
        });


    });

};<commit_msg>Socket IP log correct IP.<commit_after>var applicationStorage = process.require("core/applicationStorage.js");
var config = process.require("config/config.json");
var lodash = require("lodash");


module.exports.connect = function () {
    var logger = applicationStorage.logger;
    applicationStorage.socketIo.on('connection', function (socket) {
        if (socket.request.user.logged_in == true) {
            logger.info("%s User %s connected", socket.handshake.headers['x-forwarded-for'] || socket.request.connection.remoteAddress, socket.request.user.battleTag);
            if (applicationStorage.users[socket.request.user.id]) {
                applicationStorage.users[socket.request.user.id].push(socket.id);
            } else {
                applicationStorage.users[socket.request.user.id] = [socket.id];
            }
        } else {
            logger.info("%s User anonymous connected", socket.handshake.headers['x-forwarded-for'] || socket.request.connection.remoteAddress);
        }
        socket.on('disconnect', function () {
            if (socket.request.user.logged_in == true) {
                logger.info("%s User %s disconnected",  socket.handshake.headers['x-forwarded-for'] || socket.request.connection.remoteAddress,socket.request.user.battleTag);
                lodash.remove(applicationStorage.users[socket.request.user.id], function (socketId) {
                    return socketId == socket.id
                });
            } else {
                logger.info("%s User anonymous disconnected",socket.handshake.headers['x-forwarded-for'] || socket.request.connection.remoteAddress);
            }
        });


    });

};
{'fraction_non_alphanumeric': 0.1394422310756972, 'fraction_numerical': 0.0, 'mean_word_length': 2.6632996632996635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5300293', 'n_tokens_mistral': 873, 'n_tokens_neox': 846, 'n_words': 131}