Pryaxis / TShock

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

[Bouncer] Snake Charmer's Flute Doesn't Work. #1834

Closed calum12 closed 4 years ago

calum12 commented 4 years ago

Reproduction steps (if applicable)?

  1. Use the 'Snake Charmers Flute'
  2. Wait for the Snake to finish rising.
  3. Supposed to place as rope but vanishes leaving behind the pot.

Any screenshots?

image image

kubedzero commented 4 years ago

I mentioned this over in https://github.com/Pryaxis/TShock/pull/1861 but I'm not sure if PRs and issues send notifications in the same way. I'm running pre-8 and this still appears to be broken, I get OnTileEdit rejected from (ms2) <username> PlaceTile 504 in the debug logs.

kubedzero commented 4 years ago

I took a peek through the code and found https://github.com/Pryaxis/TShock/blob/ad82afd8001a585bcb2045900b082aea9d6e3455/TShockAPI/Bouncer.cs#L317 which seems to be another place the snake flute might need to be added. I based that assumption off the Debug logs I was seeing, which mentioned (ms2) and this seems to be the only place that's output.

Expanding the encompassing parens on the highlighted line and adding an additional case to make the conditional appear to be the following would work, right?

if (!(selectedItem.netID == ItemID.DirtBomb && action == EditAction.PlaceTile && editData == TileID.Dirt) 
                            && !(selectedItem.netID == ItemID.MysticSnakeCoil && action == EditAction.PlaceTile && editData == TileID.MysticSnakeRope))

Although I'm not clear on why it wouldn't be handled in the code/dictionary you added up here: https://github.com/Pryaxis/TShock/blob/ad82afd8001a585bcb2045900b082aea9d6e3455/TShockAPI/Bouncer.cs#L294

Maybe it's that action == EditAction.PlaceTile isn't evaluating True, or one of the itemIDs isn't matching?

hakusaro commented 4 years ago

Confirmed still broken.

Olink commented 4 years ago

The issue is that the projectile is killed after the tile edits. I have a change over @ https://github.com/Olink/TShock/commit/079541d4c949387fff36f7a9fe8ca282478949ce#diff-3086bd09c54e93b5f9a34786586f710cR298

This should fix it, but theres still a range check issue where if the snake goes too high it'll debuff you.

kubedzero commented 4 years ago

Sorry to have to reopen this. The flute now is able to properly lay rope, yay!

However, the rope never goes away. Not on creating a new snake charmer flue rope (there should only be one at a time) and not after 5, 10, even 15 minutes (I think it's only supposed to last a minute or two)

The debug logs show Bounder / OnTileEdit rejected from (pick) myPlayerName KillTile 0 so I imagine cleanup is failing and needs to be adjusted.

Pic: 2020-06-01 09_35_31-Terraria_ Dig Dug Ain't Got Nuthin on Me

Thanks!

hakusaro commented 4 years ago

Can you add at least 10 lines of context before and after that bouncer message? Did you see anything about RangeChecks?

kubedzero commented 4 years ago

Can you add at least 10 lines of context before and after that bouncer message? Did you see anything about RangeChecks?

Nope, nothing about RangeChecks. I am using the default debug logs, I saw some changelog mention of a plugin install for extra logging? I don't have that.

I just scrolled back a bit in the logs (since you can see I laid many ropes and also see 2020-06-01 09:35:05 - TextLog: VERBOSE: Bouncer / OnTileEdit rejected from (inconceivable rope coil) plexiglass PlaceTile 504 but in more recent logs, nothing of the sort.

Here's the full log file from the pre-10 startup, each flute call, and logging out after. There was something above the ropes off screen so if you're counting the number of repeat logs to check the max range, it might come up a little short due to hitting the roof.

Let me know what else I can do to help!

kubedzero commented 4 years ago

One more update, there seems to be a certain case where I can't lay rope either. I see a similar error to the error I mentioned before, Bouncer / OnTileEdit rejected from (inconceivable rope coil) plexiglass PlaceTile 213. Rope is consumed and I'm well away from the spawn point on a new character. Config and SQLite db are created from scratch, so there should be no permissions or anything messing with this. This is also with a new world in case there was some world specific issue.

I'm using the post-pre-11 build of the server from this test run https://github.com/Pryaxis/TShock/pull/2020/checks?check_run_id=748092720

Pic of the logs:

2020-06-07 21_32_26-10 1 1 9 - Remote Desktop Connection

Not sure if this has something to do with the patches applied so far, or my testing methodology might be bad. Let me know if there's something else I can help test!