Enable kicking proxy users as identified by the MaxMind GeoIP database.

This commit is contained in:
Deathmax 2011-12-18 09:16:13 +08:00
parent 05bfd62388
commit ed6aa9c07b
2 changed files with 6 additions and 0 deletions

View file

@ -726,6 +726,9 @@ namespace TShockAPI
{
var code = Geo.TryGetCountryCode(IPAddress.Parse(player.IP));
player.Country = code == null ? "N/A" : MaxMind.GeoIPCountry.GetCountryNameByCode(code);
if (code == "A1")
if (TShock.Config.KickProxyUsers)
TShock.Utils.Kick(player, "Proxies are not allowed");
Log.Info(string.Format("{0} ({1}) from '{2}' group from '{3}' joined.", player.Name, player.IP, player.Group.Name, player.Country));
TShock.Utils.Broadcast(player.Name + " is from the " + player.Country, Color.Yellow);
}