Commit graph

53 commits

Author SHA1 Message Date
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
quake1337
b1820c1516 Fix spaces lol 2021-05-21 13:54:40 +02:00
quake1337
817dfe26fc Address feedback from @hakusaro about style & documentation 2021-05-21 13:13:06 +02:00
quake1337
658c714ac5 Remove old UpdateServerTileState call, as the new one supersedes it 2021-05-21 12:13:06 +02:00
quake1337
c6dad11a1c Initial patch for advisory-1.
- Remove unused fields from NetTile
- Apply data from packets selectively based on approving context.
2021-05-21 09:53:33 +02:00
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +10:30
Chris
fe5a7ec2e4 Disable STR debugging 2020-11-15 11:06:12 +10:30
Chris
db10bf22e7 Refectoring continued - rename STS Handler to STR Handler 2020-11-13 18:50:54 +10:30
Chris
ca38d64632 The great refactoring! Squares to Rectangles 2020-11-13 17:46:00 +10:30
Patrikkk
530bc95123 RequestTileEntityInteractionHandler - Use object size for building perm check.
This commit will modify the RequestTileEntityInteractionHandler to use HasBuildPermissionForTileObject when checking for building permissions for Hat Rack and Display Doll to give an accurate response wether or not any part of the object has an overlapping protected region.
2020-06-27 10:22:03 +02:00
Patrikkk
d4e4692d8b Merge branch 'general-devel' into addtileentityinteraction 2020-06-25 13:41:14 +02:00
Patrikkk
89ab7be0f8 TileEntityInteraction - Pass TileEntity object instead of ID in args. 2020-06-25 01:51:30 +02:00
Patrikkk
64e61b8ed9 Add DisplayDollItemSyncHandler
In a previous PR I have added the tile entity request packet handler which checks for building permissions to prevent the unauthorized player to open a DisplayDoll and see its content.

This Handler is being added to prevent *Hackers* from modifying a DisplayDoll through direct/crafted packet sending, or by sending raw byte data to the server.
In a valid enviroment, the player couldn't even get to see the content of the doll in the first place, to then try to modify it's items.

Because of this,  I do not bother with making sure the player gets their item back.
2020-06-19 14:21:45 +02:00
Patrikkk
972483340a
Merge branch 'general-devel' into addtileentityinteraction 2020-06-18 23:57:40 +02:00
Rustly
0a01ae6d83
Merge branch 'general-devel' into general-devel 2020-06-18 16:53:14 -05:00
Patrikkk
bb20626203 Add building permission checks for Hat Rack modification.
Keeping this code format to have the code be friendly with us in future updates, as well as display proper rejection message to the players.
2020-06-18 17:32:08 +02:00
Patrikkk
c418dda42c Add RequestTileEntityInteractionHandler. Check Mannequin modif perms.
Users can no longer open a Mannequin if they do not have building permissions at the position of the Mannequin.
(Mannequins work as a chest since 1.4)
2020-06-18 17:08:14 +02:00
Rustly
01bae0475d apply the rest of fixes for snake flute, prevent players from seeing the npc perm error on join 2020-06-15 13:32:42 -05:00
stacey
4949410cfa
minor grammar update 2020-06-13 13:26:34 -04:00
Chris
b633f60567 Resolve STS issue #1999 2020-06-10 13:27:33 +09:30
Patrikkk
5decc50bd9 Bouncer OnNewProjectile - Add checks on directional projectiles.
**This commit does not have any effect on actual gameplay as of current project state, but it does let valid projectile creation pass through instead of getting caught up in Bouncer. That catch is currently disabled for the time being, until all valid projectile creation check is added.**

Things would have get caught up in our bouncer eversince 1.4. We commented out the catch (the disable and handling) for now, but none of these new projectiles were added to let them pass.
Renaming stabProjectile to directionalProjectile. Adding staffs to directionalProjectiles
Adding check for GolfClubHelper projectile.

Left in a debug check for golfball projectile. I would want to see if the reject gets triggered in a proper server enviroment. I didn't want to handle the projectile just yet.
Adding GolfBallItemIDs list in Handlers.LandGolfBallInCupHandler.cs
2020-06-09 14:04:27 +02:00
Chris
c99deae9cc Add some sanity checking around tile object sizes 2020-06-05 12:16:24 +09:30
Chris
fe4679ba95 Remove invalid dictionary entries in CreativePowerHandler 2020-06-04 19:40:41 +09:30
Patrikkk
7487afafb6 SyncTilePickingHandler - Remove redundant check. Properly document method. 2020-06-02 19:26:25 +02:00
Patrikkk
e738d8e794 Implementing SyncTilePickingHandler. Patching tile damage related exploits.
With this packet, players could kick all players by sending invalid world position data.
2020-06-02 19:20:27 +02:00
Chris
7b316f3cd5 Refactor LandGolfBallInCupHandler to use IPacketHandler<TArgs> 2020-06-02 19:35:53 +09:30
Patrikkk
f9c59bb023
Merge branch 'general-devel' into handlegolfpacket 2020-06-02 11:53:32 +02:00
Patrikkk
d919c11add
Merge branch 'general-devel' into handlegolfpacket 2020-06-02 11:52:32 +02:00
Chris
9dff07e6c2 Refactor EmojiHandler to implement IPacketHandler<TArgs> 2020-06-02 19:18:43 +09:30
Patrikkk
3cc8a75b9b
Merge branch 'general-devel' into emojipacketevent 2020-06-02 11:21:19 +02:00
Patrikkk
acdbfecaf1 EmojiHandler - Adding requested PR changes. Changing debug message. Fix wordings. 2020-06-02 11:20:04 +02:00
Patrikkk
f7a8695c8f
Merge branch 'general-devel' into handlegolfpacket 2020-06-02 11:15:17 +02:00
Patrikkk
f674e78308 LandGolfBallInCup - Use ConsoleDebug. Modify display message. 2020-06-02 11:13:02 +02:00
Chris
c7a6d044f4 Minor refactors 2020-06-02 17:19:00 +09:30
Chris
c9b015027d Rename NetModulesTypes to NetModuleType 2020-06-02 14:28:09 +09:30
Chris
292f310f69 Publicise these handlers 2020-06-02 14:20:03 +09:30
Chris
961c6cd9bc Clean up NetModulePacketHandler a little 2020-06-02 14:18:22 +09:30
Chris
0af69e2bf2 Add ambience handler 2020-06-02 14:17:13 +09:30
Chris
77d04ca4ec Message adjustment 2020-06-02 14:08:07 +09:30
Chris
3b6a9ffcc2 Add bestiary handler 2020-06-02 14:06:18 +09:30
Chris
1c0a649a0c Add handling for liquid net module 2020-06-02 13:34:26 +09:30
Chris
48d610d33f Move netmodule handling into handlers namespace
Add handler for teleport pylons, and permission for teleport pylons
2020-06-02 12:59:14 +09:30
Chris
4d1fd54a7c
Respect tile bans for tile objects in send tile square handler 2020-06-02 12:55:46 +09:30
Chris
5b72ff6c0a Add IPacketHandler 2020-06-02 10:44:10 +09:30
Patrikkk
c94d15e634 Commit EmojiHandler.cs and register OnEmoji hook. 2020-06-01 15:31:45 +02:00
Patrikkk
f538ceb793 Adding EmojiHandler to handle an exploit. Adding sendemoji permission and checks.
I know, this is not something important, but I'm going through the new packets one by one and adding events developers can work with, patching exploits, and thought this could be a core permission.
2020-06-01 15:24:02 +02:00
Patrikkk
4944ee3144 Implement Handler.LandGolfBalInCupHandler and handle packet exploits.
Added multiple checks to prevent clients from sending the golfball packet directly, without having golf play actions.
2020-06-01 12:59:40 +02:00
Chris
9fb27543b9 Some refactoring from feedback 2020-06-01 18:35:58 +09:30
Chris
0770e3d125 Comment out dangerous debug code 2020-06-01 16:42:11 +09:30
Chris
e030d54bd6 Fix trapdoors too 2020-06-01 16:40:34 +09:30