Commit 96c55e12 authored by nanahira's avatar nanahira

fix

parent ed9e336c
Pipeline #43198 passed with stages
in 43 seconds
...@@ -16,22 +16,26 @@ export class ClientVersionCheck { ...@@ -16,22 +16,26 @@ export class ClientVersionCheck {
); );
constructor(private ctx: Context) { constructor(private ctx: Context) {
this.ctx.middleware(YGOProCtosJoinGame, async (msg, client, next) => { this.ctx.middleware(
if (msg.version === YGOPRO_VERSION) { YGOProCtosJoinGame,
return next(); async (msg, client, next) => {
} if (msg.version === this.version) {
if (this.altVersions.includes(msg.version)) { return next();
await client.sendChat('#{version_polyfilled}', ChatColor.BABYBLUE); }
return next(); if (this.altVersions.includes(msg.version)) {
} await client.sendChat('#{version_polyfilled}', ChatColor.BABYBLUE);
await client.sendChat('#{update_required}', ChatColor.RED); return next();
await client.send( }
new YGOProStocErrorMsg().fromPartial({ await client.sendChat('#{update_required}', ChatColor.RED);
msg: 4, await client.send(
code: YGOPRO_VERSION, new YGOProStocErrorMsg().fromPartial({
}), msg: 4,
); code: this.version,
return client.disconnect(); }),
}); );
return client.disconnect();
},
true,
);
} }
} }
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