Autorank

Autorank

380k Downloads

Players' time deleted during startup

AntZaro opened this issue ยท 24 comments

commented

Hi,

We've been using Autorank for about 4 years now (thanks so much for all your work on this plugin!). Unfortunately, we had issues that caused us to lose the playtime of many players. We did our best to restore on an ad hoc basis over time.

More recently though, one of our admins created a script that scanned all our old Autorank backup files to recover people's total time over all of the past 4 years. His script outputted this data in the form of the total_time.yml file. We pasted this file into the Autorank folder and started the server in hope to have everyone's proper time restored.

However, when Autorank starts up, it erases basically all of the data. It will actually say in console "17,400 old entries removed!". I have tried changing plugin settings and we attempted pasting the file in multiple times (of course while the server is off). Nothing works. It erases thousands of entries each time, leaving only 20 or so out of nearly 18,000.

Is there any way to stop this behavior? We would love to give all our players their total time stat back and have the plugin store this data so that when older players return, they still have their total time as well. We already did the hard work gathering the time data; we just need the plugin to stop erasing it all. Thanks!

commented

Yes, that's exactly it. Something like "Removed 17,500 old storage entries from the database". I can get my exact logs for you if you want.

I did go into settings and shut off the "archive old data" since these lines of text really make no dent in the storage, so no reason to erase data from players who have not played in a while. But that did not make a difference with this.

Any way to stop this from happening? It would be a HUGE help to us and finally solve our headache of players never having their times.

commented

Did it shot the "Removed x old storage entries from the database"? What is the exact message it's outputting?

commented

Autorank will automatically remove data from players that haven't played for a while. I have a feeling the imported data does not contain any 'age data' and hence Autorank is assuming that it is too old and deleting it.

commented

I've got this bug aswell and noticed maybe a workaround, is using MySQL (you need to setup/configure your MySQL server) and changed the "primary storage provider" to mysql and rebooted the server. Total player times are no longer reset, in my case

commented

@TNTUP Thanks for the heads-up. Using your hint I think I found the issue. If you use this version: http://staartvin.com:8080/job/Autorank/9/ and disable the archiving in the setting, it shouldn't be a problem anymore. Can you let me know if it worked?

commented

@TNTUP Thanks for the heads-up. Using your hint I think I found the issue. If you use this version: http://staartvin.com:8080/job/Autorank/9/ and disable the archiving in the setting, it shouldn't be a problem anymore. Can you let me know if it worked?

Will check! I'll edit this post after testing

Edit: It does not clear with flatfile mode. I guess the MySQL option had "automatically archive old data" which the flatfile had "automatically archive old storage" right?

commented

There was indeed a mismatch between what was in the config and what I was trying to check, and therefore it would always return 'true'.

commented

There was indeed a mismatch between what was in the config and what I was trying to check, and therefore it would always return 'true'.

Nice!! Glad we got it solved!

commented

@AntZaro Could you test this as well? I'll close the issue once it's fixed :)

commented

Same issue here, now also testing the dev build you have sent @Staartvin

commented

@sannielollie let me know how it goes!

commented

Seems to keep working now. Only getting warns about something else, should i make a separate issue for that? https://pastebin.com/Zr4aBkGD (not using AFKManager plugin, just EssentialsX)

Also, someone had to do /ar check to get ranked up, instead of that it goes automatically. Maybe related?

commented

Hmm, did you get the latest PluginLibrary version?

commented

Ah, i feel so stupid now. I was still running on version 1.2.1 - Sorry to bother you with my mistake!

It works great at first, but after some minutes the WARN is popping up again.
Not sure what is causing this to pop up. https://pastebin.com/V8tG1m9F

It also looks like the times of "today" "this week" and "this month" are resetting randomly aswell on that time. https://i.imgur.com/R9rneOA.png
When i do a full stop/start of my server the ar time are showing up again without issue for the first minute or so. After that, the issue is coming back again.

I spotted that, despite i am using MySQL all the data is stored in flatfile folders "data" and "playerdata" aswell.

Could it be that, because of that issue, the plugin "sees" players as AFK - thus not registering their playtime? Im using EssentialsX for AFK, using latest version of that (2.17.1.2)

commented

Hmm, let's investigate this further. Add me on Discord (Staartvin).

commented

That issue makes it so that time is not counted, but it shouldn't reset times.

commented

Hmm, let's investigate this further. Add me on Discord (Staartvin).

Staartvin#????

commented

You're using MySQL, but Autorank will still keep track of the local time of a player using its data and playerdata.yml files, so nothing is wrong there.

commented

Haha I think there is only one? I don't know which id

commented

I need a #number to add u on discord, u can see it on the down-left bottom of Discord :)
Need to go in a few minutes though..

commented

It's Staartvin#3286, but I can talk tomorrow if you have time :)

commented

Cool, i've sent a request under "BierfietsNL" :) will talk tomorrow to narrow down the issue!

commented

@Staartvin I will definitely test as soon as possible! It might just be a while because I'm waiting on my admin to help run our script to gather the new time data (since we last ran it back in August). He's really busy since we're approaching Christmas, but hopefully we will be able to soon.

I might try confirming for you sooner by using a test file... will let you know. Thanks for your work on this!

commented

I'm assuming this is fixed now, so I'm closing it.