From 9babf452720b158c1b789664f6c389882876d6af Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 29 Apr 2024 07:09:19 +0100 Subject: [PATCH] fix new server count --- src/main/java/cc/fascinated/piaservers/pia/PiaManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java b/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java index ffb1c7f..4518f68 100644 --- a/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java +++ b/src/main/java/cc/fascinated/piaservers/pia/PiaManager.java @@ -85,7 +85,8 @@ public class PiaManager { // Add the server to the list PiaServer server = new PiaServer(serverToken.getIp(), serverToken.getRegion(), new Date()); SERVERS.add(server); - if (!SERVERS.contains(server)) { + boolean newServer = SERVERS.stream().noneMatch(s -> s.getIp().equals(server.getIp())); + if (newServer) { newServers++; } }