Fix for potential entity flooding

On high gather rate servers, it's possible for players to generate a ton of scrap and then spam purchase items from vendors to flood the server with entities.  Even with fast despawn rates, multiple players working together can often manage to overwhelm the server and crash it.

I added a check that cancels the purchase if the player's inventory is full and blocks the purchase if so (to keep the item from spilling out onto the ground).  Modified code snippet is below

        private object OnBuyVendingItem(VendingMachine machine, BasePlayer player, int sellOrderID, int amount)
        {
            if (machine == null || player == null) return null;

            var slots = FreeSlots(player);
            if (slots < 1) return false;

            if (!permission.UserHasPermission(player.UserIDString, permUse)) return null;

            machine.ClientRPC<int>(null, "CLIENT_StartVendingSounds", sellOrderID);
            machine.DoTransaction(player, sellOrderID, amount);
            return false;
        }

        private int FreeSlots(BasePlayer player)
        {
            var slots = player.inventory.containerMain.capacity + player.inventory.containerBelt.capacity;
            var taken = player.inventory.containerMain.itemList.Count + player.inventory.containerBelt.itemList.Count;
            return slots - taken;
        }​

Wow I was just looking for this

explodedotgg,

Thank you for this report! I have taken over the maintainment of this plugin, and have released an update for this plugin. I have gone a slightly different approach than yours posted here.

I went ahead and made it so the plugin will use the default vending timer when an inventory and belt is full, and instant while not full. 

One again, thank you for the report!