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 {
);
constructor(private ctx: Context) {
this.ctx.middleware(YGOProCtosJoinGame, async (msg, client, next) => {
if (msg.version === YGOPRO_VERSION) {
return next();
}
if (this.altVersions.includes(msg.version)) {
await client.sendChat('#{version_polyfilled}', ChatColor.BABYBLUE);
return next();
}
await client.sendChat('#{update_required}', ChatColor.RED);
await client.send(
new YGOProStocErrorMsg().fromPartial({
msg: 4,
code: YGOPRO_VERSION,
}),
);
return client.disconnect();
});
this.ctx.middleware(
YGOProCtosJoinGame,
async (msg, client, next) => {
if (msg.version === this.version) {
return next();
}
if (this.altVersions.includes(msg.version)) {
await client.sendChat('#{version_polyfilled}', ChatColor.BABYBLUE);
return next();
}
await client.sendChat('#{update_required}', ChatColor.RED);
await client.send(
new YGOProStocErrorMsg().fromPartial({
msg: 4,
code: this.version,
}),
);
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