void OnServerInitialized() { _originalLimit = Admin.ServerInfo().MaxPlayers; int startPlayerLimit = Math.Max(Admin.ServerInfo().Players, config.startPlayerSlots); UpdatePlayerLimit(startPlayerLimit); timer.Every(config.incrementInterval * 60, () => IncrementPlayers()); }
private string CanClientLogin(Network.Connection connection) { if (permission.UserHasPermission(connection.userid.ToString(), Perm)) { return(null); } if (Admin.ServerInfo().Queued >= Limit) { return(lang.GetMessage("KickMessage", this, connection.userid.ToString())); } return(null); }
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); } }
private object CanClientLogin(Connection connection) { if (connection.authLevel >= config.ignoreWithAuthlevel) { return(true); } string userId = connection.userid.ToString(); if (config.enableQueueCapacity) { if (UserHasAnyPermission(userId, config.permsAffectedByQueueCapacity)) { if (Admin.ServerInfo().Queued >= config.queueCapacity) { return(lang.GetMessage("CapacityReached", this, userId)); } } return(true); } return(true); }