Compare commits
No commits in common. "d7ba4f911b16c188864a44989818d24b482fda34" and "dd37f3233c83fb9b4328d636f86dc7103154bee1" have entirely different histories.
d7ba4f911b
...
dd37f3233c
2 changed files with 0 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,7 +1,6 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
/dist
|
/dist
|
||||||
coverage
|
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env.local
|
.env.local
|
||||||
|
|
|
@ -38,16 +38,6 @@ export abstract class Client extends EventEmitter {
|
||||||
this.players.push(data.name);
|
this.players.push(data.name);
|
||||||
this.emit("player-joined", data.name);
|
this.emit("player-joined", data.name);
|
||||||
break;
|
break;
|
||||||
case "player-left":
|
|
||||||
let idx = this.players.indexOf(data.name);
|
|
||||||
if (idx < 0) {
|
|
||||||
// Weird
|
|
||||||
console.warn(
|
|
||||||
`Someone (${data.name}) left but wasn't on the player list`
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
this.players.splice(idx, 1);
|
|
||||||
default:
|
default:
|
||||||
// For most cases, we can just use the kind as event type
|
// For most cases, we can just use the kind as event type
|
||||||
this.emit(data.kind, data);
|
this.emit(data.kind, data);
|
||||||
|
|
Loading…
Reference in a new issue