voice: remove createReceiver, just use VoiceConnection.receiver

This commit is contained in:
Amish Shah
2018-08-16 18:30:54 +01:00
parent 97c34b5b6f
commit e2726f5a9a
3 changed files with 13 additions and 28 deletions

View File

@@ -180,12 +180,10 @@ class VoiceWebSocket extends EventEmitter {
this.connection.ssrcMap.set(+packet.d.audio_ssrc, packet.d.user_id);
break;
case VoiceOPCodes.CLIENT_DISCONNECT:
for (const receiver of this.connection.receivers) {
const streamInfo = receiver.packets.streams.get(packet.d.user_id);
if (streamInfo) {
receiver.packets.streams.delete(packet.d.user_id);
streamInfo.stream.push(null);
}
const streamInfo = this.connection.receiver.packets.streams.get(packet.d.user_id);
if (streamInfo) {
this.connection.receiver.packets.streams.delete(packet.d.user_id);
streamInfo.stream.push(null);
}
break;
case VoiceOPCodes.SPEAKING: