Fix issues with regard to unloading channels
This commit is contained in:
parent
f7e968a13c
commit
efcae43ae8
3 changed files with 12 additions and 4 deletions
|
|
@ -135,7 +135,10 @@ module.exports = function (Server) {
|
|||
return;
|
||||
ActionLog.record(user.ip, user.name, "acp-channel-unload");
|
||||
c.initialized = data.save;
|
||||
c.users.forEach(function(u) {
|
||||
// copy the list of users to prevent concurrent
|
||||
// modification
|
||||
var users = Array.prototype.slice.call(c.users);
|
||||
users.forEach(function (u) {
|
||||
c.kick(u, "Channel shutting down");
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -862,10 +862,8 @@ Channel.prototype.kick = function(user, reason) {
|
|||
user.socket.emit("kick", {
|
||||
reason: reason
|
||||
});
|
||||
if(user.socket.disconnected) {
|
||||
this.userLeave(user);
|
||||
}
|
||||
user.socket.disconnect(true);
|
||||
user.channel = null;
|
||||
}
|
||||
|
||||
Channel.prototype.hideIP = function(ip) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue