Log aliases when someone logs in

This commit is contained in:
Calvin Montgomery 2015-01-26 12:20:19 -06:00
parent 5a95bacee4
commit bbd03e4e0f
2 changed files with 6 additions and 10 deletions

View File

@ -375,10 +375,6 @@ Channel.prototype.acceptUser = function (user) {
this.logger.log("[login] Accepted connection from " + user.displayip); this.logger.log("[login] Accepted connection from " + user.displayip);
} }
if (user.is(Flags.U_LOGGED_IN)) {
this.logger.log("[login] " + user.displayip + " authenticated as " + user.getName());
}
var self = this; var self = this;
user.waitFlag(Flags.U_LOGGED_IN, function () { user.waitFlag(Flags.U_LOGGED_IN, function () {
for (var i = 0; i < self.users.length; i++) { for (var i = 0; i < self.users.length; i++) {
@ -387,6 +383,12 @@ Channel.prototype.acceptUser = function (user) {
self.users[i].kick("Duplicate login"); self.users[i].kick("Duplicate login");
} }
} }
var loginStr = "[login] " + user.displayip + " logged in as " + user.getName();
if (user.account.globalRank === 0) loginStr += " (guest)";
loginStr += " (aliases: " + user.account.aliases.join(",") + ")";
self.logger.log(loginStr);
self.sendUserJoin(self.users, user); self.sendUserJoin(self.users, user);
}); });

View File

@ -288,9 +288,6 @@ User.prototype.login = function (name, pw) {
db.recordVisit(self.realip, self.getName()); db.recordVisit(self.realip, self.getName());
self.socket.emit("rank", self.account.effectiveRank); self.socket.emit("rank", self.account.effectiveRank);
Logger.syslog.log(self.realip + " logged in as " + user.name); Logger.syslog.log(self.realip + " logged in as " + user.name);
if (self.inChannel()) {
self.channel.logger.log(self.displayip + " logged in as " + user.name);
}
self.setFlag(Flags.U_LOGGED_IN); self.setFlag(Flags.U_LOGGED_IN);
self.clearFlag(Flags.U_LOGGING_IN); self.clearFlag(Flags.U_LOGGING_IN);
self.emit("login", self.account); self.emit("login", self.account);
@ -378,9 +375,6 @@ User.prototype.guestLogin = function (name) {
db.recordVisit(self.realip, self.getName()); db.recordVisit(self.realip, self.getName());
self.socket.emit("rank", 0); self.socket.emit("rank", 0);
Logger.syslog.log(self.realip + " signed in as " + name); Logger.syslog.log(self.realip + " signed in as " + name);
if (self.inChannel()) {
self.channel.logger.log(self.displayip + " signed in as " + name);
}
self.setFlag(Flags.U_LOGGED_IN); self.setFlag(Flags.U_LOGGED_IN);
self.emit("login", self.account); self.emit("login", self.account);
}); });