|
|
|
@ -8,7 +8,7 @@ class TrovoPubSubSocket extends EventEmitter {
|
|
|
|
|
constructor(channelID, settings) {
|
|
|
|
|
super();
|
|
|
|
|
|
|
|
|
|
this.channelID = channelID;
|
|
|
|
|
this.channelID = channelID;
|
|
|
|
|
|
|
|
|
|
settings = settings || {};
|
|
|
|
|
|
|
|
|
@ -16,9 +16,9 @@ class TrovoPubSubSocket extends EventEmitter {
|
|
|
|
|
this.verbose = settings.verbose || false;
|
|
|
|
|
this.reconnectDelay = settings.reconnectDelay || 2000;
|
|
|
|
|
this.state = 'none';
|
|
|
|
|
this.trovoApollo = new TrovoApollo();
|
|
|
|
|
this.nonces = {};
|
|
|
|
|
this.pingTimeout = 45000;
|
|
|
|
|
this.trovoApollo = new TrovoApollo();
|
|
|
|
|
this.nonces = {};
|
|
|
|
|
this.pingTimeout = 45000;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async connect() {
|
|
|
|
@ -36,7 +36,7 @@ class TrovoPubSubSocket extends EventEmitter {
|
|
|
|
|
this.trovoApollo.GetPubSubToken({}).then((token) => {
|
|
|
|
|
this.send('AUTH', { token: token.getPubSubToken.token }).then((response) => {
|
|
|
|
|
this.emit('open');
|
|
|
|
|
this.send('LISTEN', {"topics":["emote-event-notify"]}).then((response) => { console.log('listen emote event notify', response); });
|
|
|
|
|
this.send('LISTEN', {"topics":["emote-event-notify"]});
|
|
|
|
|
this.send('LISTEN', {"topics":["channel-event-by-id."+this.channelID]});
|
|
|
|
|
this.send('LISTEN', {"topics":["channel-change-notify-by-id."+this.channelID]});
|
|
|
|
|
this.sendPing();
|
|
|
|
|