Commit graph

3188 commits

Author SHA1 Message Date
Lucas Nicodemus
d0efdc3939 OnItemDrop now uses GetDataHandledEventArgs. 2017-12-23 15:22:29 -07:00
Lucas Nicodemus
5d4a4f7067 OnPlayerBuff now uses GetDataHandledEventArgs. 2017-12-23 15:21:36 -07:00
Lucas Nicodemus
ed1a04b38b OnUpdateNPCHome now uses GetDataHandledEventArgs. 2017-12-23 15:20:35 -07:00
Lucas Nicodemus
82a749c24d OnSignEvent now uses GetDataHandledEventArgs. 2017-12-23 15:17:29 -07:00
Lucas Nicodemus
3b25043d11 OnChestItem now uses GetDataHandledEventArgs. 2017-12-23 15:10:32 -07:00
Lucas Nicodemus
1d0d4750e2 OnChestOpen now uses GetDataHandledEventArgs. 2017-12-23 15:09:43 -07:00
Lucas Nicodemus
df9920564a OnPlayerSpawn now uses GetDataHandledEventArgs.
OnPlayerSpawn's player ID field is now PlayerID.
2017-12-23 15:06:01 -07:00
Lucas Nicodemus
4c3600f58d OnLiquidSet now uses GetDataHandledEventArgs. 2017-12-23 14:36:28 -07:00
Lucas Nicodemus
50104612cf OnNewProjectile now uses GetDataHandledEventArgs. 2017-12-23 14:35:32 -07:00
Lucas Nicodemus
40755192b3 OnPlaceObject now uses GetDataHandledEventArgs. 2017-12-23 14:33:12 -07:00
Lucas Nicodemus
a3ca7f3d0e OnSendTileSquare now uses GetDataHandledEventArgs. 2017-12-23 14:32:32 -07:00
Lucas Nicodemus
f0a6ad54a2 OnHealOtherPlayer now uses GetDataHandledEventArgs. 2017-12-23 14:31:39 -07:00
Lucas Nicodemus
c6c4446021 OnPlayerUpdate now uses GetDataHandledEventArgs. 2017-12-23 14:29:16 -07:00
Lucas Nicodemus
649cd453d7 OnKillMe now uses GetDataHandledEventArgs. 2017-12-23 14:28:09 -07:00
Lucas Nicodemus
0543e0b18f OnGemLockToggle now uses GetDataHandledEventArgs. 2017-12-23 14:27:01 -07:00
Lucas Nicodemus
551762f10e OnProjectileKill now uses GetDataHandledEventArgs. 2017-12-23 14:25:30 -07:00
Lucas Nicodemus
fd7b9858df OnPlaceChest now uses GetDataHandledEventArgs. 2017-12-23 14:24:12 -07:00
Lucas Nicodemus
e9931e8740 OnPlayerInfo now uses GetDataHandledEventArgs. 2017-12-23 14:22:45 -07:00
Lucas Nicodemus
0efa2fd648 OnPlayerMana now uses GetDataHandledEventArgs. 2017-12-23 14:21:42 -07:00
Lucas Nicodemus
8bb3b88ab0 OnPlaceItemFrame now uses GetDataHandledEventArgs. 2017-12-23 14:19:44 -07:00
Lucas Nicodemus
c6a5de4398 OnPaintTile now uses GetDataHandledEventArgs. 2017-12-23 14:17:51 -07:00
Lucas Nicodemus
dbadcc6db0 OnPlayerHP now uses GetDataHandledEventArgs. 2017-12-23 14:16:52 -07:00
Lucas Nicodemus
d54af26916 OnPlayerSlot now uses GetDataHandledEventArgs. 2017-12-23 14:14:58 -07:00
Lucas Nicodemus
3f9c0ebbfe OnPlayerTeam now uses GetDataHandledEventArgs. 2017-12-23 14:13:51 -07:00
Lucas Nicodemus
62013c7594 OnPvpToggled now uses GetDataHandledEventArgs 2017-12-23 14:12:41 -07:00
Lucas Nicodemus
301125b2d8 OnTileEdit is now a GetDataHandledEventArgs. 2017-12-23 14:11:47 -07:00
Chris
8a58530fdc
Merge branch 'general-devel' into checkspawn 2017-12-23 12:20:03 +10:30
Lucas Nicodemus
a2e6a06985 Fix local var check accidentally being removed 2017-12-22 10:24:23 -07:00
Lucas Nicodemus
b93bab65d7 Fix automatically disabling all players
In rewriting Disable, I accidentally implemented logic that disabled all
players for having banned armor. This is now fixed.
2017-12-22 10:21:49 -07:00
Lucas Nicodemus
a76144b503 Merge branch 'general-devel' into hackedinventory 2017-12-22 09:43:28 -07:00
Lucas Nicodemus
2d8a02764f Merge branch 'general-devel' into checkspawn 2017-12-22 09:43:11 -07:00
Lucas Nicodemus
91b0ed71a5 Remove connections per IP code. Closes #1577 2017-12-22 09:40:25 -07:00
Lucas Nicodemus
f93ffbc2e7 Implement named args in item stack hack check
This addresses feedback from @QuiCM and @ijwu, who pointed out that C#
allows you to specify the arguments that go into a call during
invocation, which dramatically improves readability.
2017-12-21 23:00:09 -07:00
Lucas Nicodemus
64241a44c7 Move TShock.CheckSpawn to Utils.IsInSpawn
Continuing in the quest to clean things out of the TShock main class,
this moves CheckSpawn out and renames it for clarity.
2017-12-21 19:54:14 -07:00
Lucas Nicodemus
ef1486b78c Move OnGetSection to Bouncer
Bonus: Introduces a new GetDataHandledEventArgs for use in events that
have players, data, and need to be handled.

I was originally going to modify GetDataHandlerArgs, but that comes from
the EventArgs class of args that isn't handled, and changing that to
extend HandledEventArgs would imply we care or check to see if those are
handled and we don't so we're stuck with this implementation for a
teenie tiny bit.
2017-12-21 18:49:29 -07:00
Lucas Nicodemus
f9a1819e26 Update grammar on stack cheat messages. 2017-12-21 17:16:57 -07:00
Lucas Nicodemus
8a43c701a3 Merge remote-tracking branch 'origin/general-devel' into hackedinventory 2017-12-21 16:59:12 -07:00
Lucas Nicodemus
b316ba8200 Move inventory stack hack detection to TSPlayer
Only called in one method, the stack hack detection can move to
TSPlayer as it only ever operates on one player.

In a future commit, this will replace the stack hack detection
OnSecondUpdate() and also set the disabled flag if a player has
a hacked stack when called.
2017-12-21 16:50:20 -07:00
Lucas Nicodemus
7730faf94f Change diction to refer to "saved data" on Disable 2017-12-21 08:22:51 -07:00
Lucas Nicodemus
ea630e5aa2 Rephrase SSC login message to avoid grammar choice 2017-12-20 21:32:56 -07:00
Chris
215970bab2
Merge branch 'general-devel' into checkignores 2017-12-21 13:28:06 +10:30
Chris
97f9de2e4e
Merge branch 'general-devel' into hook-init 2017-12-21 13:18:18 +10:30
Lucas Nicodemus
e1e4f41118 Made disable message for login use specifier 2017-12-20 19:00:16 -07:00
Lucas Nicodemus
97f48d6d41 Renamed TSPlayer.CheckIgnores() -> TSPlayer.IsBeingDisabled()
Since all of the flags it was checking have been demystified, this
is pretty self explanatory now.
2017-12-20 17:42:59 -07:00
Lucas Nicodemus
8e5ee7d286 Renamed IgnoreActionsForClearingTrashCan to conform w/ changes
This just changes IgnoreActionsForClearingTrashCan to meet the
same naming scheme for the rest of the old ignore checks. For
consistency. Consistency is nice.
2017-12-20 17:33:18 -07:00
Lucas Nicodemus
4e186e7375 Replace TSPlayer.IgnoreActionsForDisabledArmor -> boolean
TSPlayer.IgnoreActionsForBannedArmor was useless because it only
stored the last armor/dye a player had. Replaced with a boolean.
2017-12-20 17:29:10 -07:00
Lucas Nicodemus
7efcfd055f Replace TSPlayer.IgnoreActionsForCheating w/ boolean
This replaces IgnoreActionsForCheating in TSPlayer with a new
IsDisabledForStackDetection field that tracks the same basic data.

The previous way we did this was storing a string as the "reason"
why a player was disabled for cheating, but it only stored the last
hacked item stack that caused the check to fail. Since we already
have OnSecondUpdate which notifies on _all_ items, we don't need
to store this info in such a useless way anyway. They'll find out
in one second what they need to remove in a more alarmist way.
2017-12-20 17:19:14 -07:00
Lucas Nicodemus
1ef28dfe0d Replace TSPlayer.IgnoreActionsForInventory => IsDisabledForSSC.
This is the first commit in a series to rewrite CheckIgnores()
into whatever its replacement becomes.

IgnoreActionsForInventory was probably used by the SSC system prior
to when we had in-game support for SSC (ergo, when we just checked
to make sure you had removed all items before joining and worked
our way up in inventory data to track it). I could be wrong about
this though.

Now, IsDisabledForSSC tracks only if a player is shut down due to
SSC, rather than a reason that gets broadcast.
2017-12-20 17:01:55 -07:00
Lucas Nicodemus
3a59280834 Pre-initialize TShock hooks for Register method
Hooks have this fancy .Register method when they're of type
HandlerList<Args> that high made but we never bother to initialize
any of them, so .Register doesn't work because it's null.

This solves that problem by just initializing all handlers. Thus,
.Register works, and thus, you can register hooks with priorities.
2017-12-20 12:35:42 -07:00
Lucas Nicodemus
713dd2614a Fix regression where Bouncer would create dupe items on drop 2017-12-17 12:40:24 -07:00