コード例 #1
0
        private void IncrementPlayers()
        {
            int currentSlots = Admin.ServerInfo().MaxPlayers;

            if (currentSlots == config.maxPlayerSlots)
            {
                return;
            }

            int slotsOpen = (currentSlots - Admin.ServerInfo().Players);

            if (slotsOpen <= config.incrementSlotsOpen)
            {
                int newSlots = Math.Min(config.incrementPlayerSlots + currentSlots, config.maxPlayerSlots);

                Puts($"Incrementing player slots from `{currentSlots}` to `{newSlots}\n Queued players `{Admin.ServerInfo().Queued}`\n Joining players `{Admin.ServerInfo().Joining}`");
                UpdatePlayerLimit(newSlots);
            }
        }