mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
reuse latestSession to cut down on db requests
This commit is contained in:
@@ -369,19 +369,20 @@ public class BanStickEventHandler implements Listener {
|
||||
// Then do VPN checks
|
||||
if (enableProxyBans || enableProxyKicks) {
|
||||
// Inject IP Hub handler.
|
||||
BanStick.getPlugin().getIPHubHandler().offer(bsPlayer.getLatestSession().getIP());
|
||||
final BSSession latestSession = bsPlayer.getLatestSession();
|
||||
BanStick.getPlugin().getIPHubHandler().offer(latestSession.getIP());
|
||||
|
||||
try {
|
||||
if (bsPlayer.getProxyPardonTime() == null) {
|
||||
if (bsPlayer.getLatestSession().getIP() == null) {
|
||||
if (latestSession.getIP() == null) {
|
||||
BanStick.getPlugin().warning("Weird failure, no ip for {0}", bsPlayer);
|
||||
return;
|
||||
}
|
||||
if (bsPlayer.getLatestSession().getIP().getIPAddress() == null) {
|
||||
if (latestSession.getIP().getIPAddress() == null) {
|
||||
BanStick.getPlugin().warning("Weird failure, no ip address for {0}", bsPlayer);
|
||||
return;
|
||||
}
|
||||
List<BSIPData> proxyChecks = BSIPData.allByIP(bsPlayer.getLatestSession().getIP());
|
||||
List<BSIPData> proxyChecks = BSIPData.allByIP(latestSession.getIP());
|
||||
if (proxyChecks != null) {
|
||||
for (BSIPData proxyCheck : proxyChecks) {
|
||||
// check if entire provider is banned
|
||||
|
||||
Reference in New Issue
Block a user