astei / SuperbVote

A superb Votifier listener.
https://www.spigotmc.org/resources/superbvote.11626/
Eclipse Public License 1.0
17 stars 36 forks source link

Error on player join when using MySQL database and streaks disabled #122

Open PlanetTeamSpeakk opened 3 years ago

PlanetTeamSpeakk commented 3 years ago

Whenever a player joins the server, an error is thrown and printed to the console. It doesn't cause any other issues, but should be fixed nonetheless. According to the error message and its stacktrace, it appears that this error is caused by the plugin not checking whether streaks are enabled or not when a player joins. The error in question looks as follows:

[13:42:22 WARN]: [SuperbVote] Plugin SuperbVote v0.5.5 generated an exception while executing task 2503910
java.lang.IllegalArgumentException: streaks not enabled
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[patched_1.16.5.jar:git-Paper-579]
        at io.minimum.minecraft.superbvote.storage.MysqlVoteStorage.getVoteStreak(MysqlVoteStorage.java:369) ~[?:?]
        at io.minimum.minecraft.superbvote.storage.VoteStorage.getVoteStreakIfSupported(VoteStorage.java:25) ~[?:?]
        at io.minimum.minecraft.superbvote.votes.SuperbVoteListener.lambda$onPlayerJoin$4(SuperbVoteListener.java:139) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-579]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.16.5.jar:git-Paper-579]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.5.jar:git-Paper-579]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
BrainStone commented 3 years ago

It would be interesting to know how to enable streaks btw.

The default config contains nothing about it. Also the streams table can't be renamed!

100petr commented 3 years ago

https://github.com/astei/SuperbVote/wiki/Configuration#if image

zachduda commented 3 years ago

Would also like to add that I'm having the same problem with SuperbVote

BrainStone commented 3 years ago

https://github.com/astei/SuperbVote/wiki/Configuration#if image

Nothing about what you posted is about streaks.
You posted the docs for the cumulative (aka total) votes.

100petr commented 3 years ago

image and last message and somehow it could be done, but probably the function doesn't work at all, because it gives an error about the database

viveleroi commented 3 years ago

I'm pretty sure this error has broken our vote rewards from being registered properly. No one has been getting vote rewards after we updated to the version that has this change. Nothing about the streaks appears in our config file, so I can't even turn it on.