Commit Graph

86 Commits

Author SHA1 Message Date
asofold
85460d5cca Comments (simplify/complement some, add headers). 2016-11-23 21:07:53 +01:00
asofold
ec0d0878d9 Null players. 2016-11-05 22:14:03 +01:00
asofold
2cdf5ae8fb Only check teleport if any packet adapter is active. 2016-11-05 21:15:03 +01:00
asofold
5e2e11dd10 Keep track of the world name in NetData, for use with CatchAllAdapter.
Some packets arrive with a null world for a player, possibly sent by
plugins - thus attempt to use a stored world name.

This is just a hot fix attempt.
2016-11-05 21:13:43 +01:00
asofold
eeb4922ca8 Proper activation check. 2016-06-26 22:25:35 +02:00
asofold
fc24fe529c [BLEEDING] Overall packet spam check for pre-1.9.
Not sure if this really pays, if most people use protocol-support
plugins that limit packets anyway. There could be some future use, e.g.
generic rate limiting with configurable implementation.

Other:
* New methods for RawConfigFile+ConfigManager to check for
AlmostBooleanS.
* Add all net check permissions to plugin.yml.
2016-06-26 22:18:43 +02:00
asofold
2623a1ae5c Add a sequence count to DataPacketFlying.
Set with adding to the flyingQueue.
2016-06-25 10:57:43 +02:00
asofold
a38e63d4a9 Let DataLocation extend IGetPositionWithLook.
(+Implement DataLocation.hashCode.)
2016-06-24 19:15:14 +02:00
asofold
863b89763d [BREAKING] Move more classes around.
This time the focus is on the utilities package.

Possibly used, but not really official API:
* Move block cache to a 'map' sub-package.
* Move RichBounds/RichEntity/Player-Location and TrigUtil to a location
sub-package.

Not really official API, likely not used:
* Move AttribUtil to compat, since it belongs there.
* Split off direction check methods to collision.CollisionUtil.
* Move static BlockCache methods to map.MapUtil.
* Move food related methods from CheckUtils to InventoryUtil.
* Move vehicle/passenger related methods from CheckUtils to
PassengerUtil.

Not breaking:
* Move IdUtil to commons.
2016-06-21 09:56:50 +02:00
asofold
92252a9dc4 [BREAKING] Rename the new DisableListener to IDisableListener.
(Plus call in reverse order of registration.)
2016-06-19 12:29:53 +02:00
asofold
77465b09e3 [BREAKING] Move (registry) interfaces to sub-packages.
This is neither complete nor final. Intentions are to group interfaces
better, rather organizing packages in a flat way.

At some point there will be other major move-arounds, but that'll
hopefully be a point where we have a better idea of where to put what
(...). For now the approach is to move interfaces/things rather where
it's not interfering with profane exemption API use, preferably neither
taking down the top level API layer
(NoCheatPlusAPI). 

Added deprecated interfaces to prevent cncp to break too quickly.

Outlook:
* Classes that are rather only expected to be used internally for setup
will likely get moved around freely.
* Classes that have been added since last release might also get moved
around freely.
2016-06-15 16:13:59 +02:00
asofold
5ec8c2fe56 ProtocolLib: build vs. 4.0.2, reactivate SoundDistance. 2016-06-13 11:27:45 +02:00
asofold
4e91a9d5fc Ready for UEFA EC: GPLv3 headers.
Might need more training still.
2016-06-02 20:33:21 +02:00
asofold
e5713ef93b Ignore null players in UseEntityAdaper. 2016-03-26 00:33:26 +01:00
asofold
0496af0ac1 Use the respawn location. 2016-03-20 11:28:45 +01:00
asofold
46b4641ba5 Expect outgoing teleport after respawn. 2016-03-19 23:01:36 +01:00
asofold
7dcbe3df6b [BREAKING] Create a common interface for per-player debug messages.
Breaking, because it alters Check, CheckListener and BaseAdapter. Not
really meant/possible to be used by external plugins, though.
2016-03-10 22:24:31 +01:00
asofold
9be2cd2400 [BLEEDING] Allow ProtocolLib 3.7 and disable SoundDistance on MC 1.9. 2016-03-02 19:49:02 +01:00
asofold
8985b67668 [BLEEDING] Reduce fp with blockinteract.visible using ProtocolLib.
Not entirely sure this will still protect from anything, shortish:
* Remove cancelling due to coarse pre-checks.
* Rather correct the end location back onto the end block somehow.
* Retry ray-tracing with the pitch and yaw of past flying packets.
* Let the direction check handle the off-too-far part and let people
blame that one for remaining amounts of false positives.

Missing:
* Should confine by distance to last move, perhaps.
2016-01-26 01:53:40 +01:00
asofold
544e1ad14e Switch debug messages to a standard format.
Use check-specific debug methods for convenience.
Add to: Check, CheckListener, BaseAdapter.
Relay to: CheckUtils.

Side effects:
* Remove constructor: CheckListener().
2016-01-25 20:35:43 +01:00
asofold
2fdd9911e8 Log untracked outgoing position. Simplify onPacketSending. 2016-01-18 10:52:19 +01:00
asofold
e82a989119 Use a real queue for TeleportQueue.
Main purpose is to prevent FlyingFrequency false positives with teleport
loops/excess (typically server or NCP set-backs).
2015-12-08 19:18:56 +01:00
asofold
a2cba68b2e Not return here. 2015-12-07 00:03:54 +01:00
asofold
4d3ee38881 Remove the strapackets cancel part, only skip FlyingFrequency on ACK. 2015-12-06 23:53:50 +01:00
asofold
067d6298d9 Do move AttackFrequency to NCPCore. 2015-12-06 17:25:34 +01:00
asofold
1e80b5320a Don't enable EntityUseAdapter on 1.6.4 and before. 2015-11-26 11:20:50 +01:00
asofold
6094bf8ca3 Fix moving/flying packet interpretation for before 1.8. 2015-11-26 11:03:26 +01:00
asofold
556ef2b0cd Set internal dependencies to provided for all the compat modules. 2015-11-25 15:26:32 +01:00
asofold
473ec3873c Set Bukkit dependency to 1.8.8-R0.1-SNAPSHOT, scope to 'provided'.
(That means adding Bukkit as a dependency to several modules.)
2015-11-25 08:58:15 +01:00
asofold
64b4f30696 Set scope to provided for external jars. 2015-11-25 08:47:11 +01:00
asofold
8b1eb86543 Move AttackFrequency and KeepAliveFrequency as checks to NCPCore.
+ Add adapters to "packet-listeners" in feature tags.
2015-11-24 06:36:57 +01:00
asofold
ea0e9e1ade Make FlyingFrequency a standard check in NCPCore. 2015-11-23 07:54:28 +01:00
asofold
7d57e68578 Log null data as "(incompatible data)". 2015-11-23 06:41:22 +01:00
Dan Mulloy
fd2ee45481 Use my maven repo and the latest release of ProtocolLib 2015-11-22 20:29:46 -05:00
asofold
c1cd680108 Feed combined.improbable from net.attackfrequency.
Adds the infrastructure to the TickTask.
2015-11-16 13:05:03 +01:00
asofold
8ff29c2575 Add check: net/AttackFrequency (without improbable). 2015-11-16 12:30:22 +01:00
asofold
0f1a5345f8 Always update last received time. 2015-11-16 09:57:01 +01:00
asofold
af5fbd900a Move prefixes to loggers. 2015-11-15 02:44:01 +01:00
asofold
8de7907522 [BLEEDING] Split off untracked moves. Elaborate on slime blocks.
MISSING:
* Micro move onto ground, fall distance resets before sf check is run.

Done:
* Split PlayerMoveEvent processing to from -> loc + from -> to. Just if
from isn't the same coordinates as player.getLocation. This
reduces the complexity of workarounds.
* You do take fall damage falling onto slime blocks while sneaking.
* Queue bounce effect, only if the move is valid. Skip NoFall then.
* Apply bounce effect once moving up, to allow overriding.
* Cover more odd cases.

Unrelated:
* Use data.debug instead of cc.debug.
2015-10-21 01:13:37 +02:00
asofold
1e70dc0730 Add essential configurability for "stray-packet" cancelling (TP-ACK). 2015-10-18 17:26:43 +02:00
asofold
343b5ac9e3 [BLEEDING] Teleports: Cancel incoming position, until receiving an ACK.
* Queue outgoing positions in order to detect ACK on incoming.
* Since we can't detect relative teleports, positions are only queued,
if they match an absolute location from a teleport event (Bukkit).
* The queue is kept simple: only store the latest position.
* Cancel incoming flying/pos/look until ACK is received.

Missing:
* Are yaw/pitch are ever sent back changed.
* Configuration to turn it off.
* Might use this to just skip all violation handling until ACK.
2015-10-18 16:35:02 +02:00
asofold
b749dfdc42 Fix npe. 2015-10-04 21:51:00 +02:00
asofold
7bcae640e9 Do debug log for block break and place and dig/place packets.
Dig/place is only logged if a debug flag is set in the config, it won't
activate with on-the-fly per player debug logging.
2015-10-03 00:21:37 +02:00
asofold
444fcb9761 Remove cancelling redundant packets, re-organize, debug log flying.
Cancelling redundant packets has to big problems:
* The normal case is to not run in the primary thread.
* For legit players a missed micro move could mean that survivalfly can
not detect ground properly.

Better approaches could be:
* Cancel asynchronous packets if they match the last sent one (only
simple hacks).
* Check for moves passing block borders, request block shapes and such
from the main thread.
* Detect actual cheating or unusual patterns instead.
* Queue packets for processing in the main thread.

Missing:
* Actually detect ACK packets for previous outgoing teleports.
* Do something upon detecting illegal coordinates (asynchronous
disconnect? queue kicking, config).
2015-09-27 21:54:36 +02:00
asofold
f2783cf1f5 Do check for the other types of flying packets. 2015-09-07 01:11:55 +02:00
asofold
866a2248cf Use tabs for all the pom.xml. 2015-08-01 00:58:33 +02:00
asofold
7da874ad66 Attempt to deploy only the final plugin jar. 2015-07-30 11:27:30 +02:00
asofold
ab88b98704 [ProtocolLib] Add several missing sounds to block. Count cancellation. 2015-06-08 13:46:27 +02:00
asofold
81d10a314c Add comment on differing number of bukkit events vs. flying pacekts. 2015-02-16 11:56:15 +01:00
asofold
260ba01246 Use lastKeepAliveTime (NetData) in fight.godmode.
* Update lastKeepAliveTime from KeepAliveFrequency (even if that is
disabled).
* Update lastKeepAliveTime from FlyingFrequency too.
* Allow to test for feature tags efficiently.
2015-02-09 21:59:37 +01:00