<commit_before>var Game = require("./Game.js").Game,
    winston = require("winston"),
    counter = 0;

var ConnectionHost = function(io){

    var self = this;

    var players = {}; //the current players

    io.on("connection", function(socket){

        //Make a socket.
        var socket = socket;

        //Create a new socket
        socket.emit("log", "Connection established! ");

        socket.once("lobby_begin", function(name){
            //we have a name.
            var name = name;

            if(!name){
                name = " Player #"+(counter++);
            }

            socket.on("lobby_list", function(){
                var lobbies = [];

                for(var lobby in players){
                    if(players.hasOwnProperty(lobby)){
                        lobbies.push([lobby, players[lobby].game_type]);
                    }
                }

                socket.emit("lobby_list", lobbies);
            })

            socket.on("lobby_new", function(game_type){
                //we want to create a new one, so no longer accept connections.<commit_msg>Yes @kpj, I fixed it.<commit_after>var Game = require("./Game.js").Game,
    winston = require("winston"),
    counter = 0;

var ConnectionHost = function(io){

    var self = this;

    var players = {}; //the current players

    io.on("connection", function(socket){

        //Make a socket.
        var socket = socket;

        //Create a new socket
        socket.emit("log", "Connection established! ");

        socket.once("lobby_begin", function(name){
            //we have a name.
            var name = name;

            if(!name){
                name = "Player #"+(counter++);
            }

            socket.on("lobby_list", function(){
                var lobbies = [];

                for(var lobby in players){
                    if(players.hasOwnProperty(lobby)){
                        lobbies.push([lobby, players[lobby].game_type]);
                    }
                }

                socket.emit("lobby_list", lobbies);
            })

            socket.on("lobby_new", function(game_type){
                //we want to create a new one, so no longer accept connections.
{'fraction_non_alphanumeric': 0.12822836429542364, 'fraction_numerical': 0.0009062075215224287, 'mean_word_length': 1.5408515535097813, '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': '7447848', 'n_tokens_mistral': 614, 'n_tokens_neox': 564, 'n_words': 149}