From 528d9c642b08584bbeec4d1e84e992e8d0d003f8 Mon Sep 17 00:00:00 2001 From: White Date: Wed, 3 May 2017 21:49:19 +0930 Subject: [PATCH 1/9] Fixes a Non-SSC chat over heads bug. Should solve #1436 --- TShockAPI/TShock.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 45aa012e7..958f067c4 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1502,23 +1502,31 @@ private void OnChat(ServerChatEventArgs args) Player ply = Main.player[args.Who]; string name = ply.name; ply.name = String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix); + //Update the player's name to format text nicely. This needs to be done because Terraria automatically formats messages against our will NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, NetworkText.FromLiteral(ply.name), args.Who, 0, 0, 0, 0); + + //Give that poor player their name back :'c ply.name = name; - Hooks.PlayerHooks.OnPlayerChat(tsplr, args.Text, ref text); + PlayerHooks.OnPlayerChat(tsplr, args.Text, ref text); + //This netpacket is used to send chat text from the server to clients, in this case on behalf of a client Terraria.Net.NetPacket packet = Terraria.GameContent.NetModules.NetTextModule.SerializeServerMessage( NetworkText.FromLiteral(text), new Color(tsplr.Group.R, tsplr.Group.G, tsplr.Group.B), (byte)args.Who ); - Terraria.Net.NetManager.Instance.Broadcast(packet); + //Broadcast to everyone except the player who sent the message. + //This is so that we can send them the same nicely formatted message that everyone else gets + Terraria.Net.NetManager.Instance.Broadcast(packet, args.Who); + //Reset their name NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, -1, NetworkText.FromLiteral(name), args.Who, 0, 0, 0, 0); string msg = String.Format("<{0}> {1}", String.Format(Config.ChatAboveHeadsFormat, tsplr.Group.Name, tsplr.Group.Prefix, tsplr.Name, tsplr.Group.Suffix), - text); - - //tsplr.SendMessage(msg, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B); + text + ); + //Send the original sender their nicely formatted message, and do all the loggy things + tsplr.SendMessage(msg, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B); TSPlayer.Server.SendMessage(msg, tsplr.Group.R, tsplr.Group.G, tsplr.Group.B); Log.Info("Broadcast: {0}", msg); args.Handled = true; From ee7a1bb2be9b7ab09a8e66f6612e9e9580535037 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Mon, 8 May 2017 18:20:06 -0600 Subject: [PATCH 2/9] Add a comma --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4548076a9..9fa0710d6 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Feeling like helping out? Want to find an awesome server? Some awesome plugins? > By participating in the TShock for Terraria community, all members will adhere to maintaining decorum with respect to all humans, in and out of the community. Members will not engage in discussion that inappropriately disparages or marginalizes any group of people or any individual. Members will not attempt to further or advance an agenda to the point of being overbearing or close minded (such as through spreading FUD). Members will not abuse services provided to them and will follow the guidance of community leaders on a situational basis about what abuse consists of. Members will adhere to United States and international law. If members notice a violation of this code of conduct, they will not engage but will instead contact the leadership team on either the forums or Discord. -> Do not attempt to circumvent or bypass the code of conduct by using clever logic or reasoning (e.g. insulting Facepunch members, because they weren't directly mentioned here). +> Do not attempt to circumvent or bypass the code of conduct by using clever logic or reasoning (e.g., insulting Facepunch members, because they weren't directly mentioned here). Please see the contributing file before sending pull requests. From 02a8e037ba467bee9fd30e42089a675ca3b9f5bc Mon Sep 17 00:00:00 2001 From: White Date: Thu, 11 May 2017 19:05:29 +0930 Subject: [PATCH 3/9] Submodule update to revert recursive resolver --- TerrariaServerAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerrariaServerAPI b/TerrariaServerAPI index 285b4ad65..c22ec39f7 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit 285b4ad65a39de545043ae5b2b9e742906b9a2b3 +Subproject commit c22ec39f707f32e19fd59f685d59a79be8d12b5a From 194522eaa04a013594acae5eaa57c575830ff5e9 Mon Sep 17 00:00:00 2001 From: MadMan2021 Date: Thu, 11 May 2017 23:27:56 +0100 Subject: [PATCH 4/9] Increased /butcher damage to defence fixes issue #1447 --- TShockAPI/Commands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index cd90f8e6f..ee9106fc9 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -5207,7 +5207,7 @@ private static void Butcher(CommandArgs args) { if (Main.npc[i].active && ((npcId == 0 && !Main.npc[i].townNPC && Main.npc[i].netID != NPCID.TargetDummy) || Main.npc[i].netID == npcId)) { - TSPlayer.Server.StrikeNPC(i, (int)(Main.npc[i].life + (Main.npc[i].defense * 0.5)), 0, 0); + TSPlayer.Server.StrikeNPC(i, (int)(Main.npc[i].life + (Main.npc[i].defense * 0.6)), 0, 0); kills++; } } From 8116aebd2cfb7aa6e5010b4b9c685d0b38527fe2 Mon Sep 17 00:00:00 2001 From: ZIT WANG Date: Fri, 12 May 2017 18:06:49 +0800 Subject: [PATCH 5/9] Fix itemban not working on non-English language --- TShockAPI/GetDataHandlers.cs | 4 ++-- TShockAPI/TShock.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index fb5bea277..0bb216e14 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2151,7 +2151,7 @@ private static bool HandleTile(GetDataHandlerArgs args) args.Player.SendErrorMessage("You do not have permission to place actuators."); return true; } - if (TShock.Itembans.ItemIsBanned(selectedItem.Name, args.Player) || editData >= (action == EditAction.PlaceTile ? Main.maxTileSets : Main.maxWallTypes)) + if (TShock.Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(selectedItem.netID), args.Player) || editData >= (action == EditAction.PlaceTile ? Main.maxTileSets : Main.maxWallTypes)) { args.Player.SendTileSquare(tileX, tileY, 4); return true; @@ -2611,7 +2611,7 @@ private static bool HandlePlayerUpdate(GetDataHandlerArgs args) if (control[5]) { string itemName = args.TPlayer.inventory[item].Name; - if (TShock.Itembans.ItemIsBanned(itemName, args.Player)) + if (TShock.Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(args.TPlayer.inventory[item].netID), args.Player)) { control[5] = false; args.Player.Disable("using a banned item ({0})".SFormat(itemName), DisableFlags.WriteToLogAndConsole); diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 958f067c4..0d1c2bc71 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1084,7 +1084,7 @@ private void OnSecondUpdate() { player.Disable(flags: flags); } - else if (Itembans.ItemIsBanned(player.TPlayer.inventory[player.TPlayer.selectedItem].Name, player)) + else if (Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(player.TPlayer.inventory[player.TPlayer.selectedItem].netID), player)) { player.Disable($"holding banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}", flags); player.SendErrorMessage($"You are holding a banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}"); @@ -1164,7 +1164,7 @@ private void OnSecondUpdate() { player.Disable(flags: flags); } - else if (Itembans.ItemIsBanned(player.TPlayer.inventory[player.TPlayer.selectedItem].Name, player)) + else if (Itembans.ItemIsBanned(EnglishLanguage.GetItemNameById(player.TPlayer.inventory[player.TPlayer.selectedItem].netID), player)) { player.Disable($"holding banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}", flags); player.SendErrorMessage($"You are holding a banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].Name}"); From 492bb3ec2d1f706a9e6546fe756e05e1efdfab93 Mon Sep 17 00:00:00 2001 From: Tyler Watson Date: Sun, 14 May 2017 21:08:57 +1000 Subject: [PATCH 6/9] create_release script now compatible with mono 5 --- scripts/create_release.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/create_release.py b/scripts/create_release.py index 3d86912d0..3a25f76d7 100755 --- a/scripts/create_release.py +++ b/scripts/create_release.py @@ -36,7 +36,7 @@ json_bin_name = "Newtonsoft.Json.dll" http_bin_name = "HttpServer.dll" tshock_bin_name = "TShockAPI.dll" -tshock_symbols = "TShockAPI.dll.mdb" +tshock_symbols = "TShockAPI.pdb" bcrypt_bin_name = "BCrypt.Net.dll" geoip_db_name = "GeoIP.dat" @@ -140,6 +140,7 @@ def upload_artifacts(): def update_terraria_source(): subprocess.check_call(['/usr/bin/git', 'submodule', 'init']) subprocess.check_call(['/usr/bin/git', 'submodule', 'update']) + subprocess.check_call(['nuget', 'restore']) subprocess.check_call(['nuget', 'restore', 'TerrariaServerAPI/']) def run_bootstrapper(): From 7e80a6dc4eda23a07a64bc99bf904320a44fdf89 Mon Sep 17 00:00:00 2001 From: Tyler Watson Date: Sun, 14 May 2017 21:12:55 +1000 Subject: [PATCH 7/9] Submodule update for ILRepack.Lib 2.0.13 --- TerrariaServerAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerrariaServerAPI b/TerrariaServerAPI index c22ec39f7..a9d1b0e4e 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit c22ec39f707f32e19fd59f685d59a79be8d12b5a +Subproject commit a9d1b0e4e096ecbd0b2033ce4ff636759c9448c3 From 709328d61f1265f147ed0857866b56852131a9d1 Mon Sep 17 00:00:00 2001 From: White Date: Sun, 14 May 2017 21:28:02 +0930 Subject: [PATCH 8/9] Update CHANGELOG.md --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15f32ab5e..aa42a2aa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,13 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Updated OpenTerraria API to 1.3.5.3 (@DeathCradle) * Updated Terraria Server API to 1.3.5.3 (@WhiteXZ, @hakusaro) * Updated TShock core components to 1.3.5.3 (@hakusaro) -* Terraria Server API version tick: 2.2 +* Terraria Server API version tick: 2.1 * Added OnNpcKilled hook to Server API: 2.2 (@tylerjwatson) +* Added CreateCombatTextExtended to PacketTypes. This packet allows for the same functionality that packet 82 (CreateCombatText) used to have. (@WhiteXZ) +* Updated ServerBroadcast hook to provide a NetworkText object. (@tylerjwatson) +* Fixed levers and things not updating properly. (@deathcradle) +* Deprecated PacketTypes.ChatText. Chat is now handled using the NetTextModule and packet 82. (@WhiteXZ, @Hakusaro) +* Removed the -lang command-line flag from TShock. It is now a vanilla feature. (@Hakusaro) ## TShock 4.3.23 * Added evil type option during world creation (@mistzzt) From 62d2a531417ee1649fb69aab31eaa1eb583cb5e9 Mon Sep 17 00:00:00 2001 From: White Date: Sun, 14 May 2017 21:31:44 +0930 Subject: [PATCH 9/9] Version update --- TShockAPI/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index 91251a078..c5fc14269 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -53,5 +53,5 @@ // 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.3.23")] -[assembly: AssemblyFileVersion("4.3.23")] +[assembly: AssemblyVersion("4.3.24")] +[assembly: AssemblyFileVersion("4.3.24")]