Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

Torch Swap rejected #2344

Closed BenAvermate closed 3 years ago

BenAvermate commented 3 years ago

Reproduction steps (if applicable)?

  1. join server with character (which has torch gods favor)
  2. character activates torch swap
  3. place (normal) torch, no problem
  4. try placing a special torch, using torch swap, game eats torch and does nothing

Any stack traces or error messages (if known)?

Bouncer / OnTileEdit rejected  from (placestyle) <user> PlaceTile 4 placeStyle: x expectedStyle: 0

Any screenshots?

It doesn't do anything in-game, no warning and no torch. So I can't give a screenshot.

Any log messages from files that end in .log or .txt? What are the last 100 log messages from the server console?

It gets rejected even with PreventInvalidPlaceStyle disabled.

Here is a log with some of the Bouncer messages in it: 2021-05-24_13-45-42.log As you can see, it just gives the Bouncer message and nothing else.

What plugins and what versions of those plugins are you running?

just the standard tshock 4.5.3, no other plugins

bartico6 commented 3 years ago

Moving this over from the discussion it was initially brought up in:

Bouncer does not account for torch god buff and incorrectly considers placing a different styled torch as a cheat, rejecting the block placement.

Fix is to test if the held item style is 0 and if its a torch (which allows torchswap to happen) and test if the target style is a valid torch style. Pending implementation and testing.

Kojirremer commented 3 years ago

A bit late, but I also received confirmation of this issue on my server as well.

Tekkobra commented 3 years ago

Also confirming on my server for Terraria Server v1.4.2.3 on TShock v4.5.3.0

hakusaro commented 3 years ago

This one should be fixed on the latest experimental builds: https://github.com/Pryaxis/TShock/commit/a5eeb0788a42007dfbf2d27585beccfc5dac6af5

hakusaro commented 3 years ago

@Kojirremer if you have a spare moment, can you check to see if the latest experimental builds fix it?

Kojirremer commented 3 years ago

@Kojirremer if you have a spare moment, can you check to see if the latest experimental builds fix it?

As soon as I check how to use them. I've only used the stable releases so far. Is that what the pinned video was about? Done. On it.

Kojirremer commented 3 years ago

imagen Unfortunately, it appears it doesn't. :(

EDIT: Just in case, I tried this build: https://github.com/Pryaxis/TShock/runs/2702059421

moisterrific commented 3 years ago

imagen Unfortunately, it appears it doesn't. :(

EDIT: Just in case, I tried this build: https://github.com/Pryaxis/TShock/runs/2702059421

that's weird, it was working when i built it locally and tested on my private server to verify it worked. I always test it before submitting a PR so idk what's happening here

just for the hell of it i went and fetched the code from gen-dev again and it somehow didn't have my commit?? so i put in the fix again and built it, started up my server and tested and it was fine. maybe the build you got doesn't have it? im bamboozled

hakusaro commented 3 years ago

Should be fixed in 4.5.4! Please re-open if it's not!