From 040fafe33ad6b48ea9015b7ad59ed62818b88867 Mon Sep 17 00:00:00 2001 From: BenCodez Date: Sun, 3 Mar 2024 14:43:13 -0500 Subject: [PATCH] Add better handling of more than 2 proxies in multi-proxy setup --- .../bungee/global/multiproxy/MultiProxyHandler.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/global/multiproxy/MultiProxyHandler.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/global/multiproxy/MultiProxyHandler.java index 4a1376daa..41bce6212 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/global/multiproxy/MultiProxyHandler.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/global/multiproxy/MultiProxyHandler.java @@ -94,7 +94,11 @@ public void onReceive(String[] data) { logInfo("Multi-proxy status message received"); } else if (data[0].equalsIgnoreCase("ClearVote")) { clearVote(data[2]); - // cachedOnlineVotes.remove(data[2]); + if (getPrimaryServer()) { + sendMultiProxyServerMessage("ClearVotePrimary", data[1], data[2]); + } + } else if (data[0].equalsIgnoreCase("ClearVotePrimary")) { + clearVote(data[2]); } else if (data[0].equalsIgnoreCase("login")) { addNonVotedPlayerCache(data[1], data[2]); // nonVotedPlayersCache.addPlayer(data[1], data[2]); @@ -134,7 +138,11 @@ public void onMessage(String channel, String[] data) { logInfo("Multi-proxy status message received"); } else if (data[0].equalsIgnoreCase("ClearVote")) { clearVote(data[2]); - // cachedOnlineVotes.remove(data[2]); + if (getPrimaryServer()) { + sendMultiProxyServerMessage("ClearVotePrimary", data[1], data[2]); + } + } else if (data[0].equalsIgnoreCase("ClearVotePrimary")) { + clearVote(data[2]); } else if (data[0].equalsIgnoreCase("login")) { addNonVotedPlayerCache(data[1], data[2]); // nonVotedPlayersCache.addPlayer(data[1], data[2]);