Commit graph

966 commits

Author SHA1 Message Date
Lucas Nicodemus
12d40e98ad
Disable always return on HandleLoadNetModule
As of 1.4.x.x, these are used for more than just chat text and we need
to start handling them separately. The original check here would just
return true (handling the event) for any module that's not text. Now, we
need to actually do processing and check for exploits on these.
2020-05-17 23:47:29 -07:00
Chris
ea53fdf04a Merge branch 'general-devel' of https://github.com/Pryaxis/TShock into general-devel 2020-05-18 15:47:40 +09:30
Chris
c2e3f65a2a Add modeling to new projectile handling 2020-05-18 15:47:31 +09:30
Lucas Nicodemus
926f97b49f
Update OnTeleport hook with new changes 2020-05-17 23:17:03 -07:00
Lucas Nicodemus
16df9bb16c
Update "spawn boss invasion" get data handler
This is really "spawn arbitrary stuff" and it can create invasions,
pets, and bosses now.
2020-05-17 22:44:10 -07:00
Chris
db84a9fc8f Adds models for the random bitsbyte data received in packet 13 - player update 2020-05-18 14:42:29 +09:30
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
Patrikkk
9a05678933 Updating HandleProjectileNew
Packet structure order is different in 1.4
2020-05-17 21:41:31 +02:00
鱼鱼
1ed95c737e pass compile; add void vault code 2020-05-17 21:38:47 +08: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
f50aba8ba6
Fix for Vortex armor set stealth flicker bug
tests on my end showed it fixed, plz confirm as well
2020-01-10 17:55:49 -05:00
Chris
1ae2e34128
Merge branch 'general-devel' into player-data 2019-03-30 13:47:33 +10:30
Lucas Nicodemus
70dd72443d Update copyright to 2019 again
Fixes #1658, most likely.
2019-03-29 17:16:37 -07:00
Chris
550967b430
Merge branch 'general-devel' into player-data 2018-12-24 13:57:10 +10:30
AxeelAnder
210c95e5b1 sorted Bouncer and GetDataHandlers, ordered by packet type enum value 2018-10-26 14:06:46 +08:00
AxeelAnder
2ea9a0161b added PlayerZone handler and bouncer, detect lunar towers cheat 2018-10-23 17:22:59 +08:00
AxeelAnder
b9dedd77dc add some anti-cheat code 2018-10-20 18:39:24 +08:00
AxeelAnder
fc38521dbd add NPCAddBuff bouncer 2018-10-20 18:39:07 +08:00
AxeelAnder
6b8f346868 add NPCAddBuff GetDataHandler 2018-10-20 18:29:11 +08:00
Lucas Nicodemus
16ec98f684
Merge branch 'general-devel' into player-data 2018-06-08 09:50:15 -06:00
Chris
9222d8112a Copy pasting is hard 2018-05-22 18:55:59 +09:30
Chris
ae5d508989 Add filtering for packet 96.
Fixes #1605
2018-05-22 18:54:28 +09:30
Chris
658492a164
Initialize PlayerData on connect
This way every player has non-null player data. Should close #1460
Requires testing
2018-05-21 15:12:55 +09:30
Lucas Nicodemus
c06e000997
Merge branch 'general-devel' into regions 2018-05-06 09:07:15 -06:00
Ivan
c71ed3953f Move OnGemLockToggle to RegionHandler 2018-04-29 21:03:04 +02:00
Egor
d5da93563e s/PlayerID/PlayerId 2018-04-27 19:52:20 +03:00
Egor
fd83748b9f Change banning admin name for hardcore bans to "TShock"
Also added some comments and formatting
2018-04-27 10:19:26 +03:00
Egor
1eae5ae671 Remove TSPlayer.InitSpawn 2018-04-27 08:41:57 +03:00
Egor
9ac3dfa228 Make Kick/BanOnMediumcoreDeath behave like their Hardcore equvivalents
fixes #1618
2018-04-27 05:44:22 +03:00
Lucas Nicodemus
569b350cea Update to Pryaxis, 2018 part 2
If there's one thing I learned in this exercise, it's that letting
people add random python scripts to the repo like gpltext.py that
promise to be easier than find and replace is a bad idea.
2018-01-01 02:20:56 -07:00
Lucas Nicodemus
8d934ef08f Update to 2018 2018-01-01 02:17:21 -07:00
Lucas Nicodemus
df4da817b6 Rename Utils.ActivePlayers to something better.
Issues related to ICollections being null led to reverting migrating
this to TSPlayer until a better solution is uncovered.
2017-12-31 01:30:13 -07:00
Lucas Nicodemus
a5cad284a8 Revert "Remove Utils.ActivePlayers"
This reverts commit b613fdcda6.
2017-12-31 01:28:21 -07:00
Lucas Nicodemus
332e6b2518 Remove Utils.GetGroup().
This method duplicates Groups.GetGroupByName().
2017-12-29 08:45:29 -07:00
Lucas Nicodemus
152c67f27c Move Utils.Ban -> TSPlayer.Ban.
Arguably, this is one of the more controversial methods that's being
kept. Because it kicks and bans a target player, it's more useful than
removing it and requiring people to interface with the TShock Ban
Manager directly (not a good move for the future). Whether or not this
method sucks is up for debate, but right now I think it's totally fine
to keep it around in a different location.
2017-12-29 08:00:30 -07:00
Lucas Nicodemus
2f7c146c89 Merge remote-tracking branch 'origin/general-devel' into oop 2017-12-27 19:01:38 -07:00
Lucas Nicodemus
1ea04ffd4f Remove Utils.ForceKick; use TSPlayer.Kick.
Some anti-cheat calls were changed to "You have been Bounced." I don't
think we need to tell clients why they were disconnected so they can
tune their hacks better.
2017-12-27 18:01:53 -07:00
Lucas Nicodemus
b613fdcda6 Remove Utils.ActivePlayers
Duplicated what an array already stored and told us, but added code and
was obscure. It predated TSPlayers existing.
2017-12-26 21:14:16 -07:00
Lucas Nicodemus
793cfcb842 Remove broken noclip detection
See the changelog entry for this. Basically, it's worse to keep
confirmed broken noclip detection in, even if it detects noclip 90% of
the time, because a random hacker can make a better noclip system and
just evade it 100% of the time by exploiting holes.
2017-12-26 20:28:38 -07:00
Chris
530f62c704
Merge branch 'general-devel' into crp 2017-12-24 01:25:37 +00:00
Lucas Nicodemus
6b6cce3640 Patch docs, fix warnings, update changelog 2017-12-23 15:51:09 -07:00
Lucas Nicodemus
ad83c39300 OnPaintWall now uses GetDataHandledEventArgs. 2017-12-23 15:40:14 -07:00
Lucas Nicodemus
6814aabf6e OnTeleport now uses GetDataHandledEventArgs. 2017-12-23 15:35:38 -07:00
Lucas Nicodemus
1ff2d6566b OnPlayerBuffUpdate now uses GetDataHandledEventArgs. 2017-12-23 15:34:28 -07:00
Lucas Nicodemus
cd07aaf62c OnPlayerAnimation now uses GetDataHandledEventArgs. 2017-12-23 15:32:57 -07:00
Lucas Nicodemus
c607ecfe27 OnNPCSpecial now uses GetDataHandledEventArgs. 2017-12-23 15:31:20 -07:00
Lucas Nicodemus
8413343cbd OnPlaceTileEntity now uses GetDataHandledEventArgs. 2017-12-23 15:28:27 -07:00
Lucas Nicodemus
16654cafc4 OnMassWireOperation now uses GetDataHandledEventArgs. 2017-12-23 15:27:00 -07:00