<commit_before>var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var players = {};
var colors = ['red', 'green', 'blue', 'black', 'orange'];

var UPDATE_INTERVAL = 50;
var SPEED = 10;
var RIGHT_BORDER = 800;
var BOTTOM_BORDER = 600;

app.get('/', function (req, res) {
  res.sendfile('index.html');
});

app.get('/app.js', function (req, res) {
  res.sendfile('app.js');
});

io.on('connection', function (socket) {
  var playerColor = colors.pop();
  players[playerColor] = {
    x: 0,
    y: 0,
    color: playerColor,
    direction: 'none'
  };
  socket.color = playerColor;
  socket.emit('initialize', players);
  socket.on('playerMove', function (dirrection) {
    updatePosition(socket, dirrection);
  });
  socket.on('disconnect', function () {
    removePlayer(socket);
  });<commit_msg>add server ip logging<commit_after>var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var players = {};
var colors = ['red', 'green', 'blue', 'black', 'orange'];

var UPDATE_INTERVAL = 50;
var SPEED = 10;
var RIGHT_BORDER = 800;
var BOTTOM_BORDER = 600;

app.get('/', function (req, res) {
  res.sendfile('index.html');
});

app.get('/app.js', function (req, res) {
  res.sendfile('app.js');
});

io.on('connection', function (socket) {
  console.log('connected from: ' + socket.request.connection.remoteAddress);

  var playerColor = colors.pop();
  players[playerColor] = {
    x: 0,
    y: 0,
    color: playerColor,
    direction: 'none'
  };
  socket.color = playerColor;
  socket.emit('initialize', players);
  socket.on('playerMove', function (dirrection) {
    updatePosition(socket, dirrection);
  });
  socket.on('disconnect', function () {
    console.log('disconnected from: ' + socket.request.connection.remoteAddress);
    removePlayer(socket);
  });
{'fraction_non_alphanumeric': 0.18976545842217485, 'fraction_numerical': 0.01279317697228145, 'mean_word_length': 4.440579710144927, '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': '6007475', 'n_tokens_mistral': 656, 'n_tokens_neox': 624, 'n_words': 143}