Player auto purged while onlineSolved
Since the plugin acts weird i had to test it.
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)
Ok i just found out there is no "Last Seen Timer Frequency" anymore. And no function that saves Last-Seen-Times frequently.
Since you only update the Last-Seen Timestamp on connect/disconnect (and plugin.load()) my 2minute lifetime caused that trouble.

I still wonder why you removed the frequent update of last seen.
I mean the life-purge can happen when the lifetime is shorter than a person decides to be online non-stop :o
Hey, it was indeed removed because usually noone has lifetime that short but I will consider adding it again or updating at a specific minimum frequency, for example for all online players right before the purge - would work! :)

Thanks for the other reports, I will fix them as well as soon as possible.
5b6ed4c9ac8e4.jpg misticos
Hey, it was indeed removed because usually noone has lifetime that short but I will consider adding it again or updating at a specific minimum frequency, for example for all online players right before the purge - would work! :)

Thanks for the other reports, I will fix them as well as soon as possible.

Thanks for the fast answer!
Dont forget the log :DD

I'll release the update today.

Merged post

well 23 hours ago i still have time xd
Locked automatically