darbyjack / VoteParty

Give rewards to all online players when the server gets a certain amount of votes! 1.8+
https://wiki.helpch.at/glares-plugins/voteparty
MIT License
19 stars 14 forks source link

[Feature Request] Allow Receiving Cumulative Vote Rewards While Offline #91

Open UnknownSilicon opened 1 year ago

UnknownSilicon commented 1 year ago

The check cumulative functions (checkDailyCumulative, checkWeeklyCumulative, etc.) in https://github.com/darbyjack/VoteParty/blob/01a0d4e184bec29913fb931c41e9ce589700180c/src/main/kotlin/me/clip/voteparty/handler/VotesHandler.kt#L100 are only called when a player is online due to this check https://github.com/darbyjack/VoteParty/blob/01a0d4e184bec29913fb931c41e9ce589700180c/src/main/kotlin/me/clip/voteparty/listener/VotesListener.kt#L53

Since the cumulative checks only see if the player has exactly the correct amount of votes, players do not receive cumulative rewards if they were offline for the last vote. This could be fixed in one of two ways:

  1. Keep track of the cumulative rewards a player did receive and change the cumulative check to check for greater than or equal to the required amount of votes.
  2. Add cumulative rewards to a player's claimable, redeeming them when the player next joins (as shown in this commit https://github.com/ParallelMC/VoteParty/commit/084d78f53f8f6c89d7cd79819bdec01712b7ef1d. This exact solution isn't clean, but it may end up being less data to track).