Commit f6fd96fa authored by nanahira's avatar nanahira

fix

parent 1d74fcc8
Pipeline #43475 passed with stages
in 3 minutes and 34 seconds
......@@ -41,17 +41,21 @@ export class ClientHandler {
async init() {
this.ctx
.middleware(YGOProCtosExternalAddress, async (msg, client, next) => {
client.hostname = msg.hostname?.split(':')[0] || '';
if (client.ip) {
// ws/reverse-ws should already have IP from connection metadata, skip overwrite
return next();
}
if (
await this.ctx
.get(() => IpResolver)
.setClientIp(
client,
msg.real_ip === '0.0.0.0' ? undefined : msg.real_ip,
);
client.hostname = msg.hostname?.split(':')[0] || '';
)
) {
return;
}
return next();
})
.middleware(YGOProCtosPlayerInfo, async (msg, client, next) => {
......
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