Revert "Remove Utils.ActivePlayers"

This reverts commit b613fdcda6.
This commit is contained in:
Lucas Nicodemus 2017-12-31 01:28:21 -07:00
parent cb2ed84038
commit a5cad284a8
6 changed files with 19 additions and 11 deletions

View file

@ -1241,7 +1241,7 @@ namespace TShockAPI
var player = new TSPlayer(args.Who);
if (TShock.Players.Length + 1 > Config.MaxSlots + Config.ReservedSlots)
if (Utils.ActivePlayers() + 1 > Config.MaxSlots + Config.ReservedSlots)
{
player.Kick(Config.ServerFullNoReservedReason, true, true, null, false);
args.Handled = true;
@ -1400,7 +1400,7 @@ namespace TShockAPI
}
// The last player will leave after this hook is executed.
if (TShock.Players.Length == 1)
if (Utils.ActivePlayers() == 1)
{
if (Config.SaveWorldOnLastPlayerExit)
SaveManager.Instance.SaveWorld();
@ -1621,7 +1621,7 @@ namespace TShockAPI
if (Config.EnableGeoIP && TShock.Geo != null)
{
Log.Info("{0} ({1}) from '{2}' group from '{3}' joined. ({4}/{5})", player.Name, player.IP,
player.Group.Name, player.Country, TShock.Players.Length,
player.Group.Name, player.Country, TShock.Utils.ActivePlayers(),
TShock.Config.MaxSlots);
if (!player.SilentJoinInProgress)
Utils.Broadcast(string.Format("{0} ({1}) has joined.", player.Name, player.Country), Color.Yellow);
@ -1629,7 +1629,7 @@ namespace TShockAPI
else
{
Log.Info("{0} ({1}) from '{2}' group joined. ({3}/{4})", player.Name, player.IP,
player.Group.Name, TShock.Players.Length, TShock.Config.MaxSlots);
player.Group.Name, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots);
if (!player.SilentJoinInProgress)
Utils.Broadcast(player.Name + " has joined.", Color.Yellow);
}