This commit is contained in:
calzoneman 2013-06-04 18:33:51 -04:00
parent 2c57d2a8f2
commit ae55f44906
2 changed files with 3 additions and 11 deletions

View File

@ -537,12 +537,8 @@ Channel.prototype.userJoin = function(user) {
if(user.name != "") {
for(var i = 0; i < this.users.length; i++) {
if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) {
user.name = "";
user.loggedIn = false;
user.socket.emit("login", {
success: false,
error: "The username " + user.name + " is already in use on this channel"
});
console.log("DBG");
this.kick(this.users[i], "Duplicate login");
}
}
}

View File

@ -521,11 +521,7 @@ User.prototype.login = function(name, pw, session) {
if(this.channel != null && name != "") {
for(var i = 0; i < this.channel.users.length; i++) {
if(this.channel.users[i].name == name) {
this.socket.emit("login", {
success: false,
error: "The username " + name + " is already in use on this channel"
});
return false;
this.channel.kick(this.channel.users[i], "Duplicate login");
}
}
}