Commit graph

4211 commits

Author SHA1 Message Date
Lucas Nicodemus
17d151b8f8 Move HasBanExpired to Bans.RemoveBanIfExpired().
The ban system needs a full rewrite anyway, but this move removes
something from Utils, puts it closer to its operating point, simplifies
the method, and clarifies what it actually does.
2017-12-29 08:32:45 -07:00
Lucas Nicodemus
f06d1fd238 Remove Utils.GetPlayers().
This is a public method that only has two uses in TShock and both of
them are listing players to a player. A foreach isn't rocket science and
this method was originally created just because there was no good object
to iterate on (e.g., a TSPlayer array).
2017-12-29 08:26:51 -07:00
Lucas Nicodemus
48393d60c7 Move SendMultipleMatchError to TSPlayer.
This is a great method for a player to have and not for the Utils class
to have.
2017-12-29 08:15:04 -07:00
Lucas Nicodemus
afdedee1c4 Change Utils.Reload to not take a player.
There are two occasions in the codebase when Utils.Reload is called and
we're competent enough that we can just call the event when the reload
happens. Unrelated note, but shouldn't this event be called prior to
reloading? I've kept it the same to preserve existing behavior, but I
think it should probably happen before the reload event takes place.

Either way, I think this is fine.
2017-12-29 08:04:20 -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
a5a3aae599 Remove Utils.GetPlayerIP() 2017-12-27 19:29:45 -07:00
Lucas Nicodemus
70c8ef548f Fix merge conflict part 2 2017-12-27 19:09:08 -07:00
Lucas Nicodemus
f74a0f6a70 Merge remote-tracking branch 'origin/general-devel' into oop 2017-12-27 19:03:03 -07:00
Chris
934aa806dd
Merge pull request #1587 from Pryaxis/old-code
Remove old, deprecated, and broken code
2017-12-28 02:01:40 +00:00
Lucas Nicodemus
2f7c146c89 Merge remote-tracking branch 'origin/general-devel' into oop 2017-12-27 19:01:38 -07:00
Chris
cd27a981cb
Merge branch 'general-devel' into old-code 2017-12-28 01:55:22 +00:00
Chris
fdab63a496
Merge pull request #1589 from Pryaxis/noclip
Remove broken noclip detection
2017-12-28 01:53:52 +00:00
Lucas Nicodemus
70f22c1e70 Fix Travis 2017-12-27 18:23:11 -07:00
Lucas Nicodemus
fc689dbbc5 Remove TSPlayer.KickAll
" Ivan - Today at 6:20 PM
@ ハクサロ wouldnt TSPlayer.All.Kick() do the trick?"
2017-12-27 18:21:16 -07:00
Lucas Nicodemus
8301d6a6f3 Remove Utils.ForceKickAll; add TSPlayer.KickAll. 2017-12-27 18:07:28 -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
9e91db9ea4 Removed force kick for attempting to use setup
On many servers, players are tricked into running the /auth or /setup
command to get them kicked. This is stupid. Since the system is disabled
anyway, we don't need to kick them.
2017-12-27 17:43:21 -07:00
Lucas Nicodemus
f79c6a2962 Move Utils.Kick to TSPlayer.Kick 2017-12-27 13:00:13 -07:00
Lucas Nicodemus
e705e398e8 Return real nulls as opposed to string nulls 2017-12-27 11:30:39 -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
9648e9ac0c Remove excess space 2017-12-26 20:55:33 -07:00
Lucas Nicodemus
11920cde48 Move Utils.FindPlayer -> TSPlayer.FindByNameOrID.
This makes TShock more OOP like (get the matching players from the
player as opposed to getting the players from a random class that
shouldn't exist).
2017-12-26 20:53:00 -07:00
Lucas Nicodemus
227125199a Merge remote-tracking branch 'origin/general-devel' into noclip 2017-12-26 20:33:22 -07:00
Lucas Nicodemus
7c1c88bc65 Remove residual evidence of noclip detection 2017-12-26 20:30:40 -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
Lucas Nicodemus
cb47240c7e Fix indentation on one line in utils 2017-12-26 20:17:11 -07:00
Lucas Nicodemus
846386f98a Merge remote-tracking branch 'origin/general-devel' into old-code 2017-12-26 20:07:34 -07:00
Lucas Nicodemus
6095eccccc Update changelog to signify removal of deprecations 2017-12-26 20:06:29 -07:00
Lucas Nicodemus
903bd5bb75 Migrate AddBan2 calls to AddBan
No more deprecation warnings on this release #yolo
2017-12-26 20:05:52 -07:00
Lucas Nicodemus
5362389e71 Remove obsolete GiveItem call. 2017-12-26 20:04:22 -07:00
Lucas Nicodemus
656c9afdb2 Remove obsolete Rest event. 2017-12-26 20:03:36 -07:00
Lucas Nicodemus
3e6cc78a2c Remove obsolete GiveItemCheck. 2017-12-26 19:59:53 -07:00
Lucas Nicodemus
4444023b2d Remove deprecated distance method 2017-12-26 19:58:11 -07:00
Lucas Nicodemus
cd80edb2f7 Remove unused, deprecated REST config option 2017-12-26 19:57:26 -07:00
Lucas Nicodemus
0b98ac5fc1 Remove deprecated motd, color code support 2017-12-26 19:54:21 -07:00
Chris
830b1634f2
Merge pull request #1585 from Pryaxis/fix-projectiles
Fix #1584 / Revert "Change Utils.SearchProjectile to return -1 in error"
2017-12-27 02:19:58 +00:00
Lucas Nicodemus
cfe8562e74
Merge branch 'general-devel' into fix-projectiles 2017-12-26 18:31:47 -07:00
Lucas Nicodemus
fddd7b53a9
Merge pull request #1586 from mistzzt/fix-mass-wire
Fix mass wire operation in Bouncer
2017-12-25 08:47:10 -07:00
Ziteng Wang
354d20bc1c Fix mass wire operation in Bouncer 2017-12-25 18:19:48 +08:00
Lucas Nicodemus
f2da3f6c83 Remove index check on Bouncer NewProjectiles
Note: even in the previous iteration of the code the search function
returned -1 if it couldn't find it in the system, which would have made
removal of projectiles by ident and owner impossible because they
weren't found anyway.

Either way, this is related to fixing #1584.
2017-12-24 20:13:53 -07:00
Lucas Nicodemus
f942a6c98a Revert "Change Utils.SearchProjectile to return -1 in error"
This reverts commit e19fd22fe0.
2017-12-24 20:09:12 -07:00
Chris
0082b25533
Merge pull request #1580 from Pryaxis/warnings
Turn off compiler warnings for missing comments in permissions
2017-12-24 01:41:28 +00:00
Chris
39d411d695
Merge branch 'general-devel' into warnings 2017-12-24 01:36:36 +00:00
Chris
babd73d81f
Merge pull request #1579 from Pryaxis/crp
Rewrite TShock.CheckTilePermission
2017-12-24 01:36:21 +00:00
Chris
530f62c704
Merge branch 'general-devel' into crp 2017-12-24 01:25:37 +00:00
Chris
f0770dc96b
Merge pull request #1581 from Pryaxis/better-args
Update GetDataHandlers events to use new GetDataHandledEventArgs.
2017-12-24 01:25:25 +00:00
Chris
1148c3dd76
Merge branch 'general-devel' into warnings 2017-12-24 01:23:24 +00:00
Chris
ad21f39ee1
Merge branch 'general-devel' into crp 2017-12-24 01:23:21 +00:00
Chris
12427aeb32
Merge branch 'general-devel' into better-args 2017-12-24 01:21:26 +00:00
Chris
acfa3412e5
Merge pull request #1583 from Pryaxis/noip
Remove IP reset code in TShock init
2017-12-24 01:19:24 +00:00