Commit graph

350 commits

Author SHA1 Message Date
Zack
c999b4305c
Remove Console debug output. 2020-05-30 11:58:59 -04:00
Olink
96c7453b33 Merge branch 'general-devel' of github.com:Pryaxis/TShock into fix-bugs 2020-05-30 11:54:09 -04:00
Patrikkk
9a49f6ad15
Merge branch 'general-devel' into fishoutnpc-event 2020-05-30 10:53:51 +02:00
Patrikkk
791a6be831
Add additional FoodPlatter event check. Update range check. (#1941)
This is a combination of 3 commits:

* @Olink was right. Adding additional check. Modifying range check.

There are two ways to place food into a plate. One is by having it in hand (mouse) and right clicking, the other is by having the item selected in the... "inventory bar"(?) and right clicking the plate.

Tested range, if player is outside the range, they should not get their item back.

* FoodPlatterHotfix - Update IsInRange range value.

To suggestion of Olink, to consider player lag and increase the range check.

Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2020-05-30 00:39:40 -07:00
Lucas Nicodemus
61e7d10941
Merge branch 'general-devel' into patch-5 2020-05-30 00:02:27 -07:00
Lucas Nicodemus
f82ab41a25
Add /sync command to alleviate door related sadness
Run /sync if your doors disappear. This will resync your local client
with the server state. For more information, please see the associated
changelog entry.
2020-05-29 21:04:48 -07:00
Olink
6355f2d9ea Merge branch 'general-devel' of github.com:Pryaxis/TShock into fix-bugs 2020-05-29 17:04:00 -04:00
Olink
50337a1d2f Add support for all rope coil types. 2020-05-29 17:03:48 -04:00
Patrikkk
47dd4a4345 FishOutNPC - Simplify bouncer logic. Fix check in event. 2020-05-29 12:00:33 +02:00
Chris
d4a0f47e45 WIP - splitting STS into new class and processing methods 2020-05-29 14:05:43 +09:30
Patrikkk
695ca52a9a Fix FishOutNPC bouncer debug message. 2020-05-29 03:27:19 +02:00
Patrikkk
9cd4670436 Add FishOutNPC event handler. 2020-05-29 03:25:11 +02:00
Patrikkk
0fa8ae13d7 Implement FoodPlatter placing event.
This is called when a player is placing a fruit (item) in a plate.
Adding checks to see if they have permission to place or replace a fruit in the item.
Checks if they are within range. And a check to see if they are legitimately placing the item from their hand, and not by sending a raw packet.
2020-05-28 19:24:28 +02:00
Olink
079541d4c9 Initial working commit. 2020-05-27 23:05:45 -04:00
moisterrific
0d2b591760
Update NPCAddBuff to include Sparkle Slime debuff
It's a new cosmetic debuff added in 1.4, like Wet and Slimed that can be applied to Town NPCs. Wiki: https://terraria.gamepedia.com/Sparkle_Slime_Balloon
2020-05-26 13:45:31 -04:00
Lucas Nicodemus
ad82afd800
Merge branch 'general-devel' of github.com:Pryaxis/TShock into general-devel 2020-05-24 14:06:17 -07:00
Lucas Nicodemus
35c103e011
Fix bouncer debug message being incorrect 2020-05-24 14:04:11 -07:00
Olink
16d1cdd360 Track projectile updates being sent by the server, instead of received by the server. 2020-05-24 16:00:20 -04:00
鱼鱼
e39af6f917 fix npc home removal. rename something related. 2020-05-24 16:47:54 +08:00
Olink
8edca72919 Add config option for the bomb radius. 2020-05-24 04:33:03 -04:00
Olink
b73088306d Move the projectile refresh to Bouncer.
Bouncer now has an OnSecondUpdate().
Move projectile created tracking to GetDataHandler from Bouncer.
2020-05-24 04:27:12 -04:00
Zack
9209ac0b73
Apply suggestions from code review
Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2020-05-24 04:19:00 -04:00
Olink
3b0c5f7775 Make bouncer compile. Reduce range checks. 2020-05-24 03:54:27 -04:00
Olink
965361c406 Add a projectile tracker, so that we can allow fluid bombs. 2020-05-24 03:48:08 -04:00
Lucas Nicodemus
ae87f242d7
Clarify log debug from SendTileSquare 2020-05-23 23:56:49 -07:00
Lucas Nicodemus
37e65b64dc
Add note about what Tombstones do and don't do 2020-05-23 23:47:50 -07:00
Axeel
8d277edf04
Fix npcbuff bouncer (#1881)
* Fix npcbuff bouncer

* Update CHANGELOG.md

Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2020-05-24 13:31:21 +08:00
Lucas Nicodemus
eb8aad8a3b
Add extra debug logs to OnTileEdit Bouncer call 2020-05-23 00:39:39 -07:00
Lucas Nicodemus
d610ab929b
Support dirt bomb (fixes #1853, fixes #1865)
This commits adds rudamentary support for dirt bombs. There's probably
some edge cases in here but the entire handler really needs to be
rewritten. This is total spaghetti and completely unreadable and
unrecognizable.
2020-05-23 00:38:03 -07:00
Lucas Nicodemus
c5ec45bc02
Support using the scarab bomb (fixes #1808)
Also fixes #1781. Partially fixes #1865.
2020-05-22 23:53:34 -07:00
Lucas Nicodemus
7452d3c91d
Support using bottomless lava bucket
This is in response to discussion #1859. Due to the nature of this
already terrible handler, I refuse to add any other types of checks for
whether or not this item is banned and lava. If you want to ban lava,
ban a lava bucket. Don't ban an infinite lava bucket, because finite
lava is still infinite lava in this topsy turvy game where the client
rules the world.
2020-05-22 23:33:09 -07:00
Lucas Nicodemus
a457e8c9ee
Support lava absorbant sponge (fixes #1852) 2020-05-22 23:22:48 -07:00
Lucas Nicodemus
03e41a521e
Add more logging to Bouncer to debug antihack
This adds more logging in Bouncer so as to detect more false positives.
2020-05-22 19:34:55 -07:00
Lucas Nicodemus
7a5c2e4d26
Add verbose logging for many bouncer packets
This type of change is designed to make it easier to debug problems with
Bouncer's anticheat checks and antigrief checks by allowing server
operators to send better reports. In particular, the logs will help us
diagnose precisely which checks are tripping, and they can cross
correlate the item with the check to adjust the precise check.

More work is needed to add more checks in more places, but you can't
just do this naively and need to actually think when adding things.
2020-05-22 15:34:04 -07:00
鱼鱼
946d54b69e fix player spawn stuff 2020-05-20 21:27:49 +08:00
Lucas Nicodemus
3b748f1156
Potentially fix player desync issue
It was discovered that LastNetPosition is being checked to see if it's
zero in Bouncer. Then, Bouncer rejects the update. The default is zero
and potentially this can be zero in other ways. The original code in
master (checked at 9f4892f in GetDataHandlers) had an additional write
on LastNetPosition to update it, but this write was not moved over to
Bouncer. Thus, there is a high probability that players are "desync'd"
after LastNetPosition gets stuck at zero and never updates.
2020-05-19 23:50:02 -07:00
Lucas Nicodemus
e9098d0e78
Add verbose debug logs to a variety of checks
These are high priority checks we really want to look at. I want to add
more of these debug statements to all checks in Bouncer and other parts
of GetDataHandlers, but I think this is good enough for now.
2020-05-19 22:11:21 -07:00
Patrikkk
8ced5d5dfc Adding new buffs to OnNPCAddBuff
Missed these buffs with their bufftimes, so it was always caught by the bouncer, thinking players are hacking.
2020-05-18 18:47:39 +02:00
Lucas Nicodemus
3471646dc7
Temporarily disable some projectile cheat checks 2020-05-18 00:52:44 -07:00
Chris
ea6425a2e2 Update Bouncer/Item Bans refs for new models 2020-05-18 14:45:36 +09:30
Chris
db84a9fc8f Adds models for the random bitsbyte data received in packet 13 - player update 2020-05-18 14:42:29 +09:30
Patrikkk
f48a18aa7a Fixing my random if logic.
Really.. time for bed.
The Any wasn't terrible, but itwould have allow cross sending projectiles within that dictionary. (send gold stab with copper in hand, or vice versa etc)
2020-05-18 02:44:39 +02:00
Patrikkk
91e3ebf4f0 Fix false cheat catch on stab items.
Stab items (swords) now send projectiles to imitate directional stabbing. Bouncer catched since there was no handling of these new projectiles.
2020-05-18 02:37:39 +02:00
Patrikkk
a02f959f58 Update Buff related packets
Buff IDs no longer fit in a byte. Vanilla reads/writes ushorts but they get converted to int.
- Added helptip for Zone4 in playerzones eventargs.
2020-05-18 02:02:02 +02:00
Patrikkk
3b3fa9fc72 Update Modify Tile packet.
Only updating. Did not patch any possible exploits. Requesting someone to tend to this when possible.
2020-05-18 00:41:12 +02:00
Patrikkk
2d5166cfa4 Updating SpawnPlayer and PlayerUpdate packet
Fixing the HasHackedItemStacks method by adding missing Void Vault check.
2020-05-18 00:04:49 +02:00
Lucas Nicodemus
1993900159
Move OnTileEdit ban checks: Bouncer -> Itembans
This change moves the ban checks used to determine, during TileEdit
events, if an item is banned, out of Bouncer and into the newly isolated
ItemBan subsystem. Rather than creating a large pull request for all of
these, I'm just going to create a series of commits and send them in one
at a time. This should result in about one PR per hook that uses item
bans that needs to move.
2020-05-16 21:50:28 -07:00
Lucas Nicodemus
b5f95d5918
Fragments: Separate out item bans (#1595)
* Remove commented out warning disable

* Add initial ItemBans segregation infrastructure

* Add shell for initial OnSecondUpdate stuff

* Add comments yo

* Remove duplicated logic

* Split out more item ban code

This part of the fragments work is primarily aimed at reducing the
complexity of OnSecondUpdate in TShock and moving that check out into
the ItemBans subsytem.

Of major note in this is the removal of "check", which was a string
variable that tracked state and replacement of many of the item ban
activities with sane private methods that are at least somewhat
sensible. Obviously there's a lot to be desired in this system and I'm
really going for a run here by trying to continue a branch from so long
ago that I barely even remember the whole point of existence.

Still to do: GetDataHandlers related item ban code needs to be moved
into its own hook in the ItemBan system. Finally, there is a downside to
some of this: we're basically iterating over players again and again if
we keep this pattern up, which is kinda lame for complexity purposes.

* alt j: comment changes

* Move item ban check out of main playerupdate check

Separates out item ban logic from the rest of GetDataHandlers so that
item bans is more isolated in terms of what fragments is asking for.

* alt-j: convert indentation to tabs

* alt-j: fix botching source code

* Move item ban related chest checks out of gdh

* Remove chest item change detection from item bans

It doesn't do anything. If a user removes an item from a chest, it
bypasses this check. If a user adds an item to a chest, the server seems
to persist the change anyway, even if the event is handled. That's a bug
for sure, but fundamentally, it's not the item ban system's fault.

* Revert "Remove chest item change detection from item bans"

This reverts commit 758541ac5c4d4096df2db05ba2a398968113e1e4.

* Fix logic issues related to item ban handling

Re-implements chest item handling and correctly handles events and
returns after setting handled event state.

* Remove TSPlayer.HasProjectilePermission

In infinite wisdom, it turns out this is not a good method for TSPlayer
to have. It just checks the states of things as per what the item ban
system says is banned and then creates implicit relationships to the
projectile ban system.

Doing this effectively knocks down another external reference to the
item ban system outside of the context of the implementation for the
system itself and its related hooks.

This commit also adds context around what the heck is going on with some
of our more interesting checks as per discussions in Telegram with @Ijwu
and @QuiCM.

* Update changelog

* Remove useless ref to Projectile.SetDefaults

* Change item ban to ban based on ID not strings

I think I was so confused as to why we were passing strings everywhere
that I just felt inclined to continue the trend in previous commits.
2020-05-16 16:27:34 -07:00
moisterrific
6007edeb77
Fix BoC false positive kick in NPCAddBuffTimeMax
360 ticks = 6 seconds, according to the wiki, the max possible duration is proportional to dmg taken, so 7.5 seconds would be the max duration (aka 450 ticks)
2020-02-07 16:14:27 -05:00
Chris
e3bac1871a
Update Bouncer.cs
Removes double occurrence of daybreak buff from dictionary.
Thanks for pointing this out @AxeelAnder
2019-07-18 13:54:20 +00:00