Zrips / CMI

114 stars 97 forks source link

Playtime Rewards Errors #1337

Closed mercurialmusic closed 5 years ago

mercurialmusic commented 5 years ago

Description of issue or feature request: Having a strange thing happen with playtime rewards, even stranger because it's only happening on one of our 3 servers and more so with older players, not with newer ones -- but several of them aren't receiving the hourly reward anymore, and when we they use /prewards to check it it shows: 1. 'Hourly reward' reward in 99 days 5 hours 57 mins 58 sec

To test it I tried changing the 'PayEvery:' listed below to 1000 and all it did was shave a few minutes off the 99 days listed above. I checked out actual play time and all seemed normal.

My attention was only drawn to it last night, but some of our staff said they noticed it about the middle of last week.

Thanks!

CONFIG SECTION (DELETE IF NOT RELEVANT):

#####################################
hourly1:
  DisplayName: "&7Hourly reward"
  AutoClaim: true
  Description:
  - "&2Get 1 Loyalty Point for every hour you are online"
  PayEvery: 3600
  Commands:
  - tokenmanager give [playerName] 1
#####################################

Cmi Version (using/cmi version): CMI plugin version: 8.3.8.1 Server Type (Spigot/Paperspigot/etc): Spigot Server Version (using /ver): CraftBukkit version git-Spigot-f56e2e7-1a64d4a (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)

Zrips commented 5 years ago

How much of playtime they have in total? Those older players.

mercurialmusic commented 5 years ago

Just ran a couple from console:

28.01 11:41:40 [Multicraft] mercurialmusic ran command: cmi playtime furiocraft
28.01 11:41:40 [Server] INFO --------------------------------------------------
28.01 11:41:40 [Server] INFO * Total play time: 24 days 6 hours 5 min 46 sec 
28.01 11:41:40 [Server] INFO * Joined on: 21/01/18 22:46:44
28.01 11:41:40 [Server] INFO --------------------------------------------------
28.01 11:41:50 [Multicraft] mercurialmusic ran command: cmi playtime mercurialmusic
28.01 11:41:50 [Server] INFO --------------------------------------------------
28.01 11:41:50 [Server] INFO * Total play time: 21 days 15 hours 43 min 39 sec 
28.01 11:41:50 [Server] INFO * Joined on: 21/08/16 00:15:48
28.01 11:41:50 [Server] INFO --------------------------------------------------

And just for kicks ran the prewards again:

28.01 11:46:12 [Multicraft] mercurialmusic ran command: cmi prewards furiocraft
28.01 11:46:12 [Server] INFO --------------------------------------------------
28.01 11:46:12 [Server] INFO 1. Hourly reward reward in 47 days 12 hours 37 min 45 sec 
28.01 11:46:12 [Server] INFO --------------------------------------------------
28.01 11:46:17 [Multicraft] mercurialmusic ran command: cmi prewards mercurialmusic
28.01 11:46:17 [Server] INFO --------------------------------------------------
28.01 11:46:17 [Server] INFO 1. Hourly reward reward in 99 days 4 hours 23 min 30 sec 
28.01 11:46:17 [Server] INFO --------------------------------------------------

It's really strange how 6 days later the hours on mine has changed but not days. We use the sql database if it matters, currently sitting at 24mb -- I was kinda curious if it could be a database issue. Also, I said previously that playtime seems fine, but I don't know if that's accurate -- we have another tracker for playtime that keeps its own logs and it lists me as having "80 Days, 1 Hr, 13 Min". But we also had a world reset in 1.13 so the 21 days may be accurate to the new world time.

Anything else that might be useful? :-/

mercurialmusic commented 5 years ago

Thinking about it, it's possible that this is only affecting people who were around before that world reset. The one's it's definitely not affecting are the ones who joined after. I'll dig a little more into that. But like I said, it was working fine up until about 1.5 weeks ago.

mercurialmusic commented 5 years ago

Oh, yeah... playtime is not accurate. Tried it for another player:

28.01 11:57:39 [Multicraft] mercurialmusic ran command: cmi playtime mob_meal
28.01 11:57:39 [Server] INFO --------------------------------------------------
28.01 11:57:39 [Server] INFO * Total play time: 2 days 22 hours 29 min 18 sec 
28.01 11:57:39 [Server] INFO * Joined on: 05/08/17 18:48:33
28.01 11:57:39 [Server] INFO --------------------------------------------------
28.01 11:57:52 [Multicraft] mercurialmusic ran command: ontime mob_meal
28.01 11:57:52 [Server] INFO Mob_Meal  : Joined the server 540  days ago.
28.01 11:57:52 [Server] INFO Mob_Meal  : Has been on 429  different days.
28.01 11:57:52 [Server] INFO Mob_Meal  : Last login on [01/27/2019 22:48:44]  
28.01 11:57:52 [Server] INFO Mob_Meal  : This login= Not Online    
28.01 11:57:52 [Server] INFO Mob_Meal  : AFK time this login= N/A 
28.01 11:57:52 [Server] INFO Mob_Meal  : AFK time today= N/A 
28.01 11:57:52 [Server] INFO Mob_Meal  : AFK time this week= N/A 
28.01 11:57:52 [Server] INFO Mob_Meal  : AFK time this month= N/A 
28.01 11:57:52 [Server] INFO Mob_Meal  : Today= 0  Seconds 
28.01 11:57:52 [Server] INFO Mob_Meal  : This Week= 0  Seconds 
28.01 11:57:52 [Server] INFO Mob_Meal  : This Month=   1  Day  11  Hr  35  Min   
28.01 11:57:52 [Server] INFO Mob_Meal  : Total Time=  50  Day   5  Hr  26  Min
28.01 11:59:09 [Multicraft] mercurialmusic ran command: cmi prewards mob_meal
28.01 11:59:09 [Server] INFO --------------------------------------------------
28.01 11:59:09 [Server] INFO 1. Hourly reward reward in 49 days 2 hours 31 min 47 sec 
28.01 11:59:09 [Server] INFO --------------------------------------------------

Also noticing, at least from console, running the prewards command (but not cmi playtime or the ontime (other plugin) check seems to take a good 15-20 seconds to print in console.

mercurialmusic commented 5 years ago
28.01 11:02:43 [Multicraft] mercurialmusic ran command: cmi playtime mob_meal
28.01 11:02:43 [Server] INFO --------------------------------------------------
28.01 11:02:43 [Server] INFO * Total play time: 2 days 19 hours 36 min 19 sec 
28.01 11:02:43 [Server] INFO * Joined on: 10/08/17 13:07:30
28.01 11:02:43 [Server] INFO --------------------------------------------------
28.01 11:04:55 [Multicraft] mercurialmusic ran command: cmi prewards mob_meal
28.01 11:04:55 [Server] INFO --------------------------------------------------
28.01 11:04:55 [Server] INFO 1. Hourly reward reward in 44 min 23 sec 
28.01 11:04:55 [Server] INFO 2. 100-hour Milestone reward in 1 day 8 hours 23 min 40 sec 
28.01 11:04:55 [Server] INFO 3. 150-hour Milestone reward in 3 days 10 hours 23 min 40 sec 
28.01 11:04:55 [Server] INFO --------------------------------------------------

Running the same on another server, all seems fine, time matches up.

mercurialmusic commented 5 years ago

Actually... suddenly today people are saying their homes are disappearing. So I think our database is messed. :(

mercurialmusic commented 5 years ago

Well, no... I downloaded a copy of the DB and ran an integrity check and it was fine. So no clue.

mercurialmusic commented 5 years ago

So I've been going back through some of these players and editing their playtime (took me a while to realize the /cmi editplaytime add had to be in seconds!) and just added the number of seconds they needed to effect the next hourly reward, which worked and seems to have fixed the 99 day thing -- their prewards now shows up normally.

Definitely seems like a bandaid fix, though. Still no idea why it messed in the first place or what was going on with homes (probably a separate issue). I ended up rolling back our entire CMI folder last night because half of our players' homes suddenly disappeared and this playtime thing was happening. Deleted the entire folder and restored from a backup, then edited the playtime as mentioned, and so far it seems all right? Very strange.

mercurialmusic commented 5 years ago

This started happening again within the last day or two. Same people again, too. Any ideas?

I had rolled our database back a week to fix it the last time, which did seem to fix it for about a week...

mercurialmusic commented 5 years ago

So I didn't roll back the database tonight but I did add the time like I did last time with /cmi editplaytime and getting some weird things: For this player, tonight his prewards was saying 49 days and change until the next hourly rewards, so I added the 49 days to get him within an hour: http://prntscr.com/mh7hzc

It wasn't quite there after the first command so I added the 4 hours he needed and it did this: http://prntscr.com/mh7iqd

Looks like the time is rolling over? Because after I added those 4 hours it says he's back to needing 49 days to his next hourly reward on the prewards and his total playtime is 2 days (when it's well over 50 hours).

mercurialmusic commented 5 years ago

This appears to be fixed in recent builds, and thank you! I'll reopen if anything weird happens.

mercurialmusic commented 5 years ago

So it's still being weird. After I closed it last time it would work for a while then go back to saying the player had 49 however many days left until the next reward. Recent behavior was that I was just able to add that time and it worked for a while until it stopped working again. However, after the update to 8.5.1.4 I'm not even able to do that... But instead of "Hourly reward in 49 days" it now says (for example) "Hourly reward in 1 day 34 minutes". Editing playtime doesn't work any longer. Then when it gets down to one hour left it resets to 1 hour 59 minutes and still doesn't give the reward.

mercurialmusic commented 5 years ago

Seems like I was able to solve the latest behavior by just renaming the reward in the config. Working as normal now even after restarts, so hopefully that will continue.