
Server is Not Giving Rewards to Players.
viiizee opened this issue ยท 6 comments
Hi there, I was just wondering if you could shed some light on how the mod works server-side. I've changed the time to 1-minute for rewards, because it didn't seem to wanna give players the option at the default 30 even after being logged in for 2 hours. When I made the change to 1 and reset the server, it gave us the option to claim, but when the day turned to December 2nd, we never got a prompt? Does the server have to reset on the day every day? I tried reconnecting without resetting the server and still did not receive a prompt after 1-min.
Also, it's worth noting that I deleted the world /data files and /player data files as I thought something might have been buggin' when the 30-min config wasn't prompting players. I did not reset the entire world. Does regenerating these files after the fact cause problems server-side?
Or is it that the player must log in after a 24-hour period from their last login? I can see that the server is reading the config files on startup and is recognizing when rewards should be given, but on resetting client and server and trying to join I'm not receiving the rewards even though it says I should get one after 1 minute?
To Reproduce
Steps to reproduce the behavior:
- Setup configs.
- Load a server world.
- Join the server.
- After the set time, I'm not receiving anything or prompt that I can claim reward.
Gotcha. Here is the latest log from my server.. Definitely sounds like it's a tick issue. Would love for the ability to use a command to check tick.. It's funny you said that as I was literally saying to my friend how handy that feature would be last night.
server178971 - 3 Dec 2022 2_5_39.zip
Forge 1.18.2 - 40.1.73
Daily Rewards 1.18.2-1.0.0
It works fine in single player, but my multiplayer server with Bisect is not.
I had a look at the /data files and it's very strange. Our first rewards for flint were for December 1st, which was yesterday. After fiddling around with the config and reloading the server with a 1-minute requirement to receive reward, we managed to get the server to give us the prompt to receive, and before it hit 12:00 AM or December 2nd.
But... according to the data files, my users received their rewards for the 2nd, even though the reward they claimed was flint; which is on day 1 of the month?
I launched the server on December 1st, does this maybe have something to do with it? Not sure.
Thanks for the feedback, let me try to explain the logic and the mod more in detail.
Reward System Logic
First of all the rewards entries are not bound to specific days, it's more like a progressing system.
Which mean if the user is able to get his first reward it will be the always the first reward in the list regardless of the current day.
To received the reward for the last entry the user needs to log in each single day for this month, if the user miss a day than he only gets the 30/29 entries.
This makes is possible to start with less valuable items and add more valuable items to the last days.
Granting of rewards
Rewards are granted Start of the day + Delay
which mean if a user log in before midnight he could claim two rewards one before midnight and one after midnight. So it's not 24 hours from the last claim to avoid issues from late (Mo-Fr) and early (Sat - Sun) claims.
The check is performed on the user login and at specific intervals (every 1200 ticks) for logging in users.
As soon the user disconnect, the delay counter will start from 0 again for this user.
Rewards Config
The server only needs to be restarted to re-read the rewards config or if the data file are manually adjusted.
If you adjust the reward config for the current month, you should delete the data files to make sure that there is no miss match with already created data and the new data.
Regarding your issue
It would be great if you could link the full corresponding server log, to see if there is anything strange there.
Basically the mod checks for the player tickCount, which means if an user is idle or if there is any mod which modify the player tickCount, it could be that the delay is not working accurate.
I will add an command with the next update which shows the currently tracked user, if they claimed their rewards for today and when they will get their next reward according their tickCount.
At the moment it sounds like that there is an issue with the player tickCount, which could be caused mods, modified clients or modified servers.
I just released a new version under https://www.curseforge.com/minecraft/mc-mods/daily-rewards/files/4160327 which should be live in the next minutes.
This version displayed a counter for the next claimable reward directly in the UI for the player like:
Let me know if this helps to isolate the issue or if you get any strange messages here.
If this is still not working I will add some additional "debug" commands with the next update. Thanks.