mirror of
https://github.com/RayzsYT/ProAntiTab.git
synced 2026-11-26 18:39:43 -05:00
Lowercase Servernames
This commit is contained in:
1 parent
cd779a57f3
commit
05bd83f82c
3 files changed
+9
-6
No files matched your search
@@ -129,7 +129,7 @@ public class Communicator {
|
||||
String tempServerName = "";
|
||||
|
||||
if(clientInfo != null && clientInfo.getName() != null) {
|
||||
tempServerName = clientInfo.getName();
|
||||
tempServerName = clientInfo.getName().toLowerCase();
|
||||
if(!Storage.Blacklist.isOnIgnoredServer(tempServerName))
|
||||
commands.addAll(Storage.Blacklist.getBlacklist().getCommands());
|
||||
|
||||
|
||||
@@ -245,20 +245,21 @@ public class Storage {
|
||||
}
|
||||
|
||||
public static void clearServerBlacklists(String server) {
|
||||
CACHED_SERVER_BLACKLIST.remove(server);
|
||||
CACHED_SERVER_BLACKLIST.remove(server.toLowerCase());
|
||||
}
|
||||
|
||||
public static List<GeneralBlacklist> getBlacklists(String server) {
|
||||
if(CACHED_SERVER_BLACKLIST.contains(server)) return CACHED_SERVER_BLACKLIST.get(server);
|
||||
final String finalServer = server.toLowerCase();
|
||||
if(CACHED_SERVER_BLACKLIST.contains(finalServer)) return CACHED_SERVER_BLACKLIST.get(finalServer);
|
||||
|
||||
List<GeneralBlacklist> blacklists = new ArrayList<>();
|
||||
SERVER_BLACKLISTS.entrySet()
|
||||
.stream().filter(entry -> entry.getKey().endsWith("*")
|
||||
? isServer(entry.getKey(), server)
|
||||
: entry.getKey().equalsIgnoreCase(server))
|
||||
? isServer(entry.getKey(), finalServer)
|
||||
: entry.getKey().equalsIgnoreCase(finalServer))
|
||||
.forEach(entry -> blacklists.add(entry.getValue()));
|
||||
|
||||
return CACHED_SERVER_BLACKLIST.putAndGet(server, blacklists);
|
||||
return CACHED_SERVER_BLACKLIST.putAndGet(finalServer, blacklists);
|
||||
}
|
||||
|
||||
public static boolean isListed(String command, String server) {
|
||||
|
||||
@@ -115,6 +115,8 @@ public class Group implements Serializable {
|
||||
}
|
||||
|
||||
public List<GroupBlacklist> getAllServerGroupBlacklist(String server) {
|
||||
server = server.toLowerCase();
|
||||
|
||||
if(cachedServerGroupBlacklists.contains(server))
|
||||
return cachedServerGroupBlacklists.get(server);
|
||||
|
||||
|
||||
Reference in new issue
Block a user