Aura.Channel.ChannelServer.CalculateChannelState C# (CSharp) Метод

CalculateChannelState() публичный Метод

Calculates the state of the channel.
When calculating the ChannelState we take into account whether the server is running as well as if it is in Maintenance.
public CalculateChannelState ( ) : ChannelState
Результат ChannelState
		public ChannelState CalculateChannelState()
		{
			// Just in case this gets called
			if (this.ShuttingDown)
				return ChannelState.Maintenance;

			var current = this.World.CountPlayers();
			var max = this.Conf.Channel.MaxUsers;

			if (max == 0)
			{
				Log.Warning("Max user count was zero, falling back to Normal.");

				// Fallback value
				return ChannelState.Normal;
			}

			double stress = (current / max) * 100;

			if (stress >= 40 && stress <= 70)
				return ChannelState.Busy;
			if (stress > 70 && stress <= 95)
				return ChannelState.Full;
			if (stress > 95)
				return ChannelState.Bursting;

			return ChannelState.Normal;
		}