Player count stuffs

This commit is contained in:
Zidonuke 2011-12-22 15:25:40 -05:00
parent 1520688256
commit fc735ba829
3 changed files with 7 additions and 5 deletions

View file

@ -245,12 +245,12 @@ namespace TShockAPI
if (code == "A1") if (code == "A1")
if (TShock.Config.KickProxyUsers) if (TShock.Config.KickProxyUsers)
TShock.Utils.Kick(args.Player, "Proxies are not allowed"); TShock.Utils.Kick(args.Player, "Proxies are not allowed");
Log.Info(string.Format("{0} ({1}) from '{2}' group from '{3}' joined.", args.Player.Name, args.Player.IP, args.Player.Group.Name, args.Player.Country)); Log.Info(string.Format("{0} ({1}) from '{2}' group from '{3}' joined. ({3}/{4})", args.Player.Name, args.Player.IP, args.Player.Group.Name, args.Player.Country, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots));
TShock.Utils.Broadcast(args.Player.Name + " has joined from the " + args.Player.Country, Color.Yellow); TShock.Utils.Broadcast(args.Player.Name + " has joined from the " + args.Player.Country, Color.Yellow);
} }
else else
{ {
Log.Info(string.Format("{0} ({1}) from '{2}' group joined.", args.Player.Name, args.Player.IP, args.Player.Group.Name)); Log.Info(string.Format("{0} ({1}) from '{2}' group joined. ({3}/{4})", args.Player.Name, args.Player.IP, args.Player.Group.Name, TShock.Utils.ActivePlayers(), TShock.Config.MaxSlots));
TShock.Utils.Broadcast(args.Player.Name + " has joined", Color.Yellow); TShock.Utils.Broadcast(args.Player.Name + " has joined", Color.Yellow);
} }

View file

@ -72,7 +72,7 @@ namespace TShockAPI
} }
else else
{ {
response = client.DownloadString("http://tshock.co/tickto.php?do=log&fp=" + fp + "&ver=" + TShock.VersionNum + "&port=" + Netplay.serverPort + "&plcount=0"); response = client.DownloadString("http://tshock.co/tickto.php?do=log&fp=" + fp + "&ver=" + TShock.VersionNum + "&port=" + Netplay.serverPort + "&plcount=" + TShock.Utils.ActivePlayers());
} }
Log.ConsoleInfo("Stat Tracker: " + response + "\n"); Log.ConsoleInfo("Stat Tracker: " + response + "\n");
} }

View file

@ -189,6 +189,7 @@ namespace TShockAPI
if (Config.EnableGeoIP && File.Exists(geoippath)) if (Config.EnableGeoIP && File.Exists(geoippath))
Geo = new MaxMind.GeoIPCountry(geoippath); Geo = new MaxMind.GeoIPCountry(geoippath);
Console.Title = string.Format("TerrariaShock Version {0} ({1})", Version, VersionCodename);
Log.ConsoleInfo(string.Format("TerrariaShock Version {0} ({1}) now running.", Version, VersionCodename)); Log.ConsoleInfo(string.Format("TerrariaShock Version {0} ({1}) now running.", Version, VersionCodename));
GameHooks.PostInitialize += OnPostInit; GameHooks.PostInitialize += OnPostInit;
@ -431,10 +432,12 @@ namespace TShockAPI
if ((DateTime.UtcNow - LastCheck).TotalSeconds >= 1) if ((DateTime.UtcNow - LastCheck).TotalSeconds >= 1)
{ {
LastCheck = DateTime.UtcNow; LastCheck = DateTime.UtcNow;
int count = 0;
foreach (TSPlayer player in Players) foreach (TSPlayer player in Players)
{ {
if (player != null && player.Active) if (player != null && player.Active)
{ {
count++;
if (player.TilesDestroyed != null) if (player.TilesDestroyed != null)
{ {
if (player.TileThreshold >= Config.TileThreshold) if (player.TileThreshold >= Config.TileThreshold)
@ -447,8 +450,6 @@ namespace TShockAPI
player.TilesDestroyed.Clear(); player.TilesDestroyed.Clear();
} }
} }
/*if (CheckPlayerCollision(player.TileX, player.TileY))
player.SendMessage("You are currently nocliping!", Color.Red);*/
if (player.ForceSpawn && (DateTime.Now - player.LastDeath).Seconds >= 3) if (player.ForceSpawn && (DateTime.Now - player.LastDeath).Seconds >= 3)
{ {
player.Spawn(); player.Spawn();
@ -456,6 +457,7 @@ namespace TShockAPI
} }
} }
} }
Console.Title = string.Format("TerrariaShock Version {0} ({1}) ({2}/{3})", Version, VersionCodename, count, Config.MaxSlots);
} }
} }