Cleanup Part 2: Electric Boogaloo (Reloaded) (#594)

* Cleanup Part 2: Electric Boogaloo (Reloaded)

* Moar cleanup

* Tweak NOT_A_PERMISSION error
This commit is contained in:
Schuyler Cebulskie
2016-09-04 05:08:09 -04:00
committed by Amish Shah
parent 5a9c42061f
commit 0b908f5bce
95 changed files with 946 additions and 1526 deletions

View File

@@ -10,7 +10,6 @@ const BeforeReadyWhitelist = [
];
class WebSocketPacketManager {
constructor(websocketManager) {
this.ws = websocketManager;
this.handlers = {};
@@ -62,9 +61,7 @@ class WebSocketPacketManager {
}
setSequence(s) {
if (s && s > this.ws.sequence) {
this.ws.sequence = s;
}
if (s && s > this.ws.sequence) this.ws.sequence = s;
}
handle(packet) {
@@ -93,13 +90,9 @@ class WebSocketPacketManager {
}
}
if (this.handlers[packet.t]) {
return this.handlers[packet.t].handle(packet);
}
if (this.handlers[packet.t]) return this.handlers[packet.t].handle(packet);
return false;
}
}
module.exports = WebSocketPacketManager;