fix username duplication bug

This commit is contained in:
Elijah R 2024-07-17 13:16:37 -04:00
parent 6893c62c08
commit b815ab506d

View file

@ -114,7 +114,7 @@ export class Client extends EventEmitter {
switch (msg.op) {
case MSAgentProtocolMessageType.Join: {
let joinMsg = msg as MSAgentJoinMessage;
if (!joinMsg.data || !joinMsg.data.username || !joinMsg.data.username) {
if (this.username !== null || !joinMsg.data || !joinMsg.data.username || !joinMsg.data.username) {
this.socket.close();
return;
}