Replaced window.prompt()/alert() with custom popup
This commit is contained in:
parent
8ccb9003cc
commit
ee5a8d9516
14 changed files with 138 additions and 63 deletions
|
|
@ -51,9 +51,9 @@ module.exports = class{
|
|||
if(ban != null){
|
||||
//Toss out banned user's
|
||||
if(ban.expirationDays < 0){
|
||||
socket.emit("kick", {type: "Unauthorized", reason: "You have been permanently banned from this channel!"});
|
||||
socket.emit("kick", {type: "Banned", reason: "You have been permanently banned from this channel!"});
|
||||
}else{
|
||||
socket.emit("kick", {type: "Unauthorized", reason: `You have been temporarily banned from this channel, and will be unbanned in ${ban.getDaysUntilExpiration()} day(s)!`});
|
||||
socket.emit("kick", {type: "Banned", reason: `You have been temporarily banned from this channel, and will be unbanned in ${ban.getDaysUntilExpiration()} day(s)!`});
|
||||
}
|
||||
socket.disconnect();
|
||||
return;
|
||||
|
|
@ -72,7 +72,7 @@ module.exports = class{
|
|||
}
|
||||
}else{
|
||||
//Toss out anon's
|
||||
socket.emit("kick", {type: "Unauthorized", reason: "You must log-in to join this channel!"});
|
||||
socket.emit("kick", {type: "Disconnected", reason: "You must log-in to join this channel!"});
|
||||
socket.disconnect();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ module.exports = class{
|
|||
}
|
||||
|
||||
//generic disconnect function, defaults to kick
|
||||
disconnect(reason, type = "kick"){
|
||||
disconnect(reason, type = "Disconnected"){
|
||||
this.emit("kick",{type, reason});
|
||||
this.socketCrawl((socket)=>{socket.disconnect()});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue