Commit Graph

2768 Commits

Author SHA1 Message Date
asofold
b2aae768b6 Support (wildcard) exemption by meta data 'nocheat.exempt'.
This is a first version without any safeguards and without any settings.
A player who has any meta data for 'nocheat.exempt' is regarded exempt
from all checks. Suggestion is a boolean value (true), but setting
anything will do for the moment. Later String values or List<String>
might be supported to allow some kind of generic categories for
exemption (to be discussed with skill plugin developers).

 This is not meant for permanent marking, but rather for "extra" events
like area damage with entity.damage(amount, damagerPlayer). The plugin
setting the metadata should also remove the metadata. In order not to
remove all protection by NoCheatPlus, plugins should fire extra events
or cancel events on a higher priority level than EventPriority.LOWEST.
2015-12-21 22:52:09 +01:00
asofold
d3778bb67c Check for base allowed distance instead of actual in some places. 2015-12-20 22:29:02 +01:00
asofold
ea9198c6fe Set thisMove.flyCheck as early as possible. 2015-12-20 00:45:44 +01:00
asofold
b7af1be275 Store allowed base + actual hDistanceS in MoveData, use on bunny.
To be continued: 
* Relating to the 'allowed base distance' for horizontal moving allows
to judge speed without taking friction or bunny-hopping into account.
* Make use in bunny hop (seems to make 2-high ceiling + sprint jump a
little better).
* Later more workarounds should be confined to a minimum, using
MoveData.
2015-12-19 22:32:11 +01:00
asofold
aaa7f635ab Move more properties to MoveData.
* Namely walkSpeed, downStream.
* SurvivalFly: Alter method signatures to use thisMove rather.
* MoveData: Only initialize the necessary minimum.
* Add MoveData.alwaysInvalidated, to indicate random future purpose.
2015-12-19 19:37:38 +01:00
asofold
3cfa6cfb06 Invalidate currently processed move, if a teleport happened.
Should only be possible to happen, if an actions entry doesn't use 'ncp
delay ...' for teleporting, or if a hook teleports the player (both
discouraged).
2015-12-16 18:39:36 +01:00
asofold
16a1e08f57 [BREAKING] Use MoveData for more 'last123'-type properties.
Does break use of MovingData for last coordinates and distances (not
officially exposed API).

Other changes:
* Position resetting on teleport events has been altered.
* Some blocks/methods are guarded by checking for lastMove.toIsValid.
* Possibly other.
2015-12-16 18:08:22 +01:00
asofold
2145a6a0d3 Don't allow item use on blockinteract.speed violations. 2015-12-15 21:12:33 +01:00
asofold
dab3229066 Add hack for slowness + sprint.
Still needs adjustments to only allow this speed on jumping.
2015-12-15 20:50:49 +01:00
asofold
98df033a7c Store if head is obstructed for past moves and make use of it.
Also:
* Rename the walkSpeed constant to WALK_SPEED (nuisance to mix up).
* Alter conditions slightly in some places by using
thisMove/lastMove.headObstructed.

Issues remaining:
* Moderate speed increase with yDist 0 and hDist like 0.35 -> 0.45.
* Transitions head blocked -> not, can trigger hspeed violations.
2015-12-13 23:19:29 +01:00
asofold
cfc2db97f3 Store past moves as MoveData (raw sketch, no change on logic). 2015-12-13 18:48:42 +01:00
asofold
742877dd6d Adjust use of isHeadObstructed.
* Remove extra conditions for from.isHeadObstructed in vDistAir.
* Account for yDistance in more places. Use the maximum of the default
margin and yDistance.
* Add a tag for not setting low jump, due to the head being obstructed.

Fixes:
* Issues with 2-high ceiling with normal ground.

Issues remaining:
* Ice floor + 2-high ceiling.
* Jump/bunny with head blocked, moving to where the head is not blocked.
2015-12-13 16:39:42 +01:00
asofold
532f8e3a4b Tickets are now on GitHub: https://github.com/NoCheatPlus/Issues/issues 2015-12-12 23:48:17 +01:00
asofold
b7825a15f9 Set version to 3.13.5-SNAPSHOT. 2015-12-12 16:07:31 +01:00
asofold
87ba5983e3 Set version to 3.13.4-BETA for release. 2015-12-12 16:06:04 +01:00
asofold
acc3376106 Expect an outgoing teleport for cancelled PlayerMoveEventS.
There is a small chance that other plugin cancel these events. Since the
server ignores event.setFrom for cancelled events and also won't fire a
teleport event, this remains a problematic case.
2015-12-12 15:58:02 +01:00
asofold
bd9f471102 More oddLiquid cases (moving down out of water). 2015-12-12 15:41:19 +01:00
asofold
9dbd721d12 Fight auto-indent. 2015-12-12 14:14:44 +01:00
asofold
71abb63641 Don't add a new entry after merging. 2015-12-12 14:03:31 +01:00
asofold
b0dd8b18ed Update time for stored entries, in case time ran backwards. 2015-12-12 14:02:58 +01:00
asofold
f9f04feee0 Extend margin for PaperSpigot workaround, confine by split move 1.
Add a tag.
2015-12-09 22:14:37 +01:00
asofold
4e0b617bea Add missing return value. 2015-12-09 11:55:25 +01:00
asofold
7db75f4d79 Faster return for packets missing position or look data. 2015-12-09 11:49:19 +01:00
asofold
0fe398c233 Confine PaperSpigot workaround by jumpphase instead of hDistance. 2015-12-09 10:38:04 +01:00
asofold
0ccfe9699f Increase default max age. 2015-12-08 19:24:40 +01:00
asofold
2ac4bc7939 Less comma. 2015-12-08 19:23:00 +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
61d58406f7 [BLIND] Add special case to skip vdistsb to prevent a set-back loop.
~ Observed on PaperSpigot 1.7.10
2015-12-08 13:29:29 +01:00
asofold
0645922ad7 Set version to continued 3.13.4-SNAPSHOT. 2015-12-07 10:48:47 +01:00
asofold
023bddbbad Set version to 3.13.3-BETA for release. 2015-12-07 10:40:33 +01:00
asofold
1c1529c5c8 Fix NPE. 2015-12-07 10:39:47 +01:00
asofold
219f2222ef Set version to 3.13.3-SNAPSHOT for continous thing. 2015-12-07 08:31:54 +01:00
asofold
48f9d24f28 Set version to 3.13.2-BETA for release. 2015-12-07 08:22:27 +01:00
asofold
794fb99d99 Prefer not to use DebugUtil.debug for non-temporary use. 2015-12-07 08:21:23 +01:00
asofold
b2b3ca8dcc Other special cases for water. 2015-12-07 08:18:13 +01:00
asofold
eb3a86857f Sketch block change tracking (incomplete, deactivated by default).
Represents the first "simplistic" approach to block change tracking,
only attempting to make vertical push/pull work.

It seems that we need to add on-ground checking accounting for piston
moves as well, otherwise anything with pistons retracting will lead to
survivalfly violations. Pistons extending and retracting may also
randomly move around players, including dragging them into the piston
block with the bounding box (not center of player).

In order to make on-ground work, we might need to check in another
place, possibly check where resetFrom an resetTo are set. Performance
questions might remain, there might also be a slight redesign necessary,
in order to run some sub-routines more side-effect free, to check
several branches, including after-failure checking.
2015-12-07 07:44:00 +01:00
asofold
dfcc30aed9 Adjust liquid height, fixes jumping on fence with water above. 2015-12-07 07:35:40 +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
1d8d2f66c7 Set ignorestance to true on 1.8 and later. 2015-12-05 21:38:52 +01:00
asofold
a216a940d6 Fixes and tests for LinkedCoordHashMap.
* Default order: order of first put (first put is first on iteration).
* Fix order being done right for all cases.
* Fix linking.
* Override clear.
* Add more tests.
2015-11-30 10:12:44 +01:00
asofold
1053c21e56 [BLEEDING] Partly fix up bunny hop conditions.
Conditions have been warped for some time. Could lead to more false
positives on hdist.
2015-11-29 14:54:24 +01:00
asofold
2e11cdac0b Confine the bunnyhop envelopy by y-Distance further.
* Below 1.7 allow ground-to-ground hop with moderate speed. Might be
there is more speed possible, shortly tested on 1.6.4.
* From 1.7.10 on, hitting the jump envelope or having the head
obstructed is demanded.
2015-11-29 13:04:22 +01:00
asofold
567647fd12 Remove some commented out parts. 2015-11-29 12:36:57 +01:00
asofold
1c07adef1a Account for GROUND_HEIGHT in isPassableWorkaround. Fix end portal frame.
* The GROUND_HEIGHT flag indicates, that players are on ground (and can
walk on) from getGroundMinHeight on, once a block collides. Thus an
extra case for isPassableWorkaround is necessary.
* Set GROUND_HEIGHT for ENDER_PORTAL_FRAME, return the minimal height of
the ENDER_PORTAL_FRAME block for getGroundMinHeight. (Also add XZ100,
just to be sure.)
2015-11-29 09:51:12 +01:00
asofold
7057f8f984 Log getGroundMinHeight, where it differs from maxY. 2015-11-29 09:19:40 +01:00
asofold
56fa75168c Use LogManager or comment Bukkit logger use. 2015-11-29 09:18:58 +01:00
asofold
8cecf230df Legacy compat: Use BridgeHealth for health. 2015-11-29 09:06:27 +01:00
asofold
fdf15fc33e Typo. 2015-11-29 09:03:51 +01:00