Hi,
The code works ok, the rewards work but the only problem that I have is this:
java.sql.SQLSyntaxErrorException: (conn=137753) Could not set parameter at position 5 (values was true)
Query - conn:137753(M) - "INSERT INTO individualvotes(voterIp,voteSite,votingTimeSite,alreadyRewarded) VALUES(?,?,?,?) ON DUPLICATE KEY UPDATE voterIp = VALUES(voterIp), voteSite = VALUES(voteSite), votingTimeSite = VALUES(votingTimeSite),alreadyRewarded = VALUES(alreadyRewarded)"
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:62)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:171)
at org.mariadb.jdbc.ClientSidePreparedStatement.setParameter(ClientSidePreparedStatement.java:482)
at org.mariadb.jdbc.BasePrepareStatement.setBoolean(BasePrepareStatement.java:1342)
at org.l2jmobius.gameserver.votesystem.DB.individualVoteDB.SaveVotes(individualVoteDB.java:104)
at org.l2jmobius.gameserver.votesystem.Handler.voteManager.AutoUpdateIndividualVotes(voteManager.java:301)
at org.l2jmobius.gameserver.votesystem.Handler.voteManager$AutoUpdateIndividualVotesTask.run(voteManager.java:400)
at org.l2jmobius.commons.threads.RunnableWrapper.run(RunnableWrapper.java:38)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:831)
After you press "Get reward", everything works fine. But after a few seconds in the GameServer, the above error happens, and the individualvote table remains empty. The voting is not saved. The value returned is true but the table does not update.
Which means if the server is restarted, the player can benefit from the rewards again.