Add client ping stuff

This commit is contained in:
Schuyler Cebulskie
2016-12-02 20:58:19 -05:00
parent 2488e1a00f
commit 58c7c2e7b8
3 changed files with 26 additions and 1 deletions

View File

@@ -50,6 +50,7 @@ class ClientManager {
setupKeepAlive(time) {
this.heartbeatInterval = this.client.setInterval(() => {
this.client.emit('debug', 'Sending heartbeat');
this.client._pingTimestamp = Date.now();
this.client.ws.send({
op: Constants.OPCodes.HEARTBEAT,
d: this.client.ws.sequence,