AutoPurge
Moved
Total Downloads: 5,818 - First Release: Dec 27, 2015 - Last Update: Sep 18, 2017
- 5/5, 34 likes
-
-
thank you
-
sorry i looked back at my post all figured
Last edited by a moderator: Jul 20, 2017 -
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();
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."); //
Last edited by a moderator: Aug 14, 2017 -
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 -
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
-
OK cool cheers @Findles
Never seen it before so was like eeeek!
-
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 aboutAnd you should maybe re-think your practices how deep you integrate not-human-players into the game-logic
-
i just used humanNPC and spawned NPC's and they were still purged... guessing HumanNPC is hacking rust then?!?
-
-
just the version on here. i don't know c# so never touch the plugin files just the .json config files.
-
Just ignore it. I think you are being trolled
-
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 -
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.
-
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 -
Fujikura updated Auto Purge with a new update entry:
1.6.1
-
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 -
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. -
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