Improve banning servers (#1719)

This commit is contained in:
Mia 2021-02-01 15:18:38 -06:00 committed by GitHub
parent b3239205fc
commit 868244d49f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -709,7 +709,17 @@ function toId() {
connect: function () {
if (this.down) return;
if (Config.server.banned || (Config.bannedHosts && Config.bannedHosts.indexOf(Config.server.host) >= 0)) {
if (Config.bannedHosts) {
for (var i = 0; i < Config.bannedHosts.length; i++) {
var host = Config.bannedHosts[i];
if (typeof host === 'string' ? Config.server.host === host : host.test(Config.server.host)) {
Config.server.banned = true;
break;
}
}
}
if (Config.server.banned) {
this.addPopupMessage("This server has been deleted for breaking US laws, impersonating PS global staff, or other major rulebreaking.");
return;
}