using Oxide.Core.Libraries.Covalence; using System.Collections.Generic; namespace Oxide.Plugins { [Info("Nivex Pool Reset", "nivex", "0.1.0")] [Description("Reset the List pool.")] public class NivexPoolReset : RustPlugin { private void OnServerInitialized(bool isStartup) { AddCovalenceCommand("np.reset", nameof(CommandReset)); Puts("Use 'np.reset' to reset the List pool. A plugin can instantly break it again, so you must test QUICKLY. Go to a box, run np.reset or /np.reset, ent kill the box, and loot the bag that drops from the box."); } private void CommandReset(IPlayer user, string command, string[] args) { if (!user.IsAdmin) { user.Reply("nope."); return; } var c = Facepunch.Pool.FindCollection>(); Puts("[before reset] ItemsCapacity={0} ItemsInStack={1} ItemsInUse={2} ItemsTaken={3} ItemsCreated={4} ItemsSpilled={5} MaxItemsInUse={6}", c.ItemsCapacity, c.ItemsInStack, c.ItemsInUse, c.ItemsTaken, c.ItemsCreated, c.ItemsSpilled, c.MaxItemsInUse); c.Reset(); Puts("[after reset] ItemsCapacity={0} ItemsInStack={1} ItemsInUse={2} ItemsTaken={3} ItemsCreated={4} ItemsSpilled={5} MaxItemsInUse={6}", c.ItemsCapacity, c.ItemsInStack, c.ItemsInUse, c.ItemsTaken, c.ItemsCreated, c.ItemsSpilled, c.MaxItemsInUse); user.Reply("List pool has been reset."); } } }