AutoPurge

Moved

Total Downloads: 5,818 - First Release: Dec 27, 2015 - Last Update: Sep 18, 2017

5/5, 34 likes
  1. wow, new version is working !! :)
     
  2. Well then :p
     
  3. thank you :)
     
  4. sorry i looked back at my post all figured :)
     
    Last edited by a moderator: Jul 20, 2017
  5. Had an idea today! Dynamic Auto Purge.. Purge is meant to help keep the server entity count reasonable. Lets say my inactive timer is set for 3 days. What if the entity count is within an acceptable range? No reason to purge at 3 days.. maybe purge at 7 instead.
    The code I wrote is dirty. I should be storing this stuff in the config file, I know but since its custom code it's easier to do it this way in the event there is an update to the plugin. Would be cool to have this feature pushed into the official version. Multiple ways to implement the idea. Even a simple if entity count > x then purge after y days would be fine instead of dynamic.

    After the line:
    Code:
                var entityCount = BaseNetworkable.serverEntities.Where(p => (p as BaseEntity).OwnerID > 0 uL).ToList().Count();
    Add the following:
    Code:
                //
                //DynamicAutoPurge. Purge less often when server entity count low. Config setting for inactiveAfter is essentially ignored.
                //
                int entityNextLimit = 0, entityCountLow = 0, entityCountGuarded = 60000, entityCountElevated = 80000, entityCountHigh = 100000, entityCountExtreme = 110000;
                int inactiveAfterLow = 604800, inactiveAfterGuarded = 518400, inactiveAfterElevated = 432000, inactiveAfterHigh = 345600, inactiveAfterExtreme = 259200;
                if (entityCount >= entityCountLow && entityCount < entityCountGuarded)
                {
                    inactiveAfter = inactiveAfterLow;
                    entityNextLimit = entityCountGuarded;
                }
                else if (entityCount >= entityCountGuarded && entityCount < entityCountElevated)
                {
                    inactiveAfter = inactiveAfterGuarded;
                    entityNextLimit = entityCountElevated;
                }
                else if (entityCount >= entityCountElevated && entityCount < entityCountHigh)
                {
                    inactiveAfter = inactiveAfterElevated;
                    entityNextLimit = entityCountHigh;
                }
                else if (entityCount >= entityCountHigh && entityCount < entityCountExtreme)
                {
                    inactiveAfter = inactiveAfterHigh;
                    entityNextLimit = entityCountExtreme;
                }
                else if (entityCount >= entityCountExtreme)
                {
                    inactiveAfter = inactiveAfterExtreme;
                    entityNextLimit = entityCountExtreme;
                }
                inactiveAfterDays = inactiveAfter / 86400;
                PrintToChat("[DynamicAutoPurge by EffigyLTD] EntityCount: " + entityCount + ". AutoPurge adjusted to purge an inactive player after " + inactiveAfterDays + " days. Next adjustment will be made at " + entityNextLimit + "entities.");
                Puts("[[DynamicAutoPurge by EffigyLTD] Server entity count: " + entityCount + ". AutoPurge adjusted to purge an inactive player after " + inactiveAfterDays + " days. Next adjustment will be made at " + entityNextLimit + "entities.");
                //
    [DOUBLEPOST=1502687664][/DOUBLEPOST] upload_2017-8-14_1-14-24.png
     
    Last edited by a moderator: Aug 14, 2017
  6. I had a purge run today which included NPC's! Is there anyway these can be ignored:

    (06:00:58) | [AutoPurge] Running RealTimer purge (06:00)
    (06:00:58) | [AutoPurge] Included entity count on this run: 39367
    (06:00:59) | [AutoPurge] Removing: 262 entities from: 15 inactive players
    (06:00:59) | [AutoPurge] Affected IDs: I'm pretty much paszaBiceps(xxxx) BesterCZ(xxxxx) Harley(xxxxxx) [MiaK] J2414(xxxxx) baggybailey(xxxxxx) RS Components(715678399) KFC Cashier(1518045355) Timbersource Cashier(1195089926) Next Cashier(910630237) Total Fuel Cashier(708461999) Travis Perkins Cashier(470917874) Kiwi(xxxxxx) Lee FX(xxxxxx) SNOGGERTS(xxxxxx) Matas.(xxxxxxx)
    (06:00:59) | Calling 'OnTick' on 'AutoPurge v1.6.0' took 716ms

    The ones shown above without (xxxx) and in bold are the bots
     
  7. I don't think that's anything to worry about. I've seen it once or maybe once a wipe and never had it cause issues. That's just been my experience
     
  8. OK cool cheers @Findles :D Never seen it before so was like eeeek!
     
  9. The plugin does only include objects which have an OwnerID set. Which is usually only the case of objects being placed by real players.
    Secondly, the plugin does only purge objects of "players" who exist in the internal PlayerInfo.

    Into these get added only players existing in the activePlayerList, the sleepingPlayerList. And by the hooks "OnPlayerInit" and "OnPlayerDisconnected".
    In all normal cases any NPC can't get added there unless you did hack them into the game to be handled like normal players.

    In that case you must not wonder about ;) And you should maybe re-think your practices how deep you integrate not-human-players into the game-logic :p
     
  10. i just used humanNPC and spawned NPC's and they were still purged... guessing HumanNPC is hacking rust then?!?
     
  11. Sure you use an unmodified original plugin version of HumanNPC??? Cuase it does not like adding NPC's to the players lists.
     
  12. just the version on here. i don't know c# so never touch the plugin files just the .json config files.
     
  13. Just ignore it. I think you are being trolled
     
  14. I can tell you only the technical facts. And these are like already described above. In the past i had many people posting me errors over several plugins, which were related always to invalid player objects...Mainly any type of created "NPC" being involved in player actions which they were not meant to bue used for.
    And owners trying to stay hard on the fact they did not do anything in this direction ;)

    In the most cases i'm sure i was right on my thoughts about uncommon npc integration into game player lists and hooks, cause many of those cases did stay unresolved or unanswered to me..Only with the hint they were able to resolve it ;)
    Tells me afterwards a lot about the "real" reasons :p
     
  15. I have the problem of entities being destroyed of a player even when they are part of an active clan. I am using clans REBORN.
     
  16. Looks like it stopped logging purges or purging since update day. Looks like it stopped purging too even though it appears to still be logging peoples play time.
     
    Last edited by a moderator: Sep 18, 2017
  17. Fujikura updated Auto Purge with a new update entry:

    1.6.1

     
  18. I seen an autopurge, with NPC's involved from the RCON. I already know that someone else has had this issue, and I'm just seeing it tonight. Although whether it does damage or not. I would like to see an option in future updates to ignore NPC's, just to have piece of mind of knowing that the NPC's will not be purged, even if they really aren't anyways. :)

    Thanks
     
  19. The plugin does only check players from the activeplayer or sleepers list.
    In case of any type of NPC on your server is in those lists at any time ,then its definitely time to overhaul your NPC functions ;)
    On these lists must have only one type stored: (real)Players.
     
  20. Ok, I get the check for "real players" only could be the only check you have place in the code. But shit happens, game changes, messes with plugins code. You know this, and I know this.

    I don't believe any setting that I have or not for the NPC's causes autopurge to think the NPC's are real players, because they just stand there. No settings except for what is set by default from HumanNPC when I spawn them in. I have used these 2 plugins together for over a year and NO issue until recently.

    Please take the time to make sure its not the plugins issue. Don't just tell me and others, Its our settings, functions.
     
    Last edited by a moderator: Sep 25, 2017