From 1afd8253a5a828bf168ef67485455d19cc006c14 Mon Sep 17 00:00:00 2001 From: BenCodez Date: Fri, 13 Dec 2024 09:58:29 -0600 Subject: [PATCH] Add extra time change checks on login --- .../votingplugin/bungee/VotingPluginBungee.java | 6 ++++++ .../bungee/velocity/VotingPluginVelocity.java | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java index d6e63ca75..36da186ab 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java @@ -1173,6 +1173,12 @@ public void login(ProxiedPlayer p) { @Override public void run() { if (isOnline(p)) { + if (getConfig().getGlobalDataEnabled()) { + if (getGlobalDataHandler().isTimeChangedHappened()) { + getGlobalDataHandler().checkForFinishedTimeChanges(); + } + } + checkCachedVotes(server); checkOnlineVotes(proxiedPlayer, proxiedPlayer.getUniqueId().toString(), server); multiProxyHandler.login(proxiedPlayer.getUniqueId().toString(), proxiedPlayer.getName()); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java index e167878ae..70ae228a7 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java @@ -543,6 +543,12 @@ public void onPluginMessagingReceived(PluginMessageEvent event) { @Override public void run() { + if (getConfig().getGlobalDataEnabled()) { + if (getGlobalDataHandler().isTimeChangedHappened()) { + getGlobalDataHandler().checkForFinishedTimeChanges(); + } + } + debug("Checking offline votes for " + p.getUsername() + "/" + p.getUniqueId().toString()); checkCachedVotes(server); @@ -1015,6 +1021,12 @@ protected void onMessage(String channel, String[] message) { @Override public void run() { + if (getConfig().getGlobalDataEnabled()) { + if (getGlobalDataHandler().isTimeChangedHappened()) { + getGlobalDataHandler().checkForFinishedTimeChanges(); + } + } + checkCachedVotes(server); checkOnlineVotes(p1, p.getUniqueId().toString(), server); getMultiProxyHandler().login(p1.getUniqueId().toString(),