add timestamps to log
This commit is contained in:
parent
663305bd23
commit
0ea163dfb7
6 changed files with 43 additions and 14 deletions
|
@ -6,7 +6,7 @@ const Connection = require('./connection.js');
|
|||
|
||||
class GameNet {
|
||||
constructor(server) {
|
||||
this.io = socketio(starbugs.webServer.appServer);
|
||||
this.io = socketio(wingbase.webServer.appServer);
|
||||
this.server = server;
|
||||
|
||||
this.connections = new Map();
|
||||
|
|
|
@ -14,7 +14,7 @@ class Room {
|
|||
}
|
||||
|
||||
add(player) {
|
||||
console.log(`${player.name} joined ${this.name}.`);
|
||||
wingbase.log(`${player.name} joined ${this.name}.`);
|
||||
player.room = this;
|
||||
player.connection.room = this.name;
|
||||
this.players.add(player);
|
||||
|
@ -24,7 +24,7 @@ class Room {
|
|||
}
|
||||
|
||||
remove(player) {
|
||||
console.log(`${player.name} left ${this.name}.`);
|
||||
wingbase.log(`${player.name} left ${this.name}.`);
|
||||
this.players.delete(player);
|
||||
this.teamA.delete(player);
|
||||
this.teamB.delete(player);
|
||||
|
@ -32,7 +32,7 @@ class Room {
|
|||
|
||||
if (this.players.size == 0) {
|
||||
this.stop();
|
||||
starbugs.gameServer.deleteRoom(this.name);
|
||||
wingbase.gameServer.deleteRoom(this.name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue