Add Options to Disable Certain TileEdit/PlaceObject Checks, Configurable Max Chat Message Length, + Fix Incorrect Rejection of Magical Ice in Some Cases#3157
Conversation
- Added PreventMismatchedPlace, PreventInvalidBreaking, and AllowFakeNewChest options - PreventMismatchedPlace prevents players from placing tiles that do not match their held item. True by default - PreventInvalidBreaking prevents players from mining with incorrect items/tools. True by default - AllowFakeNewChest allows for placing of the Fake_NewChest items. False by default - Fixed ice rod ice being rejected if player switched items or teleported away - Removed kick from NPCAddBuff, instead rejecting it properly - Removed OnReleaseNPC kick for incorrectly released critters (does not allow for incorrect releases) - Added MaximumChatMessageLength, replacing old forced limit of 500. Applies to chat messages & player death reasons.
|
Ice Rod changes should fix #2378. |
Instead of returning an error msg the message could simply be truncated when it exceeds the character limit. It’s not ideal for players to lose their message and have to retype it 500 character limit is too long max100-150 |
I disagree. Mobile clients can type extremely long messages. This change was made specifically for that reason, plus 3rd-party PC clients which have re-implemented chat can do so as well. (TerraAngel)
I would make this change but currently my only computer is no longer functional. I won't be able to update this or any other PRs until I get a new one (the damage is expensive & time consuming to repair), but I will happily make this change when possible. Apologies for the inconvenience, but technology hates me. |
Are we going to support features/modifications from third-party clients? Anyway, not bad to have a configurable number. The other prevent/allow options seems to be allowing everyone which is little bit of weird - if the feature is really necessary, would it be better to use permission instead? |
I simply followed the existing option for preventing invalid place styles. I can also agree on this being better as permissions instead. For now though I can't make changes to this PR so it will probably remain in limbo until I get a new computer.
Mobile seems to have no text input limit on chat and it was easy to just paste large amounts of text to hit the fixed 500 character limit that kicks you. It's not intentionally supporting client modifications on PC, it's a result of mobile having such a high lmit (or possible lack of one) for chat input which just so happens to benefit those 3rd party clients. |
|
Marking this PR as draft for now until I can continue working on it and don't want it to clog up the 1.4.5 porting process. |
|
I think this is a good thing we should work on but we definitely need to finish that first. |
|
I do wish to make changes to this, like switching the config option to allow mismatched placement to a permission instead that allows the user to ignore all checks on incorrect item usage, and also add option to truncate excessively long chat messages instead of blocking them. I should hopefully be able to work on this by this weekend but I am at the mercy of shipping. |
- Removed PreventMismatchedPlace and PreventInvalidBreaking, replaced with ignoreitemsafetychecks permission - Move MaximumChatMessageLength in config - Added TruncateExcessiveChatMessages config option, truncates messages which exceed MaximumChatMessageLength
|
Going to split this PR into a few smaller PRs due to its size, honestly. |
|
@lost-werewolf if you're not in the discord server that's fine but if you are can you ping me with this PR when you want reviews on it in discord? |
|
@hakusaro I'm "Pirlo" in the discord, I closed this PR since I feel like splitting it up (and merge conflicts kind of irritated me a bit, it's 2 AM here at this time so I don't want to deal with annoyances). Going to PR the chat message length changes, new permission + setting for fake_newchests, and the ice rod fix separately in a bit while I work on splitting it up and bringing it up-to-date with the current branch. |
This one's a pretty decently sized PR. The 3 new options were added in response to #3013.
PreventMismatchedPlaceandPreventInvalidBreakingare enabled by default to not cause any changes to existing security. Servers can now choose to disable these options if they are okay with such a risk, similar to the existing option ofPreventInvalidPlaceStyle.AllowFakeNewChestis false by default. Enabling this will allow players to place the normally disallowedFake_NewChestitems. These items do have genuine use for technical players of the game, so this was added to benefit those types of players. Of course there is risk, so it must be manually enabled to not compromise security.Magical Ice placement is now validated by making sure the player has recently created an ice block projectile. This should prevent cases where a player switches their held item immediately after using an Ice Rod and their ice doesn't place.
The kicks from
NPCAddBuff&OnReleaseNPChave been removed for consistency with almost all other parts of the Bouncer, and in case of false positives for the (currently upcoming) 1.4.5 update.MaximumChatMessageLengthis a new option that replaces the old hard limit of 500 characters on chat messages. The substring issue on mobile clients is supposed to be fixed in 1.4.5 (I can not find the original post but I believe it is on the Terraria Community Forums). The hard limit of 500 characters didn't prevent the issue whatsoever and instead caused frustration for players (primarily on mobile) who sent long messages. Instead of kicking them now, they recieve an error message that their message was too long.If there's any concerns about changes here, please let me know. I ensured that none of the new options caused issues with existing anti-cheat checks, but there IS a possibility some cases were missed and no longer function properly.
The changelog is as follows:
PreventMismatchedPlace,PreventInvalidBreaking, andAllowFakeNewChestoptions to the config.PreventMismatchedPlaceprevents players from placing tiles, walls, or wiring that do not match their held item. Enabled by default. Disabling this may compromise security on your server, and is not recommended.PreventInvalidBreakingprevents players from mining tiles/walls or removing wiring with incorrect items/tools. Enabled by default. Disabling this may compromise security on your server, and is not recommended.AllowFakeNewChestallows for placing of the unobtainableFake_NewChestitems. Disabled by default.MaximumChatMessageLengthoption to the config, replacing previous limit of 500. Applies to chat messages & player death reasons.MaximumChatMessageLength.