Commit Graph

591 Commits

Author SHA1 Message Date
asofold
14049200a2 Keep adjusting time and offsets in raytracing.
* Not actually a fix for anything we encountered.
* Nailed down blockinteract.visible raytracing issues to bad end-points
for raytracing.
* Also test/prepare logging test-cases for raytracing in general. Not
enabled, because we should have some flag/permission/command to check
before logging ~ 5KB per interact event.
2015-06-30 01:04:45 +02:00
asofold
0d7d179853 Add a config option to log all violations only for debugged players.
This makes logging all violations potentially useful to use alongside
with the "ncp debug player" command in production environments. The flag
debugonly must be set with at least one backend being activated.
2015-06-07 23:46:27 +02:00
asofold
f9a2172340 Add ability to log all violations. Do cleanup NCPHookManager on disable.
Similar to TestNCP but reduced/different features:
* Config: trace for the log file and notify to send to notify channel.
* It's not possible to confine whose messages you receive (yet).

Meant for better local/quick testing in the first place.
2015-06-07 20:43:51 +02:00
asofold
dce27260e4 Indicate that we have another CHOICE here. 2015-06-06 23:03:57 +02:00
asofold
79ed68efbd Change compatibility module config: allow disabling CB modules. 2015-06-06 22:30:37 +02:00
asofold
2f50cca03d [BLEEDING] Fixes and additions for the compatibility layer.
* Make attribute methods consistent (remove the sprint boost modifier
from the generic speed multiplier, because it's inconsistent).
* Add missing implementations.
* Adjust default sprinting speed modifier.
* Add more guards for the latest compat module (1.8_R3).
* Add a reflection based compat module for CB, to cover minor updates.
* Possibly other minor fixes/changes.

[Hail "insufficient data written"!]
2015-06-06 16:14:36 +02:00
asofold
431099cd3c Reset the joinOrRespawn flag in more cases.
* Vehicle leave, enter, move.
* Teleport.
2015-05-31 23:51:27 +02:00
asofold
6d6f908512 Add workaround for inexact login/respawn locations (vertical).
When the respawn/login location is obstructed, the respawn event shows
that location, but the first move will start at several blocks above,
without having a teleport event to rely on, thus this workaround.
2015-05-31 23:05:53 +02:00
asofold
4a81664101 Log death and respawn/login locations to TRACE_FILE. 2015-05-31 21:55:56 +02:00
asofold
70ce2086ab Let target switching only count with significant yaw changes. 2015-05-31 20:35:08 +02:00
asofold
35a9171934 Correct javadocs. 2015-05-31 19:56:38 +02:00
asofold
40b919935f Disable conflicting velocity invalidation.
This leads to trouble with high jumps, e.g. with slimes. Halfing the
freedom after counter runs out has to do for the moment.
2015-05-31 00:58:34 +02:00
asofold
c9468cd861 Log tags, if updated after violation handling. 2015-05-30 23:53:58 +02:00
asofold
cb62547fc0 More complete go on speed attributes.
* Undo the sprint boost modifier until we add it (minimize code change).
* Implement methods for MCAccess implementations down to 1_6_R1.
2015-05-30 02:22:49 +02:00
asofold
2450636f3c [BLEEDING] First go on generic speed attribute support. 2015-05-29 00:33:16 +02:00
asofold
a259f90d66 Prepare more on friction: Split off setNextFriction, distinguish h/v.
Vertical velocity handling can be much simplified (and possibly extended
to including downwards velocity) with using a friction-based modeling.
Absolute envelopes can still be checked extra, where appropriate.
2015-05-28 23:39:15 +02:00
asofold
9a79b85599 [BLEEDING] Allow friction based horizontal speed-decrease in water.
Still uses a little bit of the buffer, but much less. In essence this
allows rather more h-speed than before, based on friction.
2015-05-27 01:00:43 +02:00
asofold
9aa315360b Adjust friction factor for bunny hopping decrease to match air (@Iceee). 2015-05-26 23:22:44 +02:00
asofold
ddf4c305a1 y ~ pain. 2015-05-25 08:51:14 +02:00
asofold
d6ec0c332a [BLIND] Attempt to fix double-jump issues. 2015-05-24 22:13:06 +02:00
Iceee
805fafbe4e Require from to be on the ground before we slow movement speed for sneaking or blocking 2015-04-19 15:29:22 -05:00
asofold
7ae63211c2 Reset bunny if low jumping is legit (experiment for 2-high places). 2015-04-12 01:41:19 +02:00
asofold
393787e2e3 Fix logic of velocityTick as suggested by @Iceee. 2015-04-11 01:18:50 +02:00
asofold
aa147f692b Add framework for (debug-) logging map parts with ray-tracing / cuboids.
Not very efficient in terms of code-output, but enabling us to log test
cases for visible (and potentially passable too), using real-life
examples.
* Add the capability to log a FakeBlockCache as java code.
* Add utility to record map parts (cuboid, ray-tracing with margin) to a
FakeBlockCache.

Missing:
* Actually log stuff (visible).
2015-04-11 00:57:33 +02:00
asofold
9e7736963f Use TrigUtil for coordinate comparison. 2015-04-07 23:07:57 +02:00
asofold
5b27f62223 Move DebugUtil to a debug package inside of the logging package. 2015-04-07 23:02:12 +02:00
asofold
1510f01144 [BLEEDING] Fixes and refactoring for vertical velocity handling.
This is not the thing (lots of yet), but it is a small step.

Refactor:
* Use access methods for several details on vertical velocity.

Fixes:
* Dont reset the current jump phase if there is vertical freedom left,
because the next jump might then cause a violation.
* Fix clearActiveVerVel (remainder used to clear hVel, yet unused).
* Clear vertical velocity on removeAllVelocity (!).
* Keep setting sfDirty if velocity is found, to prevent premature reset.

Missing:
* Some resetting conditions for sfDirty might be missing.
* Implement an error counter increasing with velocity-add by 1.0 or
slightly more , decreasing with violations, but undo violations if count
is > 0.0. Use at least for vertical accounting, in order to go stricter
on cheating with velocity.
* Revise setting sfDirty on horizontal velocity as well.
* Switch to AxisVelocity (vertical), accounting for + and -.
2015-03-29 03:19:35 +02:00
asofold
4180d3b20b Let fight.direction use the location trace (simplified version @Iceee).
Allow 15 ticks total latency (2 x attacker + 1 x damaged) for the
looping, decrease tolerance for direction by a lot.
2015-03-26 23:29:42 +01:00
asofold
dc1f5eced5 Fix an issue with the maxphase detection.
Ignore if sfDirty is set, ignore falling, ignore bunnies.
2015-03-26 22:44:40 +01:00
asofold
45e5ae8cf3 We work with doubles there, use 0.0 values where appropriate. 2015-03-22 00:54:09 +01:00
asofold
e1385f2aba [BLEEDING] Attempt to fix and extend the Angle check.
* Use a LinkedList for storing past locations (prevents overriding if
t_last = t_now, also allows storing differences there right away).
* Calculate the yaw difference vs. the maximally possible value (180).
* Add switching the target as an extra weight.
2015-03-22 00:07:25 +01:00
asofold
e0318a6df3 [BLEEDING/INSTABLE] Recode blockinteract.visible/ray-tracing.
The workarounds in InteractRayTracing and using multiple
reference-targets in Visible have all been removed in favor of using the
actual looking direction for ray-tracing.

On quick testing, there remain false positives, allowing to somewhat
escalate violation levels, if intended to. On normal playering false
positives seem to happen very near the very edges between blocks on
occasion.
2015-03-13 01:14:40 +01:00
asofold
f87873ba04 Remove blockinteract.speed debug feedback message. 2015-03-12 16:59:12 +01:00
asofold
9c75a07378 AutoSign: Allow skipping empty signs. 2015-03-11 22:19:21 +01:00
asofold
0973149f0f Spaces/comment. 2015-03-11 21:58:00 +01:00
asofold
a5d6594591 Fixes, more tests and more to do for RayTracing.
* More tests for PassableRayTracing (room, rays from outside).
* Alter InteractRayTracing to account for the block interacted with.
* Added tests for InteractRayTracing.

Problems:
* RayTracing may end x-th digit off target, thus in the wrong block.
Suggested fix is to keep correcting t by the absolute coordinates of the
blocks, i.e. calculate the absolute position rather than adding up.
* InteractRayTracing with strict set to false (like in the
blockinteract.visible check) will be too lenient with 1-thick wall
setups and fail test cases.
2015-03-11 11:36:12 +01:00
asofold
2e4a47f3c1 Remove unused option, clean up or and clarify some comments.
The secondaryPassSingular option doesn't seem to make much sense in case
of triple-transitions (6 secondary ones).
2015-03-09 11:40:38 +01:00
asofold
e871d205f6 Let RayTracing test all combinations of transitions for all axes.
Previously only "random" transitions were taken, for simplicity. For the
sake of better debugging and consistency we check all combinations of
transitions now, calling the iteration with all transitions done at once
the "primary line", while calling step with a subset of transitions done
would be the "secondary line".

Currently an iteration might still end x-th digit off the target, so it
does not necessarily end on the target block itself. This is not a
problem for passable, but might be one for interaction and other
applications, thus this should be fixed at some point.
2015-03-09 02:15:02 +01:00
asofold
e0f7e53c57 Skip fall damage penalty, if no damage would have resulted previously.
To avoid cheaters accumulating velocity dealt by damage, we skip dealing
fall damage, if they would not have received any, without taking the
current move into account. This is only for the case a player causes a
violation for which NoFall would usually have dealt fall damage.
2015-03-08 21:17:31 +01:00
asofold
84d47e52b9 Hot-fix passable, for reducing false positives.
Prevents iterating too far, at the cost of skipping some testing.
2015-03-08 02:47:46 +01:00
asofold
d564cf17e9 Attempt to fix a ray-tracing issue. 2015-03-07 03:07:48 +01:00
asofold
0932edd6ee Another edge case of lost-ground (ascending + step-up when sprinting). 2015-03-06 02:05:18 +01:00
asofold
48b7bca266 [CRITICAL] Fix checking for exemption (Check.hasBypass). 2015-02-18 14:01:07 +01:00
asofold
56a9eecab3 Cache permissions for net checks. 2015-02-16 13:13:57 +01:00
asofold
25e1e392a0 Spaces, formatting. 2015-02-16 13:05:40 +01:00
asofold
7ab21d9e72 Let APIUtils.needsSynchronization include NET, use a HashMap, add tests. 2015-02-16 13:00:27 +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
asofold
de3b95de5d More on ActionFrequency.
* lastUpdate is always set calling update().
* Negative diff can not affect update (time ran backwards).
* Use lastUpdate instead of lastAccess where appropriate.
* More comments/formatting.
2015-02-09 18:02:24 +01:00
asofold
85dcb33a98 Add KeepAliveFrequency check, add missing @GlobalConfig.
Limit the number of keep-alive packets to one per second.
2015-02-09 16:55:38 +01:00
asofold
86803af59a Catch asynchronous events from ProtocolLib. 2015-02-07 22:57:52 +01:00
asofold
890442178d Random fixes for CreativeFly. 2015-02-06 02:27:23 +01:00
asofold
e0a8ef21d6 Revert module dependency versions to 1.1-SNAPSHOT.
(LATEST would use the old static ones.)
2015-02-06 02:05:48 +01:00
asofold
eeaa9ac1cc CreativeFly: Use per-game mode flying settings. 2015-02-06 02:04:34 +01:00
asofold
a7127336a8 Use LATEST as version for internal dependencies. 2015-02-04 23:42:05 +01:00
asofold
c1c7e83bde Catch IllegalPluginAccessExcption with scheduling logging tasks.
While we can/could control which stream to log to within onDisable, we
should still assume that an asynchronous task could be using the logging
system. Since we don't have a clean entry to onDisable, we have to catch
the exception.
2015-02-04 21:29:29 +01:00
asofold
2cecd50961 Change all "static" pom versions to "1.1-SNAPSHOT", to allow deploy. 2015-02-04 18:49:52 +01:00
asofold
3cdbab6877 Javadoc corrections. 2015-02-03 12:28:10 +01:00
asofold
a1ee0a43d4 Add blocking to debug output, add server-side velocity last. 2015-02-02 22:32:54 +01:00
Iceee
fa96caf125 Return false so that we can continue through the trace 2015-01-31 15:41:18 -06:00
asofold
3f0644930a Do update the moving trace. 2015-01-31 00:17:37 +01:00
asofold
ce406f3280 Conistent order. 2015-01-30 23:37:41 +01:00
asofold
c0de7d0306 Merge pull request #32 from Iceee/master
Fix fight.direction: pass the attackers location to the loop check.
2015-01-30 21:50:29 +01:00
asofold
586013a907 [BREAKING] Simplify Check.executeActions, remove getParameterMap.
* The primary thread is now detected in Check.executeActions.
* ViolationData.chainParameter allows for one-statement action-execution
with chaining.
2015-01-30 21:12:40 +01:00
asofold
86732764e3 [BLEEDING] Integrate net checks into the check system.
* Extend CheckConfigFactory with a remove-all method.
* DataManager.clearConfigs() now uses CheckType for getting factories.
* Split off Check.hasBypass method to check exemption + permission.
* Allow null permissions in CheckType (interpret as no bypass).
* Add Check types for FlyingFrequency and SoundDistance.
* Add exemption and actions to FlyingFrequency, alter defaults.
2015-01-30 16:10:43 +01:00
Iceee
7d6416d0f9 Fix the direction check 2015-01-29 22:33:01 -06:00
asofold
b3fa312ceb Remove several deprecated interfaces and methods. 2015-01-27 12:54:09 +01:00
asofold
f3973cd043 Move the net package inside of checks. 2015-01-27 00:52:28 +01:00
asofold
52d46450e2 Partly cleanup handling moved paths.
* Add a test for moving a simple config value (not sections).
* Add a flag to @Moved to allow explicitly skipping sections.
  (Should enable moving values into a child path of the previous one.)
* Don't set values before inside of processMoved...
2015-01-25 03:18:40 +01:00
asofold
be68ecba60 Move logging.debug config path, don't log "consistency checks run".
Move logging.debug to logging.extended.status, because that section will
contain more entries, e.g. for logging all violations.
2015-01-25 03:18:24 +01:00
asofold
1bc280eee5 Cleanups (imports, typos). 2015-01-25 02:13:19 +01:00
asofold
8624a9aa01 One more case for version detection. 2015-01-21 20:34:08 +01:00
asofold
f8cbe404f5 Alter FlyingFrequency to match redundancy vs. MovingData (toX, ...).
First attempt to detect if a moving event would fire. This might not be
100% accurate, as a) we can'T really know and b) lastTo is not minitored
in the most reliable way (e.g. teleport on highest priority, resetting
logic favors set-backs).
2015-01-21 01:45:54 +01:00
asofold
f79cda4442 Optimize FlyingFrequency, add more structure and comments.
* Use a HashMap for data, as we intend to use the primary thread.
* Move redundant move checking into a method.
* Ignore on-ground, if it is sent too often.
* Log if redundant move checking has to be disabled.
2015-01-20 18:10:37 +01:00
asofold
a09917571b ADapt 1.7.x pickaxe block break timings. 2015-01-19 23:27:23 +01:00
asofold
a2438537db Add missing strings entries. Fix some of the order. 2015-01-19 21:41:27 +01:00
asofold
7dc6a5d482 Quick fix for item eggs on entities, allow item frames. 2015-01-19 21:13:56 +01:00
asofold
4e5dce0722 [BREAKING] Add option to remove players exemptions on join and leave.
The option is enabled by default, thus it might break something.
2015-01-19 17:49:18 +01:00
asofold
33cd10826d [BREAKING] Switch ExemptionManager to UUID use.
Removes access by name and entity-id for now. Access by name might be
re-added, though any kind of mappings will likely be maintained
somewhere near DataManager.
2015-01-19 17:19:30 +01:00
asofold
e6e8bf7222 Provide a utility method for the "inspect player message". 2015-01-19 16:50:19 +01:00
asofold
22bba239a5 Note VoxelMap mod too. 2015-01-19 13:48:23 +01:00
asofold
a2e41452e7 Remove fight.knockback.
Measuring the time from sprint to attack doesn't work well. The
ctrl-sprint thing also adds to it. Better would be measuring the
toggle-sprint frequency and possibly combine it with some other measure
(packet level attack frequency?) then rather deal attack penalty time.
2015-01-19 13:45:07 +01:00
asofold
0fa307a8df Add a check for creating books with more than 50 pages. 2015-01-19 02:52:02 +01:00
asofold
6de0ea94bb Improve java docs. 2015-01-17 04:56:49 +01:00
asofold
a4240dcb69 Ensure to detect the Minecraft version from the spigot server string. 2015-01-17 03:28:58 +01:00
asofold
40d3328c87 Add more skipping conditions to fight.critical.
* Skip if sfDirty is set (vertical velocity).
* Don't count lowjump if it's not meant to count.
2015-01-17 03:05:49 +01:00
asofold
00c028c609 Correct premature wording. 2015-01-14 00:25:51 +01:00
asofold
cf006ff6d6 Attempt to fix knockbackvelocity.
* Use positive vy always.
* Use full force along horizontal axis always.
* (Always apply, because events only fire when they count.)
2015-01-13 23:01:23 +01:00
asofold
0560daa16f Fix horizontal velocity logic issue.
One axis may have 0 change.
2015-01-13 22:50:07 +01:00
asofold
c63008efb3 Always apply knockback, once set.
All events that fire also would count, thus we apply velocity always.
2015-01-13 01:58:38 +01:00
asofold
972d97ee82 Dump block properties only to the file. 2015-01-13 01:50:22 +01:00
asofold
d2da3f1e9e Add Minecraft version detection and version-dependent default values.
We can now decide on base of the Minecraft version, which value to use,
with the config entry set to "default". Used with
pvp-knock-back-velocity and enforce-location (first move exploit).

Activated features are shown in the version info ("ncp version"). The
version info is now logged to the log file after post-enable and after
reloading the configuration.
2015-01-12 21:57:06 +01:00
asofold
02a95f6cab Quick attempt to make spectator mode almost work (not fly speed yet). 2015-01-10 04:07:07 +01:00
asofold
dd87ab7ccd [BLEEDING] Net checks: Cancel redundant flying packets. Better config.
FlyingFrequency: if frequency is above 20/sec, redundant packets will be
cancelled (experimental, configurable).
2015-01-08 03:35:25 +01:00
asofold
03eb652dd9 Adjust block break timing for 1.8 (ladder, banner). 2015-01-08 00:57:04 +01:00
asofold
64ef133f28 Test FileLoggerAdapter before use. 2015-01-07 23:42:08 +01:00
asofold
b0b898b9f9 Fix up some width and height calculations (low jump, workarounds). 2015-01-06 04:05:11 +01:00
asofold
6c83ebb02b Sharpen low-jump detection (box for detection, prevent improper reset). 2015-01-06 01:42:12 +01:00
asofold
7521f0169f Prevent too easy abuse of bunny-hop delay resetting. 2015-01-06 00:48:41 +01:00
asofold
34a5b2a089 More robust file logger creation, allow "" or "none" to not have any. 2015-01-05 23:02:00 +01:00
asofold
bd5794d0bd Spaces. 2015-01-05 22:07:04 +01:00