add some debug info

This commit is contained in:
Holly Stubbs 2024-04-26 11:20:04 +01:00
parent b0a0f12479
commit 0c34cd0fab
Signed by: tgpholly
GPG Key ID: B8583C4B7D18119E
1 changed files with 5 additions and 1 deletions

View File

@ -416,12 +416,16 @@ websocketServer.on("connection", (socket) => {
if (reader.length > 0 && reader.length < 50) {
switch (reader.readUByte()) {
case MessageType.ClientDetails:
{
if (user !== undefined) {
Console.printInfo("Tried to ClientDetails when already connected and ready!");
return;
}
const apiKey = reader.readShortString();
const rawURL = reader.readString();
const dbUser = await UserService.GetUserByAPIKey(apiKey);
if (dbUser == null) {
Console.printInfo("User for apiKey " + apiKey + " was null!");
return;
}
const dbUserParty = await UserService.GetActiveParty(dbUser.Id);
@ -430,7 +434,6 @@ websocketServer.on("connection", (socket) => {
dbParty = await UserService.GetParty(dbUserParty.PartyId);
}
const rawURL = reader.readString();
let page = rawURL.toLowerCase().replace(".htm", "").replace(".html", "");
if (page === "index") {
page = "";
@ -456,6 +459,7 @@ websocketServer.on("connection", (socket) => {
user.send(usersToSend.toBuffer());
sendGroupUpdate(user);
break;
}
case MessageType.CursorPos:
{
if (user === undefined) {