From 0042045d9bb0df0a857aee9bfdabcf8fc2a62b1d Mon Sep 17 00:00:00 2001 From: BenCodez Date: Fri, 13 Dec 2024 09:10:04 -0600 Subject: [PATCH] Add bypass fail safe options for bungee time checking --- VotingPlugin/src/com/bencodez/votingplugin/bungee/Config.java | 4 ++++ .../com/bencodez/votingplugin/bungee/VotingPluginBungee.java | 2 ++ .../src/com/bencodez/votingplugin/bungee/velocity/Config.java | 4 ++++ .../votingplugin/bungee/velocity/VotingPluginVelocity.java | 1 + 4 files changed, 11 insertions(+) diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/Config.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/Config.java index c883e73f9..6a2477cb2 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/Config.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/Config.java @@ -72,6 +72,10 @@ public String getBedrockPlayerPrefix() { public boolean getOnlineMode() { return getData().getBoolean("OnlineMode", true); } + + public boolean getTimeChangeFailSafeBypass() { + return getData().getBoolean("TimeChangeFailSafeBypass", false); + } public boolean getUUIDLookup() { return getData().getBoolean("UUIDLookup", true); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java index 4d8b18ee5..c53b30ec0 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/VotingPluginBungee.java @@ -749,7 +749,9 @@ public void debug(String text) { voteCacheFile = new VoteCache(this); voteCacheFile.load(); + bungeeTimeChecker.setTimeChangeFailSafeBypass(config.getTimeChangeFailSafeBypass()); bungeeTimeChecker.loadTimer(); + nonVotedPlayersCache = new NonVotedPlayersCache(this); nonVotedPlayersCache.load(); diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/Config.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/Config.java index 073bb8c05..2bde240a6 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/Config.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/Config.java @@ -37,6 +37,10 @@ public boolean getOnlineMode() { return getBoolean(getNode("OnlineMode"), true); } + public boolean getTimeChangeFailSafeBypass() { + return getBoolean(getNode("TimeChangeFailSafeBypass"), false); + } + public boolean getStoreMonthTotalsWithDate() { return getBoolean(getNode("StoreMonthTotalsWithDate"), false); } diff --git a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java index 32c275eb2..d6e978104 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/bungee/velocity/VotingPluginVelocity.java @@ -844,6 +844,7 @@ public void debug(String text) { voteCacheFile.save(); } + bungeeTimeChecker.setTimeChangeFailSafeBypass(config.getTimeChangeFailSafeBypass()); bungeeTimeChecker.loadTimer(); try {