Commit graph

783 commits

Author SHA1 Message Date
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
3105a977a4 Add fluid rockets. 2020-05-24 04:37:15 -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
Olink
965361c406 Add a projectile tracker, so that we can allow fluid bombs. 2020-05-24 03:48:08 -04:00
Lucas Nicodemus
a457e8c9ee
Support lava absorbant sponge (fixes #1852) 2020-05-22 23:22:48 -07:00
Lucas Nicodemus
b87f5d0a1b
Fix probable typo in sundail special perm
This check used & instead of && which is technically possible but
probably not the right thing to do here.
2020-05-22 21:11:37 -07:00
Lucas Nicodemus
f227a2a1e4
Add verbose logging to rest of GetDataHandlers
Should help put the nail in the coffin of many 1.4 bugs
2020-05-22 21:06:16 -07:00
Olink
7d83e06e83 Fix the snake flute item. 2020-05-22 18:02:03 -04:00
Olink
836fd1d156
Fix for spawn issues when using SSC and beds
It looks like the only time the client informs the server of the spawn location is via the PlayerSpawn packet. In SSC, understandably, we don't trust any updates from the client if we can avoid it. In this scenario, we have code in PlayerSpawn to check for beds when they attempt to spawn, but no code to handle negative spawn locations. The client sends -1,-1 coordinates when the player has no spawn. We should trust this.
2020-05-22 14:21:15 -07:00
Axeel
56a9e27365
Fix player respawn again (#1830)
* fix respawn time unit, add spawn bouncer, add respawn time config warning

Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2020-05-21 13:37:31 +08:00
鱼鱼
946d54b69e fix player spawn stuff 2020-05-20 21:27:49 +08:00
Lucas Nicodemus
e6df3edeec
Merge branch 'general-devel' into h/betterlogs 2020-05-19 23:02:46 -07:00
Lucas Nicodemus
e20f717269
Remove reimplementation of Terraria player sync
The reimplementation of Terraria player sync was first created by
@Zidonuke when introducing better antihack and the item ban system. He
added this because he was probably attempting to correct the client that
sent that sent bad data. The primary purpose was to send data back to
the client, not necessarily for the purpose of doing anything for the
server. This is demonstrated by the fact that when we added player
update handling, we started rejecting the packets outright and not
sending the player any packets. This means that functionally we don't
run this code hardly ever if someone is actually disabled.

Some of those code was related to /confuse. That is also being removed.
2020-05-19 22:26:46 -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
Lucas Nicodemus
92f8095277
Read extra data for kill portal 2020-05-18 00:00:55 -07:00
Lucas Nicodemus
0a95457a7e
Merge branch 'general-devel' of github.com:Pryaxis/TShock into general-devel 2020-05-17 23:48:55 -07:00
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