Open Parties and Claims

Open Parties and Claims

25M Downloads

Regions of players who have not logged in for 7-14 days are not automatically deleted.

kitovoi111 opened this issue ยท 26 comments

commented

Regions of players who have not logged in for 7-14 days are not automatically deleted. I have already checked it a hundred times, after rebooting the server, the time of the regions is reset to zero and starts again. About 60 days of real time have passed and not a single region has been deleted.

commented

Can you send me the default player config?

commented

Forge 1.19.2
Mod version: open-parties-and-claims-forge-1.19.2-0.22.0.jar

commented

Seems like you are on 0.22.0. So strange. I swear this feature will never work. I've fixed it like 20 times now and it works for me but there's always something else happening on an actual server.

commented

Why do you think this?

after rebooting the server, the time of the regions is reset to zero and starts again

commented

I asked a coder I knew, he looked at your code and said you did something wrong over time. Look at the code for deleting regions in the Flan (Forge) 1.19.2 mod

commented

https://legacy.curseforge.com/minecraft/mc-mods/flan-forge This mod also includes the removal of inactive regions, where it works on the server side - correctly.

commented

I have absolutely no reason to look at Flan's code, thanks. That's not how bugs work.

image

commented

I have absolutely no reason to look at Flan's code, thanks. That's not how bugs work.

commented

As I understand it, regions are not deleted if the server is rebooted or fails; the time of the regions in your mod starts counting from the start of the server from scratch. You also need to check that it is the owner of the region who is offline, so that the region is deleted and considered inactive, and not the participants of the region.

commented

Maybe this will help you

commented

They're saying it looks like it should work and not reset. I know it doesn't reset.
It measures server uptime and saves it to server-info.nbt, then loads that value on next server launch and continues measuring the time from that point.
The issue that caused this in the past had to do with the mod considering all claims "active" on restart for offline players, which is now fixed.
Send me the data/openpartiesandclaims/server-info.nbt file and a claim file that should be expired. You'll have to figure out the player's UUID.

commented

Also, is the server running 24/7? If not, then it's probably not bugged.

commented

Crashing and restarts are fine.

commented

Also, is the server running 24/7? If not, then it's probably not bugged.

but every 6 hours the server reboots and sometimes crashes.

commented

The server works 24/7, uptime: 100%, but every 6 hours the server reboots for about 1-2 minutes and continues to work.

commented

I don't know the application number that should expire, I have 500+ active players and I don't know which player hasn't logged in for more than 14-30 days.

commented

The server info file shows that the server has been running with the mod for only 100 hours in total. Have you ever removed this file? Is there a backup of server-info.nbt in the same folder?

commented

I never deleted or made copies.

commented

I'm not asking if you made copies. Please check if there are backup files there. The mod automatically creates them when the file is corrupt. This would explain why the time reset, if it did.

commented

Ok, I just realized what might be wrong for you. You have it configured to "check for expirations" every 6 hours.

playerClaimsExpirationCheckInterval = 360

Your server restarts before it reaches that point. But still, the mod has only been used on the server for 100 hours, according to the server info file, which is less than the 2 weeks expiration time.

commented

This is actually a big problem. It's a good thing that the time hasn't gone above 2 weeks yet, I think the mod hasn't ever confirmed any claim owners to be active because it never got to 6 hours. Every claim was probably last confirmed to be active at time 0 because of this. This means that if the time was actually above 2 weeks at this point, it would just expire ALL claims after I fix the issue. I'll have to be careful about how I fix this for other similar servers.

commented

You can try reducing the time to minutes rather than hours, this will make it easier to check the removal of regions. Let's say we set: expired_time: 5 min and at this time we restart the server 1-2 times and check whether, in general, from creating a time region, the region will be deleted if the player does not log in for 5 minutes.

commented

The 6 hour thing is configurable, it's not set in stone. I'm probably going to fix the problem by making the mod always run an expiration check on server start.