mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Improve banning servers (#1719)
This commit is contained in:
parent
b3239205fc
commit
868244d49f
12
js/client.js
12
js/client.js
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user