mirror of https://github.com/calzoneman/sync.git
Fix borrow-rank
This commit is contained in:
parent
0b560f15a9
commit
331a4626a0
14
src/user.js
14
src/user.js
|
@ -34,21 +34,25 @@ function User(socket, ip, loginInfo) {
|
||||||
guest: false
|
guest: false
|
||||||
});
|
});
|
||||||
socket.emit("rank", this.account.effectiveRank);
|
socket.emit("rank", this.account.effectiveRank);
|
||||||
|
if (this.account.globalRank >= 255) {
|
||||||
|
this.initAdminCallbacks();
|
||||||
|
}
|
||||||
|
this.emit("login", this.account);
|
||||||
LOGGER.info(ip + " logged in as " + this.getName());
|
LOGGER.info(ip + " logged in as " + this.getName());
|
||||||
} else {
|
} else {
|
||||||
this.account = new Account.Account(this.realip, null, socket.context.aliases);
|
this.account = new Account.Account(this.realip, null, socket.context.aliases);
|
||||||
socket.emit("rank", -1);
|
socket.emit("rank", -1);
|
||||||
this.setFlag(Flags.U_READY);
|
this.setFlag(Flags.U_READY);
|
||||||
|
this.once("login", account => {
|
||||||
|
if (account.globalRank >= 255) {
|
||||||
|
this.initAdminCallbacks();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.once("joinChannel", data => this.handleJoinChannel(data));
|
socket.once("joinChannel", data => this.handleJoinChannel(data));
|
||||||
socket.once("initACP", () => this.handleInitACP());
|
socket.once("initACP", () => this.handleInitACP());
|
||||||
socket.on("login", data => this.handleLogin(data));
|
socket.on("login", data => this.handleLogin(data));
|
||||||
this.once("login", account => {
|
|
||||||
if (account.globalRank >= 255) {
|
|
||||||
this.initAdminCallbacks();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
User.prototype = Object.create(EventEmitter.prototype);
|
User.prototype = Object.create(EventEmitter.prototype);
|
||||||
|
|
Loading…
Reference in New Issue