Merge branch 'master' into voice-rewrite

This commit is contained in:
Amish Shah
2018-01-20 13:50:34 +00:00
10 changed files with 7 additions and 12 deletions

View File

@@ -269,13 +269,15 @@ class WebSocketConnection extends EventEmitter {
this.inflate.push(data, flush && zlib.Z_SYNC_FLUSH);
if (!flush) return;
let packet;
try {
const packet = WebSocket.unpack(this.inflate.result);
this.onPacket(packet);
if (this.client.listenerCount('raw')) this.client.emit('raw', packet);
packet = WebSocket.unpack(this.inflate.result);
} catch (err) {
this.client.emit('debug', err);
return;
}
this.onPacket(packet);
if (this.client.listenerCount('raw')) this.client.emit('raw', packet);
}
/**