From 1b46abe725ce02aeb98164b977038b9142473bfc Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 19 May 2020 00:52:07 +0000 Subject: [PATCH 1/8] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 44811b36..8ad6a0e2 100644 --- a/README.md +++ b/README.md @@ -259,6 +259,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Rodrigo Rente

💻 📆 ⚠️
Stargazing Koishi

💻 🚇
Axeel

📖 📆 +
Nathan Easton

💻 From 4861f5ff199a74ed2a73f9ab6a5a4a1b1f05a17b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 19 May 2020 00:52:08 +0000 Subject: [PATCH 2/8] docs: update README_cn.md [skip ci] --- README_cn.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_cn.md b/README_cn.md index ff900a06..5ff1bc82 100644 --- a/README_cn.md +++ b/README_cn.md @@ -76,6 +76,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Rodrigo Rente

💻 📆 ⚠️
Stargazing Koishi

💻 🚇
Axeel

📖 📆 +
Nathan Easton

💻 From 45b078eeb0ab9bf9a1930e8c43e53a7ec092eee9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 19 May 2020 00:52:09 +0000 Subject: [PATCH 3/8] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 6f9e5960..00c70112 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -46,6 +46,15 @@ "doc", "projectManagement" ] + }, + { + "login": "ndragon798", + "name": "Nathan Easton", + "avatar_url": "https://avatars2.githubusercontent.com/u/10368650?v=4", + "profile": "http://www.nathaneaston.com/", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, From 145885beb3c0db4f07fe9dc5113953d623223bde Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Tue, 19 May 2020 22:26:14 -0700 Subject: [PATCH 4/8] Remove /confuse command --- CHANGELOG.md | 3 +++ TShockAPI/Commands.cs | 24 ------------------------ 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ef4591b..1e26b913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large. +## Upcoming changes +* Removed `/confuse` command and Terraria player data resync from @Zidonuke. (@hakusaro) + ## TShock 4.4.0 (Pre-release 3) * Fixed `/worldmode` command to correctly target world mode. (@Ristellise) * The following commands have been removed: `tbloodmoon`, `invade`, `dropmeteor`. `fullmoon`, `sandstorm`, `rain`, `eclipse` diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index ee84fc34..5d2c2912 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -337,10 +337,6 @@ namespace TShockAPI { HelpText = "Annoys a player for an amount of time." }); - add(new Command(Permissions.annoy, Confuse, "confuse") - { - HelpText = "Confuses a player for an amount of time." - }); add(new Command(Permissions.annoy, Rocket, "rocket") { HelpText = "Rockets a player upwards. Requires SSC." @@ -5208,26 +5204,6 @@ namespace TShockAPI } } - private static void Confuse(CommandArgs args) - { - if (args.Parameters.Count != 1) - { - args.Player.SendErrorMessage("Invalid syntax! Proper syntax: {0}confuse ", Specifier); - return; - } - var players = TSPlayer.FindByNameOrID(args.Parameters[0]); - if (players.Count == 0) - args.Player.SendErrorMessage("Invalid player!"); - else if (players.Count > 1) - args.Player.SendMultipleMatchError(players.Select(p => p.Name)); - else - { - var ply = players[0]; - ply.Confused = !ply.Confused; - args.Player.SendSuccessMessage("{0} is {1} confused.", ply.Name, ply.Confused ? "now" : "no longer"); - } - } - private static void Rocket(CommandArgs args) { if (args.Parameters.Count != 1) From e20f717269f71f26f41fdd10be87889b460483e9 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Tue, 19 May 2020 01:37:12 -0700 Subject: [PATCH 5/8] Remove reimplementation of Terraria player sync The reimplementation of Terraria player sync was first created by @Zidonuke when introducing better antihack and the item ban system. He added this because he was probably attempting to correct the client that sent that sent bad data. The primary purpose was to send data back to the client, not necessarily for the purpose of doing anything for the server. This is demonstrated by the fact that when we added player update handling, we started rejecting the packets outright and not sending the player any packets. This means that functionally we don't run this code hardly ever if someone is actually disabled. Some of those code was related to /confuse. That is also being removed. --- TShockAPI/GetDataHandlers.cs | 114 +---------------------------------- 1 file changed, 1 insertion(+), 113 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 20409603..199eb024 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2127,119 +2127,7 @@ namespace TShockAPI if (OnPlayerUpdate(args.Player, args.Data, playerID, controls, miscData1, miscData2, miscData3, selectedItem, position, velocity, originalPosition, homePosition)) return true; - if (controls.IsUsingItem) - { - // Reimplementation of normal Terraria stuff? - if (args.TPlayer.inventory[selectedItem].Name == "Mana Crystal" && args.Player.TPlayer.statManaMax <= 180) - { - args.Player.TPlayer.statMana += 20; - args.Player.TPlayer.statManaMax += 20; - args.Player.PlayerData.maxMana += 20; - } - else if (args.TPlayer.inventory[selectedItem].Name == "Life Crystal" && args.Player.TPlayer.statLifeMax <= 380) - { - args.TPlayer.statLife += 20; - args.TPlayer.statLifeMax += 20; - args.Player.PlayerData.maxHealth += 20; - } - else if (args.TPlayer.inventory[selectedItem].Name == "Life Fruit" && args.Player.TPlayer.statLifeMax >= 400 && args.Player.TPlayer.statLifeMax <= 495) - { - args.TPlayer.statLife += 5; - args.TPlayer.statLifeMax += 5; - args.Player.PlayerData.maxHealth += 5; - } - } - - // Where we rebuild sync data for Terraria? - args.TPlayer.selectedItem = selectedItem; - args.TPlayer.position = position; - args.TPlayer.oldVelocity = args.TPlayer.velocity; - args.TPlayer.velocity = velocity; - args.TPlayer.fallStart = (int)(position.Y / 16f); - args.TPlayer.controlUp = false; - args.TPlayer.controlDown = false; - args.TPlayer.controlLeft = false; - args.TPlayer.controlRight = false; - args.TPlayer.controlJump = false; - args.TPlayer.controlUseItem = false; - args.TPlayer.pulley = miscData1.IsUsingPulley; - - if (miscData1.IsUsingPulley) - args.TPlayer.pulleyDir = (byte)(miscData1.PulleyDirection ? 2 : 1); - - if (miscData1.IsVortexStealthActive) - args.TPlayer.vortexStealthActive = true; - else - args.TPlayer.vortexStealthActive = false; - - args.TPlayer.gravDir = miscData1.GravityDirection ? 1f : -1f; - - args.TPlayer.direction = -1; - - if (controls.MoveUp) - { - args.TPlayer.controlUp = true; - } - if (controls.MoveDown) - { - args.TPlayer.controlDown = true; - } - if (controls.MoveLeft) - { - args.TPlayer.controlLeft = true; - } - if (controls.MoveRight) - { - args.TPlayer.controlRight = true; - } - if (controls.Jump) - { - args.TPlayer.controlJump = true; - } - if (controls.IsUsingItem) - { - args.TPlayer.controlUseItem = true; - } - if (controls.FaceDirection) - { - args.TPlayer.direction = 1; - } - else - { - args.TPlayer.direction = -1; - } - - if (args.Player.Confused && Main.ServerSideCharacter && args.Player.IsLoggedIn) - { - if (args.TPlayer.controlUp) - { - args.TPlayer.controlDown = true; - args.TPlayer.controlUp = false; - } - else if (args.TPlayer.controlDown) - { - args.TPlayer.controlDown = false; - args.TPlayer.controlUp = true; - } - - if (args.TPlayer.controlLeft) - { - args.TPlayer.controlRight = true; - args.TPlayer.controlLeft = false; - } - else if (args.TPlayer.controlRight) - { - args.TPlayer.controlRight = false; - args.TPlayer.controlLeft = true; - } - - args.TPlayer.Update(args.TPlayer.whoAmI); - NetMessage.SendData((int)PacketTypes.PlayerUpdate, -1, -1, NetworkText.Empty, args.Player.Index); - return true; - } - - NetMessage.SendData((int)PacketTypes.PlayerUpdate, -1, args.Player.Index, NetworkText.Empty, args.Player.Index); - return true; + return false; } private static bool HandlePlayerHp(GetDataHandlerArgs args) From 3c362fb68a9e1926ca24c7e69a309ea58e60af6d Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 20 May 2020 05:39:18 +0000 Subject: [PATCH 6/8] docs: update README.md [skip ci] --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f7c8f339..257df430 100644 --- a/README.md +++ b/README.md @@ -260,8 +260,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Rodrigo Rente

💻 📆 ⚠️
Stargazing Koishi

💻 🚇
Axeel

📖 📆 -
Nathan Easton

💻
Patrikkk

💻 📖 ⚠️ +
Nathan Easton

💻 +
Shinon

⚠️ 💻 📖 From 4df9edbbdc4302e17111eb57705f8cec09c8a431 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 20 May 2020 05:39:19 +0000 Subject: [PATCH 7/8] docs: update README_cn.md [skip ci] --- README_cn.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README_cn.md b/README_cn.md index 329f1983..7ede26da 100644 --- a/README_cn.md +++ b/README_cn.md @@ -76,8 +76,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Rodrigo Rente

💻 📆 ⚠️
Stargazing Koishi

💻 🚇
Axeel

📖 📆 -
Nathan Easton

💻
Patrikkk

💻 📖 ⚠️ +
Nathan Easton

💻 +
Shinon

⚠️ 💻 📖 From bf0bca6b0432c65bad996fe340e2e98e3c0ffa1f Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 20 May 2020 05:39:20 +0000 Subject: [PATCH 8/8] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index d636708d..f141644b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -66,6 +66,17 @@ "contributions": [ "code" ] + }, + { + "login": "Ristellise", + "name": "Shinon", + "avatar_url": "https://avatars2.githubusercontent.com/u/7894419?v=4", + "profile": "https://github.com/Ristellise", + "contributions": [ + "test", + "code", + "doc" + ] } ], "contributorsPerLine": 7,