diff --git a/assets/popout.html b/assets/popout.html
new file mode 100644
index 000000000..4c012869f
--- /dev/null
+++ b/assets/popout.html
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+ Discord Popout
+
+
+
+
+
+
+
+
+
diff --git a/assets/schemas.json b/assets/schemas.json
index 05650a4ef..d4b4aaaa2 100644
Binary files a/assets/schemas.json and b/assets/schemas.json differ
diff --git a/fosscord-server.code-workspace b/fosscord-server.code-workspace
index 56450f858..8b7268a5d 100644
--- a/fosscord-server.code-workspace
+++ b/fosscord-server.code-workspace
@@ -16,6 +16,8 @@
"settings": {
"files.exclude": {
"*.ansi": true,
+ "**/cache": true,
+ "**/cache_src": true
}
},
"launch": {
@@ -28,10 +30,16 @@
"type": "node-terminal"
},
{
- "command": "kitty npm run start:bundle:vscode-dbg",
+ "command": "[ \"$(basename $PWD)\" != \"fosscord-server\" ] && cd ..; node scripts/build_new.js && kitty node --enable-source-maps --inspect dist/start.js",
"name": "Run Fosscord with debugger (kitty)",
"request": "launch",
"type": "node-terminal"
+ },
+ {
+ "command": "[ \"$(basename $PWD)\" != \"fosscord-server\" ] && cd ..; $(ps -o comm= $PPID) assets/cache",
+ "name": "Open testclient patch workspace",
+ "request": "launch",
+ "type": "node-terminal"
}
]
}
diff --git a/src/api/middlewares/TestClient.ts b/src/api/middlewares/TestClient.ts
index 3afd03398..480d7f0b5 100644
--- a/src/api/middlewares/TestClient.ts
+++ b/src/api/middlewares/TestClient.ts
@@ -82,6 +82,15 @@ export default function TestClient(app: Application) {
res.send(fs.readFileSync(path.join(__dirname, "..", "..", "..", "assets", "developers.html"), { encoding: "utf8" }));
});
+ app.get("/popout", (_req: Request, res: Response) => {
+ const { useTestClient } = Config.get().client;
+ res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24);
+ res.set("content-type", "text/html");
+
+ if (!useTestClient) return res.send("Test client is disabled on this instance. Use a stand-alone client to connect this instance.");
+
+ res.send(fs.readFileSync(path.join(__dirname, "..", "..", "..", "assets", "popout.html"), { encoding: "utf8" }));
+ });
app.get("*", (req: Request, res: Response) => {
const { useTestClient } = Config.get().client;
res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24);
diff --git a/src/gateway/events/Message.ts b/src/gateway/events/Message.ts
index e5ee58283..d58db1c37 100644
--- a/src/gateway/events/Message.ts
+++ b/src/gateway/events/Message.ts
@@ -43,6 +43,7 @@ export async function Message(this: WebSocket, buffer: Buffer) {
const OPCodeHandler = OPCodeHandlers[data.op];
if (!OPCodeHandler) {
console.error("[Gateway] Unkown opcode " + data.op);
+ if(process.env.WS_VERBOSE_UNKNOWN) console.log(data);
// TODO: if all opcodes are implemented comment this out:
// this.close(CloseCodes.Unknown_opcode);
return;
diff --git a/src/gateway/opcodes/VoiceServerPing.ts b/src/gateway/opcodes/VoiceServerPing.ts
new file mode 100644
index 000000000..f684cb33c
--- /dev/null
+++ b/src/gateway/opcodes/VoiceServerPing.ts
@@ -0,0 +1,9 @@
+import { Payload, WebSocket } from "@fosscord/gateway";
+import { Send } from "../util/Send";
+
+export async function onVoiceServerPing(this: WebSocket, data: Payload) {
+ console.log("Got voice server ping: ", data, "Doing a noop!");
+
+
+ // return this.close(CloseCodes.Invalid_session);
+}
diff --git a/src/gateway/opcodes/index.ts b/src/gateway/opcodes/index.ts
index d5dc7de14..818d15971 100644
--- a/src/gateway/opcodes/index.ts
+++ b/src/gateway/opcodes/index.ts
@@ -6,6 +6,7 @@ import { onPresenceUpdate } from "./PresenceUpdate";
import { onRequestGuildMembers } from "./RequestGuildMembers";
import { onResume } from "./Resume";
import { onVoiceStateUpdate } from "./VoiceStateUpdate";
+import { onVoiceServerPing } from "./VoiceServerPing";
export type OPCodeHandler = (this: WebSocket, data: Payload) => any;
@@ -14,12 +15,14 @@ export default {
2: onIdentify,
3: onPresenceUpdate,
4: onVoiceStateUpdate,
- // 5: Voice Server Ping
+ 5: onVoiceServerPing, //Voice Server Ping
6: onResume,
// 7: Reconnect: You should attempt to reconnect and resume immediately.
8: onRequestGuildMembers,
// 9: Invalid Session
// 10: Hello
+ // 11: Heartbeat ACK
+
// 13: Dm_update
14: onLazyRequest
};