diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index 711851c6..9e114ef8 100755 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -53,5 +53,5 @@ using System.Runtime.InteropServices; // Also, be sure to release on github with the exact assembly version tag as below // so that the update manager works correctly (via the Github releases api and mimic) -[assembly: AssemblyVersion("4.2.9")] -[assembly: AssemblyFileVersion("4.2.9")] +[assembly: AssemblyVersion("4.2.10")] +[assembly: AssemblyFileVersion("4.2.10")] diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 24d2b82a..6ba0251e 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -35,6 +35,7 @@ using Rests; using Terraria; using TerrariaApi.Server; using TShockAPI.DB; +using TShockAPI.Hooks; using TShockAPI.Net; using TShockAPI.ServerSideCharacters; @@ -322,7 +323,7 @@ namespace TShockAPI ServerApi.Hooks.WorldChristmasCheck.Deregister(this, OnXmasCheck); ServerApi.Hooks.WorldHalloweenCheck.Deregister(this, OnHalloweenCheck); ServerApi.Hooks.NetNameCollision.Deregister(this, NetHooks_NameCollision); - TShockAPI.Hooks.PlayerHooks.PlayerPostLogin -= OnPlayerLogin; + TShockAPI.Hooks.PlayerHooks.PlayerPostLogin -= OnPlayerLogin; if (File.Exists(Path.Combine(SavePath, "tshock.pid"))) { @@ -335,29 +336,29 @@ namespace TShockAPI base.Dispose(disposing); } - private void OnPlayerLogin(Hooks.PlayerPostLoginEventArgs args) - { - User u = Users.GetUserByName(args.Player.UserAccountName); - List KnownIps = new List(); - if (!string.IsNullOrWhiteSpace(u.KnownIps)) - { - KnownIps = JsonConvert.DeserializeObject>(u.KnownIps); - } + private void OnPlayerLogin(Hooks.PlayerPostLoginEventArgs args) + { + User u = Users.GetUserByName(args.Player.UserAccountName); + List KnownIps = new List(); + if (!string.IsNullOrWhiteSpace(u.KnownIps)) + { + KnownIps = JsonConvert.DeserializeObject>(u.KnownIps); + } - bool found = KnownIps.Any(s => s.Equals(args.Player.IP)); - if (!found) - { - if (KnownIps.Count == 100) - { - KnownIps.RemoveAt(0); - } + bool found = KnownIps.Any(s => s.Equals(args.Player.IP)); + if (!found) + { + if (KnownIps.Count == 100) + { + KnownIps.RemoveAt(0); + } - KnownIps.Add(args.Player.IP); - } + KnownIps.Add(args.Player.IP); + } - u.KnownIps = JsonConvert.SerializeObject(KnownIps, Formatting.Indented); - Users.UpdateLogin(u); - } + u.KnownIps = JsonConvert.SerializeObject(KnownIps, Formatting.Indented); + Users.UpdateLogin(u); + } private void OnAccountDelete(Hooks.AccountDeleteEventArgs args) {