Fix travis builds

This commit is contained in:
Amish Shah
2016-10-25 14:38:56 +01:00
parent 91ba59c43d
commit 5844bbb54c
6 changed files with 9 additions and 5 deletions

View File

@@ -40,6 +40,7 @@ class DocumentedMember extends DocumentedItem {
serialize() {
super.serialize();
console.log('serializing', this);
const { id, name, description, memberof, type, access, meta, properties } = this.directData;
return {
id,

View File

@@ -1,6 +1,5 @@
const VoiceWebSocket = require('./VoiceWebSocket');
const VoiceUDP = require('./VoiceUDPClient');
const VoiceReceiver = require('./receiver/VoiceReceiver');
const Constants = require('../../util/Constants');
const AudioPlayer = require('./player/AudioPlayer');
const EventEmitter = require('events').EventEmitter;
@@ -40,6 +39,10 @@ class VoiceConnection extends EventEmitter {
this.player = new AudioPlayer(this);
this.player.on('debug', m => {
this.emit('debug', `audio player - ${m}`);
});
this.player.on('error', e => {
this.emit('warn', e);
this.player.cleanup();

View File

@@ -63,6 +63,7 @@ class VoiceConnectionUDPClient extends EventEmitter {
}
/**
* The port of the discord voice server
* @type {number}
* @readonly
*/
get discordPort() {

View File

@@ -97,7 +97,7 @@ class VoiceWebSocket extends EventEmitter {
}
});
} else {
reject(new Error('websocket not open for ' + data));
reject(new Error(`voice websocket not open to send ${data}`));
}
});
}
@@ -148,9 +148,8 @@ class VoiceWebSocket extends EventEmitter {
/**
* Called whenever the connection to the WebSocket Server is lost
* @param {CloseEvent} event the close event
*/
onClose(event) {
onClose() {
// #todo see if the connection is open before reconnecting
if (!this.dead) this.client.setTimeout(this.connect.bind(this), this.attempts * 1000);
}

View File

@@ -255,7 +255,6 @@ class StreamDispatcher extends EventEmitter {
_triggerTerminalState(state, err) {
if (this._triggered) return;
console.log(state, err);
/**
* Emitted when the stream wants to give debug information.
* @event StreamDispatcher#debug

View File

@@ -59,6 +59,7 @@ class AudioPlayer extends EventEmitter {
dispatcher.on('end', () => this.cleanup(dispatcher.stream, 'disp ended'));
dispatcher.on('speaking', value => this.voiceConnection.setSpeaking(value));
this.currentDispatcher = dispatcher;
dispatcher.on('debug', m => this.emit('debug', `stream dispatch - ${m}`));
return dispatcher;
}