Added 'invalid message' error.

This commit is contained in:
Jurn Wubben 2025-11-10 10:34:46 +01:00
parent 6abfad391e
commit dbe3cb97b2
5 changed files with 1988 additions and 1829 deletions

View file

@ -49,7 +49,7 @@ export class Authentication {
message.d == undefined || !("id" in message.d) ||
typeof (message.d.id) !== "string" || !(message.d.id in Device.devices)
) {
this._socket.send(buildError(1, "Invalid packet. Missing ID"));
this._socket.send(buildError(2, "Invalid packet. Missing ID"));
this._socket.close();
return;
}
@ -73,7 +73,7 @@ export class Authentication {
) return;
if (this.signature !== parsed.d.signature) {
this._socket.send(buildError(2, "Invalid signature."));
this._socket.send(buildError(3, "Invalid signature."));
this._socket.close;
return;
}