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 != "") { if(user.name != "") {
for(var i = 0; i < this.users.length; i++) { for(var i = 0; i < this.users.length; i++) {
if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) { if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) {
user.name = ""; console.log("DBG");
user.loggedIn = false; this.kick(this.users[i], "Duplicate login");
user.socket.emit("login", {
success: false,
error: "The username " + user.name + " is already in use on this channel"
});
} }
} }
} }

View file

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