Fix borrow-rank

This commit is contained in:
Calvin Montgomery 2017-08-06 20:42:33 -07:00
parent 0b560f15a9
commit 331a4626a0
1 changed files with 9 additions and 5 deletions

View File

@ -34,16 +34,15 @@ function User(socket, ip, loginInfo) {
guest: false
});
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());
} else {
this.account = new Account.Account(this.realip, null, socket.context.aliases);
socket.emit("rank", -1);
this.setFlag(Flags.U_READY);
}
socket.once("joinChannel", data => this.handleJoinChannel(data));
socket.once("initACP", () => this.handleInitACP());
socket.on("login", data => this.handleLogin(data));
this.once("login", account => {
if (account.globalRank >= 255) {
this.initAdminCallbacks();
@ -51,6 +50,11 @@ function User(socket, ip, loginInfo) {
});
}
socket.once("joinChannel", data => this.handleJoinChannel(data));
socket.once("initACP", () => this.handleInitACP());
socket.on("login", data => this.handleLogin(data));
}
User.prototype = Object.create(EventEmitter.prototype);
User.prototype.handleJoinChannel = function handleJoinChannel(data) {