Skip to content

Commit

Permalink
Adjustments to cooldown checks
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Mar 7, 2024
1 parent 36eb6ea commit c8e3269
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,19 @@ public void checkEnabled() {
}

public void check(UUID uuid) {
check(plugin.getVotingPluginUserManager().getVotingPluginUser(uuid));
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(uuid);
if (!user.isOnline()) {
user.dontCache();
}
check(user);
}

public void checkPerSite(UUID uuid) {
checkPerSite(plugin.getVotingPluginUserManager().getVotingPluginUser(uuid));
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(uuid);
if (!user.isOnline()) {
user.dontCache();
}
checkPerSite(user);
}

public void vote(VotingPluginUser user, VoteSite site) {
Expand Down Expand Up @@ -147,19 +155,19 @@ public void run() {
check(uuid);
}
}
}, time+2, TimeUnit.SECONDS);
}, time + 2, TimeUnit.SECONDS);
allSiteTasks.put(uuid, scheduledFuture);
}

}

public void load() {

plugin.addUserStartup(new UserStartup() {

@Override
public void onStartUp(AdvancedCoreUser advancedcoreUser) {
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(advancedcoreUser);
user.dontCache();
if (cooldownCheckEnabled) {
check(user);
}
Expand Down

0 comments on commit c8e3269

Please sign in to comment.