Skip to content

Commit

Permalink
Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEasyPeasy committed Aug 13, 2022
1 parent 1556507 commit 0f45840
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public boolean isCached(final String address) {
}

public boolean isDisallowedInCache(final String address) {
final Boolean allowed = cachedAddresses.getIfPresent(address);
return allowed != null && !allowed;
final Boolean disAllowed = cachedAddresses.getIfPresent(address);
return disAllowed != null && disAllowed;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ public void onJoin(final PreLoginEvent e) {
if(whitelistManager.isWhitelisted(ip)) {
return;
}
if(cacheManager.isCached(ip) && cacheManager.isDisallowedInCache(ip)) {
e.setCancelReason(this.kickMessage);
e.setCancelled(true);
if(cacheManager.isCached(ip)) {
if(cacheManager.isDisallowedInCache(ip)) {
e.setCancelReason(this.kickMessage);
e.setCancelled(true);
return;
}
return;
}
try {
Expand Down

0 comments on commit 0f45840

Please sign in to comment.