Merge pull request #1322 from NyxStudios/revert-1320-fix_playerlogin
Revert "Ensure IPs are > 0 otherwise the Linq will fail."
This commit is contained in:
commit
72ba9c2f77
1 changed files with 8 additions and 10 deletions
|
|
@ -409,19 +409,17 @@ namespace TShockAPI
|
||||||
KnownIps = JsonConvert.DeserializeObject<List<String>>(args.Player.User.KnownIps);
|
KnownIps = JsonConvert.DeserializeObject<List<String>>(args.Player.User.KnownIps);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (KnownIps.Count > 0)
|
bool last = KnownIps.Last() == args.Player.IP;
|
||||||
|
if (!last)
|
||||||
{
|
{
|
||||||
bool last = KnownIps.Last() == args.Player.IP;
|
if (KnownIps.Count == 100)
|
||||||
if (!last)
|
|
||||||
{
|
{
|
||||||
if (KnownIps.Count == 100)
|
KnownIps.RemoveAt(0);
|
||||||
{
|
|
||||||
KnownIps.RemoveAt(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
KnownIps.Add(args.Player.IP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KnownIps.Add(args.Player.IP);
|
||||||
}
|
}
|
||||||
|
|
||||||
args.Player.User.KnownIps = JsonConvert.SerializeObject(KnownIps, Formatting.Indented);
|
args.Player.User.KnownIps = JsonConvert.SerializeObject(KnownIps, Formatting.Indented);
|
||||||
Users.UpdateLogin(args.Player.User);
|
Users.UpdateLogin(args.Player.User);
|
||||||
}
|
}
|
||||||
|
|
@ -1174,7 +1172,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
if (args.Handled)
|
if (args.Handled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Config.AllowCrimsonCreep && (args.Type == TileID.Dirt || args.Type == TileID.FleshWeeds
|
if (!Config.AllowCrimsonCreep && (args.Type == TileID.Dirt || args.Type == TileID.FleshWeeds
|
||||||
|| TileID.Sets.Crimson[args.Type]))
|
|| TileID.Sets.Crimson[args.Type]))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue