Log IP addresses of connecting players
This commit is contained in:
parent
20177fe547
commit
8f2c968403
2 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@ class Connection {
|
||||||
this.connections = net.connections;
|
this.connections = net.connections;
|
||||||
this.io = net.io;
|
this.io = net.io;
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
|
this.ip = socket.request.connection.remoteAddress;
|
||||||
|
|
||||||
this.player = new Player(this);
|
this.player = new Player(this);
|
||||||
this._room = false;
|
this._room = false;
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Room {
|
||||||
this.setTeam(player, this.teamA.size > this.teamB.size ? 'b' : 'a');
|
this.setTeam(player, this.teamA.size > this.teamB.size ? 'b' : 'a');
|
||||||
this.world.addPlayer(player);
|
this.world.addPlayer(player);
|
||||||
this.sendWorld(player);
|
this.sendWorld(player);
|
||||||
wingbase.log(`${player.name} joined ${this.name}.`);
|
wingbase.log(`[${player.connection.ip}] ${player.name} joined ${this.name}.`);
|
||||||
this.message('roomEnter', player.name, 'team' + player.team);
|
this.message('roomEnter', player.name, 'team' + player.team);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue