From cf04b444547b75c87c8b33c2d641ca0922016165 Mon Sep 17 00:00:00 2001 From: Schuyler Cebulskie Date: Thu, 27 Oct 2016 21:38:48 -0400 Subject: [PATCH] Clean up some more --- src/client/voice/VoiceConnection.js | 1 - src/client/voice/VoiceUDPClient.js | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/client/voice/VoiceConnection.js b/src/client/voice/VoiceConnection.js index cac004f80..03e0a3f75 100644 --- a/src/client/voice/VoiceConnection.js +++ b/src/client/voice/VoiceConnection.js @@ -17,7 +17,6 @@ const fs = require('fs'); * @extends {EventEmitter} */ class VoiceConnection extends EventEmitter { - constructor(pendingConnection) { super(); diff --git a/src/client/voice/VoiceUDPClient.js b/src/client/voice/VoiceUDPClient.js index 8246478c3..b7b0c0cfe 100644 --- a/src/client/voice/VoiceUDPClient.js +++ b/src/client/voice/VoiceUDPClient.js @@ -3,18 +3,6 @@ const dns = require('dns'); const Constants = require('../../util/Constants'); const EventEmitter = require('events').EventEmitter; -function parseLocalPacket(message) { - try { - const packet = new Buffer(message); - let address = ''; - for (let i = 4; i < packet.indexOf(0, i); i++) address += String.fromCharCode(packet[i]); - const port = parseInt(packet.readUIntLE(packet.length - 2, 2).toString(10), 10); - return { address, port }; - } catch (error) { - return { error }; - } -} - /** * Represents a UDP Client for a Voice Connection * @extends {EventEmitter} @@ -142,4 +130,16 @@ class VoiceConnectionUDPClient extends EventEmitter { } } +function parseLocalPacket(message) { + try { + const packet = new Buffer(message); + let address = ''; + for (let i = 4; i < packet.indexOf(0, i); i++) address += String.fromCharCode(packet[i]); + const port = parseInt(packet.readUIntLE(packet.length - 2, 2).toString(10), 10); + return { address, port }; + } catch (error) { + return { error }; + } +} + module.exports = VoiceConnectionUDPClient;