Attempting a work around for DNS host resolution. There will now be a configuration parameter that will enable the check. This is expensive, and not recommended, but a better reserved slot system will be done in the future.

Closes #254
This commit is contained in:
Lucas Nicodemus 2011-07-19 17:27:54 -06:00
parent d6c1f44219
commit 407d327236
3 changed files with 41 additions and 4 deletions

View file

@ -49,7 +49,7 @@ namespace TShockAPI
public class TShock : TerrariaPlugin
{
public static readonly Version VersionNum = Assembly.GetExecutingAssembly().GetName().Version;
public static readonly string VersionCodename = "The Deathly Database Part 2";
public static readonly string VersionCodename = "Codename: Re";
public static string SavePath = "tshock";
@ -376,8 +376,13 @@ namespace TShockAPI
private void OnJoin(int ply, HandledEventArgs handler)
{
var player = new TSPlayer(ply);
player.Group = TShock.Users.GetGroupForIP(player.IP);
if (Config.EnableDNSHostResolution)
{
player.Group = TShock.Users.GetGroupForIPExpensive(player.IP);
} else
{
player.Group = TShock.Users.GetGroupForIP(player.IP);
}
if (Tools.ActivePlayers() + 1 > TShock.Config.MaxSlots && !player.Group.HasPermission("reservedslot"))
{