Commit graph

931 commits

Author SHA1 Message Date
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
Lucas Nicodemus
61d1bcf93f OnNPCStrike now uses GetDataHandledEventArgs. 2017-12-23 15:24:56 -07:00
Lucas Nicodemus
45c81e960a OnPlayerDamage now uses GetDataHandledEventArgs. 2017-12-23 15:23:26 -07:00
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
Lucas Nicodemus
848d3c4778 Merge branch 'hackedinventory' into crp 2017-12-22 10:18:51 -07:00
Lucas Nicodemus
195a23a7e5 Migrate most of CheckTilePermission to TSPlayer
TShock.CheckTilePermission(ply, x, y, paint) has been replaced with
TSPlayer.HasPaintPermission and TSPlayer.HasBuildPermission
respectively. These two methods dramatically simplify the logic required
to process build permissions.

Still todo after this commit:

1. Implement warnings for when a player fails a permission check on
build. This is probably going to be accomplished by a default argument
to the HasBuildPermission signature.

2. Create a variant that checks for ice tile permission and use like
HasPaintPermission() so as to remove the other
TShock.CheckTilePermission method.

Annoyingly, all of the existing methods that start with Check seem to
"check" if they player _doesn't_ have permission (true = no permission),
which makes nearly every call negative.
2017-12-22 00:31:02 -07:00
Lucas Nicodemus
09121368e4 Move TShock.CheckRangePermission to TSPlayer
TShock.CheckRangePermission is now TSPlayer.IsInRange, but the most
important thing is that this method returns the opposite of what the
original did, so all of the calls that would go to it are now inverted.
2017-12-21 20:32:07 -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