Commit 1d74fcc8 authored by nanahira's avatar nanahira

fix

parent 075ccc3c
Pipeline #43474 passed with stages
in 2 minutes and 51 seconds
...@@ -55,8 +55,11 @@ export class ClientHandler { ...@@ -55,8 +55,11 @@ export class ClientHandler {
return next(); return next();
}) })
.middleware(YGOProCtosPlayerInfo, async (msg, client, next) => { .middleware(YGOProCtosPlayerInfo, async (msg, client, next) => {
if (!client.ip) { if (
await this.ctx.get(() => IpResolver).setClientIp(client); !client.ip &&
(await this.ctx.get(() => IpResolver).setClientIp(client))
) {
return;
} }
const [name, vpass] = msg.name.split('$'); const [name, vpass] = msg.name.split('$');
client.name = name; client.name = name;
...@@ -153,6 +156,10 @@ export class ClientHandler { ...@@ -153,6 +156,10 @@ export class ClientHandler {
} }
private async dispatchClientMessage(client: Client, msg: YGOProCtosBase) { private async dispatchClientMessage(client: Client, msg: YGOProCtosBase) {
if (client.disconnected) {
// disallow processing any messages after disconnection, including those already in the queue
return;
}
this.logger.debug( this.logger.debug(
{ {
msgName: msg.constructor.name, msgName: msg.constructor.name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment