diff --git a/CHANGELOG.md b/CHANGELOG.md index 091f0b92..623c2206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed a bug where /user group failing would output no error. (@nicatronTg) * Fixed a bug where /user group would fail. @(Enerdy) * Added the ability to disable backup autosave messages. (@nicatronTg) +* Fixed /buff malfunctioning when entering an invalid buff name. (@Enerdy) +* Fixed projectiles 435-438 (martian invasion) freezing everyone under certain conditions. (@Enerdy) +* DisableTombstones now works properly with the new golden gravestones. (@Enerdy) +* REST module now properly catches exceptions during Start(). (@Patrikkk) +* Added /expert command to toggle expert mode. (@WhiteXZ) ## TShock 4.3.0.0 @@ -26,4 +31,4 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed ```UseServerName``` config option so that it correctly sends the config server name any time that Main.WorldName is used. (@Olink) * Fixed a bug where people could ban themselves. (@nicatronTg) * Fixed a bug where banning a player who never logged in caused problems. (@nicatronTg) -* Terraria 1.3.0.3 support. \ No newline at end of file +* Terraria 1.3.0.3 support. diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 2f53ddac..83b19505 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2419,15 +2419,15 @@ namespace TShockAPI private static bool HandleProjectileNew(GetDataHandlerArgs args) { - var ident = args.Data.ReadInt16(); + short ident = args.Data.ReadInt16(); var pos = new Vector2(args.Data.ReadSingle(), args.Data.ReadSingle()); var vel = new Vector2(args.Data.ReadSingle(), args.Data.ReadSingle()); - var knockback = args.Data.ReadSingle(); - var dmg = args.Data.ReadInt16(); - var owner = args.Data.ReadInt8(); - var type = args.Data.ReadInt16(); - var bits = (BitsByte) args.Data.ReadInt8(); - owner = (byte)args.Player.Index; + float knockback = args.Data.ReadSingle(); + short dmg = args.Data.ReadInt16(); + byte owner = args.Data.ReadInt8(); + short type = args.Data.ReadInt16(); + BitsByte bits = args.Data.ReadInt8(); + //owner = (byte)args.Player.Index; float[] ai = new float[Projectile.maxAI]; for (int i = 0; i < Projectile.maxAI; i++) @@ -2474,7 +2474,7 @@ namespace TShockAPI bool hasPermission = !TShock.CheckProjectilePermission(args.Player, index, type); if (!TShock.Config.IgnoreProjUpdate && !hasPermission && !args.Player.Group.HasPermission(Permissions.ignoreprojectiledetection)) { - if (type == 100 || type == 164 || type == 180 || type == 261 || (type > 289 && type < 298) || (type >= 325 && type <= 328) || (type >= 345 && type <= 352)) + if (type == 100 || type == 164 || type == 180 || type == 261 || (type > 289 && type < 298) || (type >= 325 && type <= 328) || (type >= 345 && type <= 352) || (type >= 435 && type <= 438)) { TShock.Log.Debug("Certain projectiles have been ignored for cheat detection."); } diff --git a/TShockAPI/Rest/Rest.cs b/TShockAPI/Rest/Rest.cs index dd60efb5..0504c657 100644 --- a/TShockAPI/Rest/Rest.cs +++ b/TShockAPI/Rest/Rest.cs @@ -79,12 +79,20 @@ namespace Rests public virtual void Start() { - if (listener == null) + try { listener = HttpListener.Create(Ip, Port); listener.RequestReceived += OnRequest; listener.Start(int.MaxValue); } + catch (Exception ex) + { + TShock.Log.Error("Fatal Startup Exception"); + TShock.Log.Error(ex.ToString()); + TShock.Log.ConsoleError("Invalid REST configuration: \nYou may already have a REST service bound to port {0}. \nPlease adjust your configuration and restart the server. \nPress any key to exit.", Port); + Console.ReadLine(); + Environment.Exit(1); + } } public void Start(IPAddress ip, int port) diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index d0c32fca..5b496675 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -422,15 +422,18 @@ namespace TShockAPI public List GetBuffByName(string name) { string nameLower = name.ToLower(); + string buffname; for (int i = 1; i < Main.maxBuffTypes; i++) { - if (Main.buffName[i].ToLower() == nameLower) + buffname = Main.buffName[i]; + if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower() == nameLower) return new List {i}; } var found = new List(); for (int i = 1; i < Main.maxBuffTypes; i++) { - if (Main.buffName[i].ToLower().StartsWith(nameLower)) + buffname = Main.buffName[i]; + if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower().StartsWith(nameLower)) found.Add(i); } return found; diff --git a/TerrariaServerAPI b/TerrariaServerAPI index d0bd38b5..fa9e1e19 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit d0bd38b5b12a6c0cb4cc54706550e94153856ce4 +Subproject commit fa9e1e19757cde7b92c44687224f7435a8193c18