Since the plugin acts weird i had to test it.
So this is my config:
Since i want to "Purge Sleepers" it tried to purge me aswell, even when i am online.
This is the result in the console:

I dont know why the UserIDString is empty in so much cases but all ends with an exception when it tries to kill myself.
I cannot not move or do anything else after this error.
When i reconnect everything is gone and i was obviously killed.
So in my eyes there are different errors here:
-The "Last Seen Timer Frequency" does not work as intended. Maybe it did not update the "Last Seen Time" correctly even when i am online.
-If the Last Seen Timer was correct, the calculation of CanPurge() is wrong, since i was obviously not offline for more than 2minutes.
-The purge-function purges even entities that are connected to a valid UserIDString
-The purge of an online user results in 1xServer Exception, 1 NullReferenceException and the player needs to reconnect (because he is dead to the server)
So this is my config:
{
"Purge Settings": [
{
"Permission": "autopurge.PurgeMeIn2Minutes",
"Lifetime": "2m"
}
],
"Purge Timer Frequency": 120.0,
"Last Seen Timer Frequency": 60.0,
"Purge Sleepers": true,
"Debug": true
}So i wanted to be purged 2min after the last seen.
I put a 60sec Last Seen Timer Frequency so it would not produce overlap bugs.
Since we still dont have Logs i added simple Puts()-Line in your function to see if the killed entity is connected to valid UserIDString.
if (CanPurge(entity as DecayEntity) ||
_config.PurgeSleepers && CanPurgeUser((entity as BasePlayer)?.UserIDString))
{
userIDString = (entity as BasePlayer)?.UserIDString;
Puts($"Purging (entity as BasePlayer)?.UserIDString = '" + userIDString + "'");
entity.Kill();
purged++;
}After few seconds of building the plugin decided to purge my house life. I was able to see the foundations disappearing 1 by 1.Since i want to "Purge Sleepers" it tried to purge me aswell, even when i am online.
This is the result in the console:

I dont know why the UserIDString is empty in so much cases but all ends with an exception when it tries to kill myself.
I cannot not move or do anything else after this error.
When i reconnect everything is gone and i was obviously killed.
So in my eyes there are different errors here:
-The "Last Seen Timer Frequency" does not work as intended. Maybe it did not update the "Last Seen Time" correctly even when i am online.
-If the Last Seen Timer was correct, the calculation of CanPurge() is wrong, since i was obviously not offline for more than 2minutes.
-The purge-function purges even entities that are connected to a valid UserIDString
-The purge of an online user results in 1xServer Exception, 1 NullReferenceException and the player needs to reconnect (because he is dead to the server)