-
-
Notifications
You must be signed in to change notification settings - Fork 80
Add rewards for votes rejected by vote delay #1536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,13 @@ public void onplayerVote(PlayerVoteEvent event) { | |
| } else { | ||
| if (!user.hasPermission("VotingPlugin.BypassWaitUntilVoteDelay")) { | ||
| plugin.getLogger().info(user.getPlayerName() + " must wait until votedelay is over, ignoring vote"); | ||
| boolean online = user.isOnline(); | ||
| if (event.isBungee()) { | ||
| online = event.isWasOnline(); | ||
| } | ||
| if (plugin.getOptions().isProcessRewards()) { | ||
| voteSite.giveWaitUntilVoteDelayRewards(user, online, event.isBungee()); | ||
|
Comment on lines
+160
to
+161
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a proxy-delivered vote reaches a backend with Useful? React with 👍 / 👎.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Comment on lines
+160
to
+161
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a network enables Useful? React with 👍 / 👎. |
||
| } | ||
| return; | ||
| } | ||
| plugin.getLogger() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1499,6 +1499,17 @@ public void status() { | |
| } | ||
| } | ||
|
|
||
| private void sendVoteDelayRejected(String player, String uuid, String service, boolean playerOnline, | ||
| String playerServer) { | ||
| if (!playerOnline || playerServer == null || !getAllAvailableServers().contains(playerServer)) { | ||
| debug("Not sending vote delay rejection for " + player + " because the player is offline"); | ||
| return; | ||
|
Comment on lines
+1504
to
+1506
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| globalMessageProxyHandler.sendMessage(playerServer, 1, | ||
| VotingPluginWire.voteDelayRejected(player, uuid, service, true)); | ||
| } | ||
|
|
||
| public String getWaitUntilDelaySiteFromService(String service) { | ||
| for (String site : getConfig().getWaitUntilVoteDelaySites()) { | ||
| if (getConfig().getWaitUntilVoteDelayService(site).equalsIgnoreCase(service)) { | ||
|
|
@@ -1718,6 +1729,7 @@ private synchronized void vote(String player, String service, boolean realVote, | |
|
|
||
| if (!checkVoteDelay(uuid, service, data)) { | ||
| log("Vote delay is not met for " + player + "/" + service + ", skipping vote"); | ||
| sendVoteDelayRejected(player, uuid, service, playerOnline, playerServer); | ||
| return; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bulk registration covers sites present during
loadDirectlyDefined(), butConfigVoteSites.generateVoteSite()dynamically reloads sites and then manually registers onlyRewardsandCoolDownEndRewards. Consequently, an auto-created site has no directly definedWaitUntilVoteDelayRewardsentry until a full plugin reload, so reward-editor or migration lookups cannot access the new section immediately; add the new path to the dynamic registration flow as well.Useful? React with 👍 / 👎.