summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--webrtc/package-lock.json30
-rw-r--r--webrtc/package.json6
-rw-r--r--webrtc/src/opcodes/Identify.ts2
-rw-r--r--webrtc/src/opcodes/SelectProtocol.ts2
-rw-r--r--webrtc/src/opcodes/index.ts9
5 files changed, 26 insertions, 23 deletions
diff --git a/webrtc/package-lock.json b/webrtc/package-lock.json
index e6b10d69..05a69e86 100644
--- a/webrtc/package-lock.json
+++ b/webrtc/package-lock.json
@@ -7,7 +7,7 @@
 		"": {
 			"name": "rtc",
 			"version": "1.0.0",
-			"license": "ISC",
+			"license": "AGPL-3.0-only",
 			"dependencies": {
 				"@types/libsodium-wrappers": "^0.7.9",
 				"dotenv": "^12.0.4",
@@ -17,12 +17,12 @@
 				"node-turn": "^0.0.6",
 				"sdp-transform": "^2.14.1",
 				"tsconfig-paths": "^3.12.0",
-				"ws": "^7.4.6"
+				"ws": "^7.5.8"
 			},
 			"devDependencies": {
 				"@types/node": "^15.6.1",
 				"@types/sdp-transform": "^2.4.5",
-				"@types/ws": "^7.4.4",
+				"@types/ws": "^7.4.7",
 				"ts-node": "^10.4.0",
 				"typescript": "^4.3.2"
 			}
@@ -95,9 +95,9 @@
 			"dev": true
 		},
 		"node_modules/@types/ws": {
-			"version": "7.4.4",
-			"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.4.tgz",
-			"integrity": "sha512-d/7W23JAXPodQNbOZNXvl2K+bqAQrCMwlh/nuQsPSQk6Fq0opHoPrUw43aHsvSbIiQPr8Of2hkFbnz1XBFVyZQ==",
+			"version": "7.4.7",
+			"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
+			"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
 			"dev": true,
 			"dependencies": {
 				"@types/node": "*"
@@ -556,9 +556,9 @@
 			}
 		},
 		"node_modules/ws": {
-			"version": "7.4.6",
-			"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
-			"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
+			"version": "7.5.8",
+			"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz",
+			"integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==",
 			"engines": {
 				"node": ">=8.3.0"
 			},
@@ -648,9 +648,9 @@
 			"dev": true
 		},
 		"@types/ws": {
-			"version": "7.4.4",
-			"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.4.tgz",
-			"integrity": "sha512-d/7W23JAXPodQNbOZNXvl2K+bqAQrCMwlh/nuQsPSQk6Fq0opHoPrUw43aHsvSbIiQPr8Of2hkFbnz1XBFVyZQ==",
+			"version": "7.4.7",
+			"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
+			"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
 			"dev": true,
 			"requires": {
 				"@types/node": "*"
@@ -963,9 +963,9 @@
 			"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
 		},
 		"ws": {
-			"version": "7.4.6",
-			"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
-			"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
+			"version": "7.5.8",
+			"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.8.tgz",
+			"integrity": "sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw==",
 			"requires": {}
 		},
 		"yn": {
diff --git a/webrtc/package.json b/webrtc/package.json
index a8fc054d..21b0ddb4 100644
--- a/webrtc/package.json
+++ b/webrtc/package.json
@@ -14,7 +14,7 @@
 	"devDependencies": {
 		"@types/node": "^15.6.1",
 		"@types/sdp-transform": "^2.4.5",
-		"@types/ws": "^7.4.4",
+		"@types/ws": "^7.4.7",
 		"ts-node": "^10.4.0",
 		"typescript": "^4.3.2"
 	},
@@ -23,10 +23,10 @@
 		"dotenv": "^12.0.4",
 		"libsodium": "^0.7.10",
 		"libsodium-wrappers": "^0.7.10",
-		"mediasoup": "^3.9.5",
+		"mediasoup": "^3.9.5-1",
 		"node-turn": "^0.0.6",
 		"sdp-transform": "^2.14.1",
 		"tsconfig-paths": "^3.12.0",
-		"ws": "^7.4.6"
+		"ws": "^7.5.8"
 	}
 }
diff --git a/webrtc/src/opcodes/Identify.ts b/webrtc/src/opcodes/Identify.ts
index ef0386a7..210b5041 100644
--- a/webrtc/src/opcodes/Identify.ts
+++ b/webrtc/src/opcodes/Identify.ts
@@ -18,7 +18,7 @@ export interface IdentifyPayload extends Payload {
 	};
 }
 
-export async function onIdentify(this: Server, socket: WebSocket, data: IdentifyPayload) {
+export async function onIdentify(this: Server, socket: WebSocket, data: Payload) {
 
 	const session = await Session.findOneOrFail(
 		{ session_id: data.d.session_id, },
diff --git a/webrtc/src/opcodes/SelectProtocol.ts b/webrtc/src/opcodes/SelectProtocol.ts
index 72fb9c79..71772454 100644
--- a/webrtc/src/opcodes/SelectProtocol.ts
+++ b/webrtc/src/opcodes/SelectProtocol.ts
@@ -88,7 +88,7 @@ export interface SelectProtocolPayload extends Payload {
 }
 */
 
-export async function onSelectProtocol(this: Server, socket: WebSocket, data: SelectProtocolPayload) {
+export async function onSelectProtocol(this: Server, socket: WebSocket, data: Payload) {
 	if (data.d.sdp) {
 		const rtpCapabilities = this.mediasoupRouters[0].rtpCapabilities;
 		const codecs = rtpCapabilities.codecs as RtpCodecCapability[];
diff --git a/webrtc/src/opcodes/index.ts b/webrtc/src/opcodes/index.ts
index d0f40bc2..4d4dbc30 100644
--- a/webrtc/src/opcodes/index.ts
+++ b/webrtc/src/opcodes/index.ts
@@ -1,5 +1,6 @@
 import { WebSocket } from "@fosscord/gateway";
 import { VoiceOPCodes } from "@fosscord/util";
+import { Server } from "../Server";
 
 export interface Payload {
 	op: number;
@@ -17,9 +18,9 @@ import { onConnect } from "./Connect";
 
 import { onVersion } from "./Version";
 
-export type OPCodeHandler = (this: WebSocket, data: Payload) => any;
+export type OPCodeHandler = (this: Server, socket: WebSocket, data: Payload) => any;
 
-export default {
+const handlers: { [key: number]: OPCodeHandler } = {
 	[VoiceOPCodes.IDENTIFY]: onIdentify,				//op 0
 	[VoiceOPCodes.SELECT_PROTOCOL]: onSelectProtocol,	//op 1
 	//op 2 voice_ready
@@ -37,4 +38,6 @@ export default {
 	//op 15?
 	//op 16? empty data on client send but server sends {"voice":"0.8.24+bugfix.voice.streams.opt.branch-ffcefaff7","rtc_worker":"0.3.14-crypto-collision-copy"}
 	[VoiceOPCodes.VERSION]: onVersion,
-};
\ No newline at end of file
+};
+
+export default handlers;
\ No newline at end of file