Merge pull request #1320 from DogooFalchion/fix_playerlogin

Ensure IPs are > 0 otherwise the Linq will fail.
This commit is contained in:
Lucas Nicodemus 2016-10-23 16:23:34 -06:00 committed by GitHub
commit 3fdc89a576

View file

@ -409,6 +409,8 @@ namespace TShockAPI
KnownIps = JsonConvert.DeserializeObject<List<String>>(args.Player.User.KnownIps);
}
if (KnownIps.Count > 0)
{
bool last = KnownIps.Last() == args.Player.IP;
if (!last)
{
@ -419,7 +421,7 @@ namespace TShockAPI
KnownIps.Add(args.Player.IP);
}
}
args.Player.User.KnownIps = JsonConvert.SerializeObject(KnownIps, Formatting.Indented);
Users.UpdateLogin(args.Player.User);
}