Commit graph

255 commits

Author SHA1 Message Date
Arthri
d1459bb1ba Fix spaghetti one liner 2021-08-28 10:42:19 +08:00
Arthri
01d551aa30 Clarify multi-block tiles 2021-08-18 18:39:53 +08:00
Arthri
638b7cc54f Remove multiblock tiles 2021-08-18 17:39:28 +08:00
Arthri
8c5e7b4d47 Polish docs 2021-08-18 17:09:58 +08:00
Arthri
307ff79170 This isnt XML 2021-08-17 23:42:01 +08:00
Arthri
16451ec0e9 Complete docs and polish 2021-08-17 23:41:23 +08:00
Arthri
96f26be50b Complete correctors 2021-08-17 23:11:22 +08:00
Arthri
265cd2012f Transfer checks to a dictionary 2021-08-17 22:37:49 +08:00
Lucas Nicodemus
7b4042bf77 Merge branch 'general-devel' into fix-invalid-place-style 2021-08-16 16:10:41 -07:00
Chris
288698ce42 Some refactoring for variable naming & code flow 2021-08-16 22:14:02 +09:30
Arthri
ab30f5da70 Explain conditions in booster track check 2021-07-29 07:55:15 +08:00
Arthri
ca31a15be9 Add helper method for getting max placeStyle 2021-07-25 16:29:48 +08:00
Arthri
fd3e857f06 Declare BiomeTorchPlaceStyle's purpose 2021-07-25 14:12:17 +08:00
Arthri
de22400b3f Biome Torch check is suppose to check for 0 2021-07-25 14:06:47 +08:00
Arthri
8004b3f079 Declare how biome torch works 2021-07-25 13:55:56 +08:00
Killia0
9b249d72a8
Merge branch 'general-devel' into upstream-general-devel 2021-07-24 19:48:54 -04:00
Arthri
a1b7556d3a Simplify booster track check 2021-07-22 10:44:17 +08:00
Arthri
74197bd71b Add comment describing right booster track check 2021-07-22 10:43:23 +08:00
Arthri
c616d1cade Add comment describing biome torch correction code 2021-07-22 10:39:19 +08:00
Arthri
871f6babcc Fix issues 2021-07-19 15:45:14 +08:00
Arthri
b63b50bb3e Rename torchPlaceStyle -> correctedPlaceStyle 2021-07-19 14:06:43 +08:00
Arthri
ea180347cb Fix can't place >>> Booster Track 2021-07-19 14:05:58 +08:00
Arthri
9182b3b2be Fix invalid place style exploit 2021-07-19 13:48:06 +08:00
Arthri
fcccfc07e8 Fix invalid torch place style exploit 2021-07-19 13:38:40 +08:00
Killia0
154bee58f1 Typo fixes on comments/strings
My first PR contribution to TShock is spellcheck huh, frankly I don't know why but hey I could spare the time for this and caught some stuff.
2021-07-16 14:53:37 -04:00
James Puleo
ef603f61a8
Consistently use TilePlacementValid and SendTileSquare in Bouncer.
There are 3 different ways Bouncer uses these:
- Not checking `TilePlacementValid` at all.
- Checking `TilePlacementValid`, rejecting, but then doing a
  `SendTileSquare` to that player.
- Checking `TilePlacementValid`, rejecting. _(this is what we should
  always be doing)_

Not checking `TilePlacementValid` can allow for placement outside of the
world (unknown results), and checking `TilePlacementValid` and sending a
`SendTileSquare` on rejection causes the server to try to frame that
square. In the case of invalid coordinates (negative), framing takes
much longer than expected.
2021-07-10 00:10:45 -04:00
Lucas Nicodemus
89555beb73 Revert "Revert "Merge branch 'patch-28' into general-devel""
This reverts commit 258b21dddb.
2021-05-29 17:58:57 -07:00
Lucas Nicodemus
be2b817abd Merge remote-tracking branch 'moist/patch-28' into general-devel 2021-05-28 20:24:51 -07:00
Lucas Nicodemus
258b21dddb Revert "Merge branch 'patch-28' into general-devel"
This reverts commit d2179e95ff, reversing
changes made to 58d7e26960.
2021-05-28 20:21:14 -07:00
Lucas Nicodemus
d2179e95ff Merge branch 'patch-28' into general-devel 2021-05-28 20:18:56 -07:00
stacey
a369a25084
Update TShockAPI/Bouncer.cs
Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2021-05-28 23:12:39 -04:00
Lucas Nicodemus
707683a0f2 Fix whitespace changes that are confusing 2021-05-28 19:52:42 -07:00
Lucas Nicodemus
5e09f5133d Merge branch 'general-devel' into h/ips 2021-05-28 19:36:25 -07:00
Lucas Nicodemus
177648c8c3 Change Bouncer internal handlers to private set 2021-05-28 00:02:59 -07:00
Lucas Nicodemus
046d52ad2e Move emoji player index check into IllegalPerSe
This is the first commit in a pattern that I'd like to follow. The
concept is that we specifically create handlers for things that are
"illegal per se." That is, there are no possible situations (in the
current protocol) where a packet of this type is received from a client.
In this case, I moved the emoji handler out of the Handler just for
emoji, since it seemed like an obvious case.

The rule of thumb is simple: if something is illegal per se, there
should be no possible way in the vanilla client to achieve this result.
If a player sends this combination of packets they *must* be hacking.
Not that there is a 99.9% chance they're hacking, but that there is a
100% unambiguous chance that they're hacking.

Something is illegal per se if it can only be created by a hacked
client. If there's a crashing bug that a normal player can do with a
complex series of vanilla events, that is not illegal per se.

The goal of this namespace and class of handlers is to handle exactly
one type of protocol violation, and remove the packet accordingly. If it
is ever reported that the packet can be sent from a vanilla client, the
check must be removed as it is no longer a per se violation of the
protocol.
2021-05-27 23:59:43 -07:00
stacey
d78de5719e
Fix formatting 2021-05-27 18:51:27 -04:00
stacey
a5eeb0788a
Even better solution 2021-05-27 18:39:50 -04:00
stacey
6592a880bc
Improve on prev code
Thanks to everyone who helped on discord
2021-05-27 18:08:53 -04:00
stacey
98a93693da
Fix Torch God biome torch swap issue
Can confirm this fixes the issue but not sure if it opens any new exploits
2021-05-27 13:00:33 -04:00
stacey
09f75e0db9
Update OnNPCAddBuff to account for Frost armor set
This fixes false positive cheat detection when throwing rotten eggs at town NPCs while wearing Frost armor set. Also made the debug and kick messages more clear for future reference.
2021-05-26 19:31:46 -04:00
stacey
b98c6aa282
fix typo
oops sorry
2021-05-12 12:35:15 -04:00
stacey
e7807f6378
improved the code 2021-05-12 12:18:53 -04:00
stacey
10318f032a
Improve HealOtherPlayer 0.2 check
Since this check is based on damage and healing amount is based on 20% of the damage, it makes more sense to skip the check if the player has ignoredamagecap (trustedadmin and higher).
2021-05-12 12:09:11 -04:00
Chris
85fbf593c9 Implement place style checks, courtesy of @AgaSpace 2021-03-22 10:29:09 +10:30
Lucas Nicodemus
355a7f02f5 Fix ∞ velocity exploit (@bartico6, @tlworks) 2021-01-28 00:39:09 -08:00
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +10:30
Chris
39e13f74d6 Remove TShock.Itembans in favour of TShock.ItemBans 2020-11-13 19:22:10 +10:30
Chris
77fd8c9c9f Add calculated rollback rectangle for tile edits 2020-11-13 18:32:52 +10:30
Chris
ca38d64632 The great refactoring! Squares to Rectangles 2020-11-13 17:46:00 +10:30
Quinci135
253c239f86
Add missing comma 2020-10-14 15:45:43 -07:00