From 0241c8b56f13f3d5c6a9eb054a3a4e2bac191066 Mon Sep 17 00:00:00 2001 From: Shank Date: Wed, 8 Jun 2011 01:39:15 -0600 Subject: [PATCH 1/7] Fixing exploits. --- TShockAPI/TShock.cs | 6 +++--- Update/Program.cs | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 3872dba3..c3ac3b4d 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -16,7 +16,7 @@ namespace TShockAPI public static string saveDir = "./tshock/"; - public static Version VersionNum = new Version(1, 9, 0, 1); + public static Version VersionNum = new Version(2, 0, 0, 0); public static string VersionCodename = "SPACEEE"; @@ -335,7 +335,7 @@ namespace TShockAPI { using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) { - byte ply = br.ReadByte(); + int ply = e.Msg.whoAmI; short life = br.ReadInt16(); short maxLife = br.ReadInt16(); @@ -356,7 +356,7 @@ namespace TShockAPI { using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) { - byte ply = br.ReadByte(); + int ply = e.Msg.whoAmI; short mana = br.ReadInt16(); short maxmana = br.ReadInt16(); diff --git a/Update/Program.cs b/Update/Program.cs index f1aef4c0..74b8a367 100644 --- a/Update/Program.cs +++ b/Update/Program.cs @@ -19,7 +19,6 @@ namespace Update StreamReader sr = new StreamReader("pn"); procname = sr.ReadToEnd(); sr.Close(); - string[] datat = procname.Split(' '); procname = datat[0]; procargs = ""; From 14ec2634fa531509890ab6585d68c427a74b498e Mon Sep 17 00:00:00 2001 From: Shank Date: Wed, 8 Jun 2011 02:36:08 -0600 Subject: [PATCH 2/7] Updated to 2.0.0.0 --- Update/Resources.Designer.cs | 2 +- Update/Resources.resx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Update/Resources.Designer.cs b/Update/Resources.Designer.cs index 027612f0..35d6a914 100644 --- a/Update/Resources.Designer.cs +++ b/Update/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.225 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Update/Resources.resx b/Update/Resources.resx index fd37f4ea..b1ad6d77 100644 --- a/Update/Resources.resx +++ b/Update/Resources.resx @@ -119,6 +119,6 @@ - ..\TShockAPI\bin\Release\TShockAPI.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Resources\TShockAPI.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file From 673359653fc59457ae3d22dbfd5ecb2d2093e53d Mon Sep 17 00:00:00 2001 From: ricky Date: Wed, 8 Jun 2011 18:46:01 +1000 Subject: [PATCH 3/7] Kick for using Dirt Rod now checks if player is imure to kicking Remove nades and added sticky bombs for explosives thrown check --- TShockAPI/TShock.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 46a27eb1..046871b3 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -387,7 +387,7 @@ namespace TShockAPI byte owner = br.ReadByte(); byte type = br.ReadByte(); - if (type == 29 || type == 28 || type == 30) + if (type == 29 || type == 28 || type == 37) { return Tools.HandleExplosivesUser(e.Msg.whoAmI, "Throwing an explosive device."); } @@ -436,8 +436,7 @@ namespace TShockAPI if (Main.player[e.Msg.whoAmI].selectedItem == 0x72) //Dirt Rod { - Tools.ForceKick(e.Msg.whoAmI, "Using dirt rod"); - return true; + return Tools.Kick(e.Msg.whoAmI, "Using dirt rod"); } int plyX = Math.Abs((int)Main.player[e.Msg.whoAmI].position.X / 16); From efa9bfc86c661633b0bec4ce8027a5f12a34b2e2 Mon Sep 17 00:00:00 2001 From: Shank Date: Wed, 8 Jun 2011 02:51:23 -0600 Subject: [PATCH 4/7] Removed life/mana increase check --- TShockAPI/TShock.cs | 46 ++------------------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 46a27eb1..0a78a7f9 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -16,9 +16,9 @@ namespace TShockAPI public static string saveDir = "./tshock/"; - public static Version VersionNum = new Version(2, 0, 0, 0); + public static Version VersionNum = new Version(2, 0, 0, 1); - public static string VersionCodename = "SPACEEE"; + public static string VersionCodename = "UnrealIRCd ftw (irc.shankshock.com #terraria)"; public static bool shownVersion; @@ -331,48 +331,6 @@ namespace TShockAPI return Tools.HandleGriefer(e.Msg.whoAmI, "Update Player abuse"); } } - else if (e.MsgID == 0x10) - { - using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) - { - int ply = e.Msg.whoAmI; - short life = br.ReadInt16(); - short maxLife = br.ReadInt16(); - - if (maxLife > Main.player[ply].statLifeMax + 20 || life > maxLife) - { - if (players[ply].syncHP) - { - return Tools.HandleCheater(ply, "Abnormal life increase"); - } - else - { - players[ply].syncHP = true; - } - } - } - } - else if (e.MsgID == 0x2a) - { - using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) - { - int ply = e.Msg.whoAmI; - short mana = br.ReadInt16(); - short maxmana = br.ReadInt16(); - - if (maxmana > Main.player[ply].statManaMax + 20 || mana > maxmana) - { - if (players[ply].syncMP) - { - return Tools.HandleCheater(ply, "Abnormal mana increase"); - } - else - { - players[ply].syncMP = true; - } - } - } - } else if (e.MsgID == 0x1B) // New Projectile { using (var br = new BinaryReader(new MemoryStream(e.Msg.readBuffer, e.Index, e.Length))) From 1d45cc671d229c76babecb155ca2c56b22d1bad5 Mon Sep 17 00:00:00 2001 From: Shank Date: Wed, 8 Jun 2011 03:04:00 -0600 Subject: [PATCH 5/7] Updated release notes. --- Update/Update.csproj | 3 ++- release-docs/changes.txt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Update/Update.csproj b/Update/Update.csproj index 36027cc3..f37c3dee 100644 --- a/Update/Update.csproj +++ b/Update/Update.csproj @@ -59,8 +59,9 @@ Designer + - +