Commit Graph

932 Commits

Author SHA1 Message Date
asofold
fb66ea7335 Refine interact event cancelling.
* Still check cancelled events, if using the block is allowed.
* Allow using food and potions, even if the event is cancelled.
2015-11-20 08:47:55 +01:00
asofold
c08a670288 Add oddLiquid case for moving out of water with velocity. 2015-11-17 01:34:57 +01:00
asofold
6c74fa0cea Pull through lava friction + fixes and changes for friction in general.
Could add an issue or two...
2015-11-16 17:10:32 +01:00
asofold
76ef40f6fb Adjust block height for liquid. 2015-11-16 15:39:56 +01: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
d899334d8f Log fight.speed violations only for higher vls (legacy). 2015-11-16 10:37:06 +01:00
asofold
7286df5875 Also check steps done with the split move. 2015-11-16 02:30:27 +01:00
asofold
2d24049db9 Passable split move: Always test vertical-first, never horizontal-first.
Vertical part first was ineffective due to yDiff never being > 0.0 and
<= 0.0 at the same time, beside vertical-first is what the client is
doing. Might want to check the full bounding box with the simplified
y-first model, also checking x and z parts in the right order, from
there on.
2015-11-16 02:28:18 +01:00
asofold
bbe20a4d84 Config order: captcha before color. 2015-11-15 21:15:55 +01:00
asofold
11811697a5 Fix colors for the ingame chat prefix. 2015-11-15 03:21:47 +01:00
asofold
d62951ade7 Don't use method name shorteners. 2015-11-15 03:18:46 +01:00
asofold
af5fbd900a Move prefixes to loggers. 2015-11-15 02:44:01 +01:00
asofold
528410f6f3 Encapsulate Player instance lookup in a PlayerMap object.
Mostly for legacy Player instance getting, future aims are:
* Efficient lookup by name.
* Efficient lookup by prefixes of names (e.g. for command use).
* Efficient lookup name->uuid and uuid->name.
* Keep name->uuid mappings for history lookup and similar.
2015-11-14 21:34:04 +01:00
asofold
2ac98f7db9 Repair accidental commit of CheckType (throw permissions at'em). 2015-11-13 22:23:11 +01:00
asofold
f3a6ba9cbc Allow to skip commands on captcha. 2015-11-13 22:06:31 +01:00
asofold
b8577e1891 Use ICaptcha and CheckUtils instead of Captcha. 2015-11-13 21:52:41 +01:00
asofold
1fc775219a Add [health] tag for logging, allow health and world be set by checks.
Display health in fastheal and godmode.
2015-11-13 21:46:22 +01:00
asofold
f1c5808cb7 Adjust isEnabled and hasBypass use.
Refactor
* Move hasBypass code to CheckUtils.

Efficiency
* Alter/add methods for testing with with optional check data/config.
* Use more efficient calls in several places (unfinished).

Consistency
* Log an error, if calling hasBypass off main thread unexpectedly.
* (Mostly irrelevant null checks.)
2015-11-09 03:01:18 +01:00
asofold
66070532b2 Revert to using the same vertical friction for lava and water, for now. 2015-11-09 00:39:39 +01:00
asofold
4fd834ed25 Workarounds for moving down (-stream) in lava. 2015-11-09 00:21:47 +01:00
asofold
5d4c71eaae Only count in depth strider with water. 2015-11-08 23:16:03 +01:00
asofold
eef50d0b33 Let lava have a dedicated vertical friction factor. 2015-11-08 23:03:30 +01:00
asofold
22a7492623 Use a higher vertical component for pvp-knockback. 2015-11-07 21:27:06 +01:00
asofold
0a7d4c6d7d Fix vdistrel with head obstructed. 2015-11-02 00:08:01 +01:00
asofold
cb4f1a89bf Allow all speed modifiers to apply with depth strider in water. 2015-11-01 22:22:45 +01:00
asofold
8adab538c4 Add LiftOffEnvelope.UNKNOWN as default, to distinguish from web. 2015-10-26 02:32:36 +01:00
asofold
0febcfef66 Cap bounce effect by last y-distances. Set last h/v dist differently.
This should prevent bouncing higher and higher (cheat).

Missing:
* The bounce effect should be set considering the last yDistance, in
order to allow negative vertical velocity to work.
2015-10-26 02:08:07 +01:00
asofold
bb25a0da0b Workarounds for cobweb and slime blocks.
* Add workaorunds for gravity with exiting cobweb.
* Allow multiple times zero y-distance (cobweb several times, slime 2).

Cobweb may need adjusting the bounding box to check with, instead.
2015-10-26 00:31:35 +01:00
asofold
377689b0bd Also set passable. 2015-10-25 21:24:13 +01:00
asofold
18ddb34ace Use moveInfo.useLoc for player move. 2015-10-25 20:55:51 +01:00
asofold
f578b4da53 More fixes four bouncing off slime blocks.
* The server might reset the fall distance with preceding micro-moves,
so use NoFall data already on checking pre-conditions for bounce.
* Cap the bounce effect slightly smaller.
* Renew the bounce effect under certain conditions.
* Gravity, odds.

Remaining:
* Two consecutive times yDist = 0 at the maximum of a jump.
2015-10-22 12:45:52 +02:00
asofold
16698090fb Fix processingEvents use. Reorder conditions for bounce. Comments. 2015-10-22 03:02:56 +02:00
asofold
6ee9528fe7 Add convenience methods to DebugUtil. 2015-10-22 00:48:02 +02: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
537b387fbf Part-repair slime block trampoline support.
Adjust workarounds, confine velocity activation to next tick.

Cases missing:
* Lost ground cases (yOnGround has been reduced, strikes here).
* Two consecutive yDist = 0.
2015-10-19 01:30:11 +02:00
asofold
4d59f67d34 Switch the default asynchronous CallContext to ASYNCHRONOUS_TASK.
This will preserve the order of debug messages sent from multiple
threads. As a side effect, this might be better for performance, given
that on constant input the logging task will stay registered, so there
is little overhead and the file-io is taken off the asynchronous packet
and chat handler threads.Hopefully the thread switching is less
expensive than the gain by not delaying chat/packet threads, in case of
servers with few cores. We might adapt the used policy later, based on
cores and/or config.
2015-10-18 18:31:52 +02:00
asofold
b179dba908 Ouch(.) 2015-10-18 17:38:06 +02:00
asofold
1e70dc0730 Add essential configurability for "stray-packet" cancelling (TP-ACK). 2015-10-18 17:26:43 +02:00
asofold
0b7a259985 Allow updating set-back, when small-range TP leads to a safe position. 2015-10-18 17:07:24 +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
b6a5d76a44 Add slowness effect level to debug log. 2015-10-11 00:01:28 +02:00
asofold
2c48e0f60d Increase compatibility with more extreme jump effects (see below).
This is a quick go with little testing, roughly up to level 60. Above
that there may be more false positives, also "no jumping" is not
enforced there.

A suggestion for the future could be to just use/part-calculate an array
for all the typical effects.
2015-10-06 13:19:36 +02:00
asofold
52058363ec Adjust expected near-zero gravity behavior for jump effect. 2015-10-06 13:16:25 +02:00
asofold
854f70a10e Remove duplicate cleanup call. 2015-10-06 09:49:52 +02:00
asofold
c3ab80cd74 Reset last distances to Double.MAX_VALUE. 2015-10-06 09:49:10 +02:00
asofold
b21ca2093e Alter bunnyhop preconditions. Remove lostground stairs.
* Don't let doubleBunny bypass other conditions.
* Don't allow bunnyhop when lowjump is set.
2015-10-05 00:02:43 +02:00
asofold
7f8740bf30 Override block height for farmland (soil). 2015-10-04 22:08:10 +02:00
asofold
289d72757b Set a lower Y_ON_GROUND_DEFAULT.
Used to be 0.0625 for a while, but intentions are to cover ground-loss
as lostground workarounds. Later switch to calculate the distance to
ground (with a given max-distance).
2015-10-03 00:40:31 +02:00
asofold
ee2df3f05b Allow normal gravity slope after having been on ground. 2015-10-03 00:29:48 +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
49c08c453a Only check vdistsb if moving upwards and not stepping. Confine vcollide. 2015-09-28 16:56:57 +02:00
asofold
222c6bd537 Add lostground_vcollide.
For efficiency (several?) other cases will be removable, once we model
the per-move ground/medium properties more accurately also for the past
move(s). At least lostground_pyramid should be removed then.
2015-09-28 15:46:06 +02:00
asofold
9efcf01766 [BREAKING] Move maps into a maps package. Prepare a linked CoordMap.
Splits CoordMap into interface, abstract hash map, implementations.
Sketch Linked version, hinting at access order, e.g. with
tracking piston effects with timeouts.

Missing:
* Implementation of a linked version.
2015-09-28 12:56:58 +02:00
asofold
01671a04fd Add yaw and pitch to getLocation. 2015-09-28 00:03:56 +02:00
asofold
95c6af9741 Optimize reset (no need for using per-count locks). 2015-09-27 22:09:11 +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
5f47eab770 Use more fine grained locks. Fix a couple of consistency issues. 2015-09-26 14:13:28 +02:00
asofold
7110d0ecca Adjust breaking times for DRAGON_EGG. 2015-09-24 19:28:55 +02:00
asofold
8230a13fc0 [BLEEDING][BREAKING] Rework much of y-axis handling.
* In addition to the "distance from set-back" check, we have a check of
the per-move distance for in-air checks, taking account of friction.
* In-air and liquid checks should consume vertical velocity once needed.
* Model vertical velocity "exact", i.e. positive and negative, use an
entry once a sub-check fails, quite strict invalidation of not matching
values, matching against the y-distance directly.
* Vertical accounting has been sharpened for the moment. The new
per-move checking might make it superfluous.
* Remove MediumLiftOff in favor of a LiftOffEnvelope carrying basic
lift-off max-gain/max-height/max-phase, enabling to distinguish between
normal lift-off and liquid near ground.
* Rename others (e.g. sfLastYDist -> lastYDist). Thus breaking internal
naming, adding velocity via MovingData still works, but should behave
slightly differently.
* Fixes (waterwalk with head obstructed, resetting of sfDirty, possibly
others).

Issues.
* Edge cases with velocity, water.
* Lava needs friction, at least with velocity.
* Lostground_edge(ydist < 0.0) ->
bunny with yDistance > 0.0. Need more flags or better model for keeping
past moves information.
* Plain ground misses (layered snow).
* lostground with yDist == 0.0, then seemingly in-air yDist== 0.0, then
bunny/lifft-off (similar to above). Needs better modeling of past moves,
because several lostgorund cases mean "the move has been on ground".
Also includes geting the distance to ground for hack-proof set-back-y.
* Vertical velocity is now matched with a margin, because the client
seems to add randomly.
* Possibly new loopholes/exploits (extreme large moves?).
* Cleanup pending.
2015-09-21 00:27:33 +02:00
asofold
f3a137709b Part-revert activating vertical accounting once velocity is used up.
* Don't activate accounting (velocity downwards issue, needs recode).
* Do still check yDirChange once velocity effects are gone.
2015-09-13 14:47:31 +02:00
asofold
b2caae38d2 [BREAKING] Group several classes into sub packages for moving. Renames.
* Group selected classes into sub-packages of moving.
* Rename classes.
* Must use LinkedList for velocity entries.
* Prepare SimpleAxisVelocity + entry for use-once accounting.

(Might not be the final naming.)
2015-09-13 14:39:25 +02:00
asofold
122e0727b8 Losen bounds for edgeasc5/7. 2015-09-12 23:22:23 +02:00
asofold
0a5f590801 [BLEEDING] Re-activate accounting once vertical velocity is used up. 2015-09-12 23:21:13 +02:00
asofold
6d1c56675b Rough coverage of another false postive (edgeasc5 and edgeasc7). 2015-09-12 15:39:00 +02:00
asofold
b288afa6e6 Test for depth strider on all armor items. 2015-09-12 12:37:44 +02:00
asofold
382ecd9f05 Add a lostground case for untracked (micro) moves. Reorder a few things. 2015-09-10 18:34:21 +02:00
asofold
134b8e7b3d Attempt to fix 1st move bunny and couldstep+vdist. 2015-09-10 14:09:13 +02:00
asofold
fbfa11be20 Don't wildcard allow bunny hop (seems not needed anymore). 2015-09-10 13:41:59 +02:00
asofold
ba40cfb6aa Do apply the cap for lostground_edgeasc1. 2015-09-10 11:05:19 +02:00
asofold
3db2484920 Revive lostground-interpolate as edgeasc1, slightly altered. 2015-09-09 13:49:43 +02:00
asofold
d37961ed49 Attempt to refine lostground/edge. 2015-09-09 01:20:37 +02:00
asofold
f2f66c1572 Another special case bunny (@Iceee). 2015-09-07 00:23:45 +02:00
asofold
30abbe0225 [BLEEDING] Remove "interpolate" workaround.
Instead adjust to client-side code, parameters still need adaption.
2015-09-07 00:08:13 +02:00
asofold
8c79309c7d Allow sprinting during flight, disregarding food level. 2015-08-11 18:30:01 +02:00
asofold
389df1aa86 Only ignore the first block of the primary line, if ignoreFirst is set. 2015-08-09 23:39:21 +02:00
asofold
0b89cdd90a Allow sfStepHeight for lostground_step. 2015-08-09 23:37:34 +02:00
asofold
463d16b0fd Demand moving up first for lowjump detection. Refine tag use. 2015-08-09 18:52:55 +02:00
asofold
56d32c4f3e Remove the "bedstep" workaround in favor of a configurable step height. 2015-08-09 16:17:43 +02:00
asofold
c9df8238f7 SF + set-back policy: Set back to void, group "falldamage" here. 2015-08-08 23:22:23 +02:00
asofold
2151d9d365 Adjustments to bunnyhop / bump.
* Use BlockProperties.collides to use the actual bounds of blocks.
* Don't test for sfLowJump to set allowHop.
* Set head bump margin to match 2-high spots and to prevent lowjump fps.
* Tighten conditions for actual hop.
2015-08-01 22:07:36 +02:00
asofold
c5574b5978 Bunny fix and bumping the head into the ceiling, various adjustments.
* Don't x > 1.314 * x.
* Add height, eyeHeight, isHeadObstructed to PlayerLocation.
* lowjump detection: from is higher than to, test both locations.
* Remove bunny reset within lowjump detection (defeated flying bunny).
* Check isHeadObstructed directly in the bunnyHop method.

Issues remaining:
* Moderate acceleration ground to ground, after having landed (+1st).
* Possibly transitions between 2-high and other.
* More edge cases with slowness potion.
2015-08-01 14:47:57 +02:00
asofold
cccbcbb7c8 [FAIL] ... bunnyhop on the first move (or after resetting data).
This seems to be the same value on ground as with slowness potion and
2-step acceleration. Not possible to squeeze into the ordinary bunny
envelope.

On the fly: add PlayerLocation.isOnGroundOrResetCond.
2015-07-31 16:15:23 +02:00
asofold
3448f66e53 Allow stepping onto beds. Activated from 1.8 on, configurable. 2015-07-30 23:46:07 +02:00
asofold
7c194e467e Ensure jump boost calculations don't result in negative numbers. 2015-07-30 01:28:12 +02:00
asofold
e7ec68d33a Use the given config. 2015-07-29 01:29:48 +02:00
asofold
7792f75564 Allow disabling the stance check (checks.moving.ignorestance). 2015-07-29 01:18:43 +02:00
asofold
53021bba98 [BLEEDING] Attempt to simplify/generalize the bunnyhop workaround(s).
Slowness+bunny will still not fully work, because we need to model
closer to the client here, i.e. acceleration and friction. Remaining
issues in rough order of naughtiness:
* On-ground friction based speed decrease.
* Increasing of speed, above slowness sprinting speed but below normal
sprinting speed.
* Two-step bunnyhop, having h-speed increase to bunny with two packets.
Similarly acceleration effects when touching ground, not modeled right
by bunny.
* Possibly more.
2015-07-28 23:08:38 +02:00
asofold
29358f1e64 Workaround a false positive for step with lost-ground. 2015-07-26 16:36:47 +02:00
asofold
9ed57399fa Quick cleanup for horizontal distance estimation.
* Remove early return, as we prefer to know what NCP would allow, at
least until sf changes have stabilized.
* Only count in speed effects for normal running/jumping, not
water/web/blocking/sneaking. Either check potion effects or attributes.
2015-07-26 15:44:42 +02:00
asofold
ca07ecc3ab Attributes: Allow detecting if attributes are available at all. 2015-07-24 23:09:41 +02:00
asofold
c28571166b Don't modify walkspeed by attributes. Allow air friction on bunnyfly. 2015-07-23 23:38:01 +02:00
asofold
135c89ca70 Ensure to reset the (mc) fall distance on ground. 2015-07-23 22:19:59 +02:00
asofold
06eecb704d Correct event priority for knockback velocity accounting (caps).
(Copy and paste, stupid...)
2015-07-20 20:50:26 +02:00
asofold
539e58dd01 Skip pvp knockback stuff, if the DAMAGED player is inside of a vehicle. 2015-07-20 20:44:12 +02:00
asofold
6159f796da Quick go on climbables and step, alter tags (plus random other).
Mainly catches the instant ladder and too large moves, generalize step
to have general "reset" as condition instead of "ground", don't limit by
a distance.
2015-07-19 00:42:14 +02:00
asofold
6e68278245 Add getters for the current main line block. 2015-07-18 20:48:34 +02:00
asofold
953af13405 Another band-aid for the assumesprint workaround. 2015-06-30 12:54:27 +02:00
asofold
75c2f58b7c Don't reset sprint if within latency window. 2015-06-30 01:21:54 +02:00
asofold
6dfb939dbc Only set sprinting time to 0, if time ran backwards. 2015-06-30 01:15:09 +02:00
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
eeaa9ac1cc CreativeFly: Use per-game mode flying settings. 2015-02-06 02:04:34 +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
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
asofold
41e9d89efa Add info about version-dependent features to the "ncp version" command.
* Add methods to NoCheatPlusAPI to add/set/get version tags.
* Display all tags in the ncp reload command.
* Alter test framework to set a dummy API.
* Add tags for blocks, net checks, FastConsume.
2015-01-05 16:34:07 +01:00
asofold
39cc75c162 Spaces. 2015-01-05 15:43:49 +01:00
asofold
473cb518de Optimize SurvivalFly further.
* Still skip hdist checks if hdist is 0 (buy ydist != 0).
* Clear horizontal velocity, if no hdist.
2015-01-04 22:59:44 +01:00
asofold
f0c5552873 [SAFETY COMMIT] Redo with proper assignment (details see below).
Contained changes:
- Melon and pumpkin block break timings: 1.8-specific, keep workaround.
- Don't run all horizontal move checking if no move.
- Utility method for checking for air.
- Some formatting.
2015-01-04 20:06:05 +01:00
asofold
d5632035b4 Javadoc corrections. 2014-12-20 16:32:42 +01:00
asofold
4878991d2d Use CommandUtil to feed commands (as had been intended). 2014-12-18 22:10:45 +01:00
asofold
fb6ac2ad5a [BLEEDING] Prevent noclip using commands with untracked moves.
A cheat client could move such that they are inside of a block, but
CraftBukkit will not fire an event, because the distance and looking
direction don't change enough. Teleporting other players or yourself to
that location would result in getting someone into a block. Consequently
 we also have to block commands like /sethome at such locations.

Our first attempt to patch that will monitor teleports that use the
TeleportCause.COMMAND (might miss out on plugins that are not using the
appropriate cause, and on plugins that use items for teleportation), in
addition we monitor certain commands (configurable prefixes), to catch
things like "sethome" and "sethome2". The world spawn is exempted. Only
teleports into blocks are monitored.

This does not yet sanity-check the distance to the last tracked
location, but it will ignore if none is set.
2014-12-17 20:16:28 +01:00
asofold
ea5b249197 Alter how command lists are interpreted. Might fix some issues.
Details:
* Only trim commands from the left side (both on feed and check).
* Ensure versions with and without leading '/' are fed into trees.
* Move methods to feed CharPrefixTree from configs to CommandUtil.

Potentially fixes (untested):
* Only deny the sub-commands for a prefix, example: feed 'version ' to
consoleonly, in order to allow 'version' but not 'version NoCheatplus'.
* Might fix some plugin/server specific prefixes not being detected,
example: feed "/version" and expect "/bukkit:version" to be blocked.
2014-12-17 18:54:04 +01:00
asofold
c543701610 Passable: Make set-back choice more easy to overview. 2014-12-14 21:16:00 +01:00
asofold
a78f5550a2 Adjust trampoline effect. 2014-12-11 00:22:08 +01:00
asofold
3eab23ae92 [BLEEDING] First attempt to make slime blocks work. 2014-12-10 00:45:08 +01:00
asofold
a51965c57d Skip knock-back for damage events that would not count. 2014-12-08 01:02:37 +01:00
asofold
3739e2a3f5 Corrections for knockback: Ignore vehicles, method naming. 2014-12-08 00:40:53 +01:00
asofold
3c8b255817 Attempt to fix issues with pvp and knockback.
Might disable for older versions of MC
(checks.fight.pvp.knockbackvelocity).
2014-12-07 23:54:49 +01:00
asofold
ec997796b8 Attempt to fix melons for 1.8 (might result in issues with pre-1.8). 2014-12-06 20:06:27 +01:00
asofold
79394c4e0a Allow faster flying with the sprint key. 2014-12-06 01:37:50 +01:00
asofold
935b5a6449 Fix sprinting + depth strider. And modifiers are just modifiers. 2014-12-05 12:40:31 +01:00
asofold
4aa253df6d Back to strings. 2014-12-05 12:05:00 +01:00
asofold
7b51b1ae43 Add depth strider support. 2014-12-05 11:47:34 +01:00
asofold
c0a188d2c1 Make LogManager an interface.
* Some cleanups (spaces, commented out references updated).
* LogManager implement INotifyReload, but gets processed extra (not
added with addComponent).
2014-12-04 15:56:16 +01:00
asofold
5f9764dabc Add command "ncp debug player (player1) ...".
This is the first simple version, just setting debug for all checks for
the player(s). It can only be undone by removing the data, e.g. with
"ncp remove (player)", reloading does it too, but is much heavier.
2014-12-04 03:52:48 +01:00
asofold
256d06b67c Add permissions for JourneyMap/VoxelMap. 2014-12-04 03:09:17 +01:00
asofold
04d2896f7e [API CHANGE] Add debug flags to check data [missing: use that one].
For debug output now data.debug is used instead of config.debug, so the
data is initialized with the config.debug value. As an effect of this,
removing the data or reloading will override flags that have been set by
means of API-access only.

Affected:
* Adds getDebug and setDebug to ICheckData.
* Adds appropriate configs to all constructors of check data.
* Some per-check debug flags have been removed.

Extras: 
* spaces
* import cleanup.
2014-12-04 02:24:20 +01:00
asofold
a2e4db7c94 Fixe fence gates with fence corners (allow checking for further flags). 2014-12-04 01:45:16 +01:00
asofold
c70da72654 Switch to flags for (thick) fences and fence gates. 2014-12-04 01:04:33 +01:00
asofold
3f515cc616 Spaces. 2014-12-01 00:06:57 +01:00
asofold
5dd5f8b87c Remove error markers. 2014-12-01 00:06:41 +01:00
asofold
3cc5aef282 Spaces. 2014-11-29 14:56:05 +01:00
asofold
02ea246ebb Merge pull request #29 from hivemc/master
Block JourneyMap radar and cavemappings, should apply to VoxelMap too.
2014-11-29 14:09:43 +01:00
asofold
c0eceb9473 Fix PermissionUtil/npe (ensure a Permission instance is present). 2014-11-29 02:48:49 +01:00
Youri Kersten
247d256082 Block JourneyMap radar and cavemappings
http://minecraft.curseforge.com/mc-mods/225341-journeymap-server
2014-11-28 16:20:00 +01:00
asofold
a9f9a3dced Prepare more changes to fight checks using (location trace based).
* Use a SharedContext for properties used in all checks.
* Rename (locationTraceChecks).
2014-11-26 22:29:53 +01:00
asofold
5f0c70f138 [BLEEDING] Simplify and (hopefully) repair the criticals check.
* Remove on-ground check.
* Always increase VL by 1, because clients could control it anyway.
* Skip if the player is in a vehicle.
* Remove adapting to lag.
2014-11-26 00:37:52 +01:00
asofold
3dea6580e4 Spaces. 2014-11-25 23:53:17 +01:00
asofold
3b47bde9cf Log precise fall distances. 2014-11-25 23:52:51 +01:00
asofold
6ed52ffda6 Move checks depending on a LocationTrace into a method. 2014-11-25 23:32:46 +01:00
asofold
24ccc4a5ea Spaces + comments, modifier. 2014-11-24 15:47:52 +01:00
asofold
8b55139003 Regroup default loggin initialization. 2014-11-24 15:08:32 +01:00
asofold
379cb159dd ASYNCHRONOUS_DIRECT is enough. 2014-11-24 00:45:31 +01:00
asofold
8a03de1315 The server logger should be considered thread-safe by default (log4j).
To be sure that we don't kill exotic systems, it's also configurable.
2014-11-24 00:34:54 +01:00
asofold
43b33ed350 Catch and log exceptions during chunk-load on players joining. 2014-11-23 15:53:33 +01:00
asofold
0561638105 Add STATUS stream and use instead of INIT in some places.
* STATUS logs to console and default file, using queues.
* StaticLog logs to STATUS during runtime.
2014-11-23 15:47:10 +01:00
asofold
3460e29246 Remove StaticLog.schedule... and toString(Throwable). 2014-11-21 23:45:02 +01:00
asofold
4ffca941a2 Update comments. 2014-11-21 23:23:53 +01:00
asofold
db7775a2c7 Spaces. 2014-11-20 12:29:49 +01:00
asofold
99e4cdc1bc Allow absolute paths for the log file. 2014-11-20 12:28:20 +01:00
asofold
3364d487cf Fix logging task (sync) not registering. Shuffle init order. 2014-11-19 23:09:14 +01:00
asofold
4544e1da7b Check for correct name of init logger. 2014-11-19 21:59:13 +01:00
asofold
1e455f77e2 Optimize for speed. 2014-11-19 21:24:00 +01:00
asofold
c0300c09a8 Attach server logger to the appropriate stream (+simplify). 2014-11-19 10:03:11 +01:00
asofold
17ce04b52d Import cleanup. 2014-11-19 08:40:36 +01:00
asofold
ea57e5c3e1 Move Streams to NCPCore. 2014-11-19 08:36:53 +01:00
asofold
2fc56885fb Remove accidental override. 2014-11-19 08:36:18 +01:00
asofold
ec36e879d3 [BLEEDING] Use the new logging framework from now on (read details).
* All logging is also going into the log file (always), debug output is
mostly/only going into the log file. File logging uses an asynchronously
processed queue now (!).
* Specify an existing directory (e.g. logs) and log files will named
after date + sequence number, changing with every reloading of the
configuration.
* Console and ingame logging remain within the primary thread.
* No extra configurability for customization, yet.
* Not all places have been cleaned up, concerning log levels. target
streams and package naming.
* Work in progress.
2014-11-19 00:07:52 +01:00
asofold
2f4d689722 [PLACEBO] Raw sketch of the upcoming logging framework, doing nothing. 2014-11-18 23:54:43 +01:00
asofold
f49c64e89d Move StaticLogFile to NCPCommons, make use of the useBukkitLogger flag. 2014-11-17 15:40:04 +01:00
asofold
37c1da73ff Rename LogUtil to StaticLog. 2014-11-17 11:25:51 +01:00
asofold
780d59d8a7 Use a utility method to get a String of a Throwable. 2014-11-11 20:28:49 +01:00
asofold
0201e4178b Spaces. 2014-11-11 20:23:49 +01:00
asofold
aa4ef31051 Make locations and distance available for logging passable violations. 2014-11-11 02:12:19 +01:00
asofold
543753a74d Spaces, indentation, comments. 2014-11-11 01:53:40 +01:00
asofold
ae35d26a93 Reduce code duplication in getOptimizedActionList. 2014-11-06 01:26:45 +01:00
asofold
4dcebd11c7 Spaces. 2014-11-06 01:23:24 +01:00
asofold
881bd44330 Fix LogAction.getOptimizedCopy returning something that logs nothing. 2014-11-06 00:47:59 +01:00
asofold
9a6bb37bd8 Add name and displayname to ParameterName, handle IP in ViolationData. 2014-11-06 00:45:45 +01:00
asofold
9de6061a9e Comments + formatting + spaces. 2014-11-05 22:57:33 +01:00
asofold
1f2f18a748 More spaces. 2014-11-04 00:20:18 +01:00
asofold
8b43e5e5f1 Unify and simplify Check / AsyncCheck, ACheckConfig / AsyncCheckConfig.
Hinting at further changes to unify permission access and caching. Later
permission caching can also be done for moving checks, though checking
for the current thread may be exchanged in favor of config flags.
Generic configuration will allow to set individual timeouts for checks,
check groups and default. There could also be change policies like
"world change only", possibly listening to permission updates, if
feasible.

CheckData / AsyncCheckData are not as simple to unify, if we want to
keep the footprint as low as possible there. There could even be more
implementations to match different policies.
2014-11-04 00:17:43 +01:00
asofold
da6b580f2a Spaces. 2014-11-02 23:35:47 +01:00
asofold
27913a758d Optimize TickTask (reduce footprint of copying), code formatting. 2014-11-02 23:35:27 +01:00
asofold
0118f4334f Add server side velocity to debugging a move. 2014-11-01 18:11:47 +01:00
asofold
d013f289ec Formatting / cleanup. 2014-11-01 16:36:38 +01:00
asofold
07bc7f6a90 Correct comment. 2014-10-30 13:02:07 +01:00
asofold
6c0e1bb6c8 If neither from nor loc is passable, set back to from (earliest) rather. 2014-10-29 23:28:17 +01:00
asofold
f29acd3f00 Only demand the word "slime" to match for slime blocks.
This might help with compatibility, since we don't know how different
continuations of Bukkit will name things.
2014-10-29 12:09:58 +01:00
asofold
31a414942c Copy and paste fial. 2014-10-29 01:52:20 +01:00
asofold
b57d7745e4 [BLEEDING] Refine logging on logout. Actually set-back on logout.
* Always log location of logout if debug is set.
* Also check inconsistent logout if manahattan distance is > 0.
* Only perform "passable check" only if enabled and not dead/sleeping.
* Try to actually set-back.
2014-10-29 01:49:18 +01:00
asofold
e12c2a2bfc Fix manhattan methods using doubles, add signature for LocationS. 2014-10-29 00:52:05 +01:00
asofold
9827570e2d Log a warning if a player logs out having moved into a block unnoticed. 2014-10-28 23:09:36 +01:00
asofold
5ec3cd5963 Move set-back handling into dataOnJoin for respawn + join events. 2014-10-28 22:33:43 +01:00
asofold
87bc5edca0 It's yes or no, not true or false. 2014-10-26 20:38:02 +01:00
asofold
7b2a680ead [BLIND] Add dedicated compatibility module for Glowstone.
This is extending the classes for Bukkit (API only), and only overriding
very few methods, such as getCommandMap, dealFallDamage.
2014-10-26 20:25:00 +01:00
asofold
43dea0830a [BLIND] Add blocks for MC 1.8. 2014-10-26 16:40:57 +01:00
asofold
f965ea0610 Minimal formatting changes. 2014-10-10 17:08:35 +02:00
asofold
af974a85ac [SAFETY COMMIT] Freeze changes to vertical velocity.
Since other fixes migth be in focus, some changes are commited
merged/commented out:
* Prepare AxisVelocity to carry positive and negative values.
* Prepare MovingData to use vertical AxisVelocity. Rename hVel.
* Prepare CreativeFly (...), do not count velocity for height limit.

(Most preparations were unfinished, just hinting at the direction.)
2014-10-10 15:28:51 +02:00
asofold
3ea098876f Update block break timing for obsidian. 2014-10-05 08:48:55 +02:00
asofold
b4669e2a53 Catch a null case. 2014-09-05 01:21:45 +02:00
asofold
e861b97538 Spaces. 2014-08-23 23:12:41 +02:00
asofold
32a11f021a Refactor horizontal velocity to use an abstract AxisVelocity class.
AxisVelocity will later represent per-axis velocity accounting for both
directions along an axis.

There have been no changes to the functionality, so it still only
accounts for positive values.
2014-08-23 23:11:21 +02:00
asofold
53c0d9584c Config change: blockchangeonly is false by default (changed earlier). 2014-08-17 22:51:22 +02:00
asofold
589dc77510 Change quick-exit check for passable.
* Include the case for manhattan == 1.
* Use BlockProperties.isPassable.
2014-08-17 22:46:55 +02:00
asofold
7c1b2eaed3 Commant + indentation. 2014-08-17 22:03:26 +02:00
asofold
45aad9c99d Remove vcliponly option for passable. 2014-08-17 21:58:52 +02:00
asofold
d0aea7feaa [BLEEDING] Refine passable-ray-tracing (block-edge treatment).
Previously the max. bounds hitting the block edge would not be
considered as colliding, this can now be controlled with a flag.

If the flag is set, you will collide at offsets of 1.0 for either
coordinate (not if the offset is < 1.0).
2014-08-05 20:18:13 +02:00
asofold
4c7f88ec5c Refine RayTracing.
* Better coverage of block-transitions: One step per axis, dT can be 0.
* Cover one step always, also if no distance is covered.

There might be more false positives, due to newly intoduced bugs, or due
to not all block-transitions being checked (a x + z transition will have
two variations to test extra to the ordinary diagonal path, but only one
is checked).
2014-08-05 18:55:15 +02:00
asofold
4e9e935b1e Extend tersting for Passable + move NCPCore tests to NCPPlugin.
Tests (partly re-) added and extended, classes moved, some methods
moved.

Some tests will fail if you don't use the next commit as well.
2014-08-05 18:49:35 +02:00
asofold
5245dcca9a Add op-notice to "ncp inspect". 2014-08-05 18:46:11 +02:00
asofold
29000fbdb7 Add tests for PassableRayTracing (+spaces).
To make this works we change LogUtil to allow logging to console, and
initialize BlockProperties with MCAccessBukkit and use a fake
BlockCache, that allows to set blocks with an access method, so that we
can test ray-tracing.

The testEmptyCorner test would fail with the current implementation.
2014-08-04 21:35:43 +02:00
asofold
eaa4154080 Spaces + comments. 2014-08-04 18:38:45 +02:00
asofold
e84027a919 Set wasInBed in postEnable to prevent kicking with plugin managers. 2014-08-01 22:09:14 +02:00
asofold
427a877b17 Add tab completion to "ncp top". 2014-08-01 19:59:48 +02:00
asofold
58f84028f3 Fix number of entries not being used. 2014-08-01 19:41:44 +02:00
asofold
1a73b65d4a Add Convenience method for tab-completion and correct indentation. 2014-08-01 19:33:56 +02:00
asofold
5f82584072 Use TickTask.getLag(..., true), within the primary thread.
This counts in if the current tick is taking longer than 50 ms.
2014-08-01 19:25:37 +02:00
asofold
78d51b3904 Let morepackets relax/smoothen on certain occasions.
Trying to prevent a burst propagate and cause a violation, it will be
smoothed onto following buckets, if they have less than max packets,
stopping after adding to the first non-empty one.

Uncertain effect on cheating, first tests seem to show no huge
difference.
2014-08-01 19:23:00 +02:00
asofold
eb8cba597f Indentation. 2014-07-31 10:06:04 +02:00
asofold
2f13529a29 Preserve order of check types in APIUtils. 2014-07-30 22:50:02 +02:00
asofold
07af2f687a Fix CheckType parsing for "ncp top". 2014-07-30 22:23:23 +02:00
asofold
6b71692a40 Sort by sumVL after n, for lower violation counts. 2014-07-29 22:56:35 +02:00
asofold
7d40df9d8c Rename the kicklist command to denylist. 2014-07-29 21:11:31 +02:00
asofold
c2722abc19 Add the "ncp top" command, allowing to search all the violation history.
Original pull request:
https://github.com/NoCheatPlus/NoCheatPlus/pull/24

This probably is not the final implementation, but it allows some
minimal freedom:
* Specify number of entries to show.
* Specify check types (and groups!).
* Specify what to sort by.

There might be need for some merged view, combining several different
check types somehow, or just shortcuts for specific selections, e.g. for
fighting-related checks.

----

+ Fix root command not showing sub commmand usage.
2014-07-29 13:49:43 +02:00
asofold
9b6c717fc0 Add ability to show a per-command usage + apply "correct indentation". 2014-07-29 11:55:53 +02:00
MyPictures
4ded8e4c2f Lets use space instead of tabulator here? 2014-07-28 08:37:55 +02:00
asofold
1a010b8f43 Update/reorder command usage/description. 2014-07-28 01:26:10 +02:00
asofold
8ad7009648 MorePackets: Make monitored seconds configurable, increase default to 6. 2014-07-28 00:44:44 +02:00
asofold
289da86c35 Add basic (mostly global) configuration for net checks.
Currently the parameters except for the "active" flag are not available
per-world, but this can be added later.
2014-07-27 23:21:04 +02:00
asofold
c6c904254f Feed some counters for debugging purposes.
Some might get removed soon.

* Various sorts of silent cancelling (probably not caught all).
* Count PlayerMoveEvent with look/pos/look+pos changes.
2014-07-27 21:01:36 +02:00
asofold
4176937dd1 Add a general purpose counter for stats/debug, and log+reset commands.
This may get changed around, e.g. to allow log output to file and other.
2014-07-27 20:22:53 +02:00
asofold
e0f81b43b6 Command+perms rename: tempkick to denylogin and unkick to allowlogin.
Aliases are still set for commands and permissions, so this should not
break things.
2014-07-27 17:25:35 +02:00
asofold
c99612154c Demand most action commands to be run from the console.
For players they either have no extra value over vanilla commands or
they have too high of an abuse potential.
2014-07-27 16:53:21 +02:00
asofold
7c967ab2e2 Add game mode to inspect command. 2014-07-27 16:26:57 +02:00
asofold
d55cd7e4b6 Add a generic instance factory to the API.
This allows storing useful objects in the registry.
2014-07-27 15:17:08 +02:00
asofold
67ac214909 Rename Stats to Timings and move to stats package. 2014-07-27 12:13:03 +02:00
asofold
0496f281b7 Add isTrueForAnyConfig, e.g. to check if to register listeners at all. 2014-07-26 22:28:53 +02:00
asofold
126c400813 Ensure copy-on-write is used for worldsMap. 2014-07-26 22:20:48 +02:00
asofold
564ce88132 Fix burstEPM violation + add tags for MorePackets + more lenient burst. 2014-07-26 21:42:56 +02:00
asofold
901b2a45a2 Account for server-side lag with burst packets.
Only count as burst, if there was enough lag. Might need adaption to
count lag again for judging the EPM, due to differing window resolution.
2014-07-26 20:49:46 +02:00
MyPictures
584a3d9ab0 Design improvements on Permissions.java
- admin.debug is now in the plugin.yml
- all permissions are now in alphabetic order
- aligned every permissions group
- Added additonal comments
2014-07-26 04:19:51 +02:00
MyPictures
d5c7bb7d27 Merge pull request #2 from NoCheatPlus/master
Downstream merge
2014-07-26 04:04:32 +02:00
MyPictures
ce339c62bd Permissions.java cleanup
- Replaces all tabulators with spacebars
- Splits Commands to Commands and Auxiliary Commands
- Commands and Auxiliary Commands are ordered alphabetically now
2014-07-26 03:54:44 +02:00
asofold
9f03a3ea06 Add direct burst violations and increase epm limit. 2014-07-26 01:06:58 +02:00
asofold
4eefc0c3ff Check speeding permission in the end, thus it will apply to all speeds.
This way, using the speeding permission as a workaround for all
individual speeds is possible. A player moving faster than default will
likely move faster in web too, and so on. There seems to be little
reason for keeping it confined to walking + sprinting only.

Moving it to the end also allows a quicker return for walking and
sprinting, though that policy might be questionable as well, because
some calculations might use hAllowedDistance, subject to review.
2014-07-25 18:51:18 +02:00
asofold
2257ac2f71 Add exception for MILK_BUCKET. 2014-07-25 15:22:01 +02:00
asofold
552beed739 Add limiting of "bursts" in moving.morepackets. 2014-07-23 23:31:31 +02:00
asofold
039c4b407f Add configuration to morepackets for "eps", i.e. events per second. 2014-07-21 14:39:17 +02:00
asofold
d5c1e289a9 Count "just look" moves same way.
As CB reduces the number of events, this should be fine. The cause of
trouble that lead to skipping these had been elsewhere.
2014-07-21 14:24:06 +02:00
asofold
7de214abae Only check for lag if there is windows to burn. 2014-07-21 14:22:45 +02:00
asofold
1441859ced Move the new packet frequency check to a static utility, minor cleanups.
* Always use lag.
* Let the morepackets check decide how to treat "just look" events.
* Optimizations.
* Renames.
2014-07-18 15:54:46 +02:00
asofold
3d5bbbbedd Server-side lag adaption: more strict if there is no lag. 2014-07-18 03:04:32 +02:00
asofold
58a7c15966 Check violation vs. the less strict limit. 2014-07-18 02:33:13 +02:00
asofold
4ee4e6f08d Don't count empty ones. 2014-07-18 02:25:38 +02:00
asofold
27d35c1208 Not just block changes. 2014-07-18 02:15:49 +02:00
asofold
db7ac2bd80 Only count moving.morepackets on non-zero distances. 2014-07-18 02:05:26 +02:00
asofold
f79c89b45a MIX UP. 2014-07-18 01:47:55 +02:00
asofold
e3cdd761ec [BLEEDING] Attempt to make moving.morepackets less strict. 2014-07-18 01:45:58 +02:00
asofold
85a104ed75 [BLEEDING] Switch moving.morepackets to use Actionfrequency. 2014-07-18 00:21:19 +02:00
asofold
7cc936878e Simplify/optimize morepackets checks. 2014-07-17 20:30:01 +02:00
asofold
b6c146ce64 Remove getKeepAliveTime from MCAccess.
It does not seem to become accessible any time soon, while packet level
access allows to fetch it.
2014-07-17 14:33:38 +02:00
asofold
96462dab90 Allow ConfigManager.getConfig... from any thread (copy on write).
This allows fast config getting from any thread, without need to know if
it is the main thread.
2014-07-16 14:55:31 +02:00
asofold
7b6305de78 Packet checks adjustments and renaming.
* More appropriate names.
SoundDistance
* Plus wither plus dragon.
* Horizontal distance.
2014-07-16 13:50:04 +02:00
asofold
d473f19247 It's THEM. 2014-07-14 23:08:15 +02:00
asofold
39e2a86472 [BLEEDING] Extra method for set-back + reset positions differently.
Setting back players on PlayerMoveEvents:
* Reset internal from/to tracking the set-back location.
* Use an extra method for that.
2014-07-14 22:49:37 +02:00
asofold
4ebe911509 Abort ray-tracing if there is no advance. Formatting + numbers.
If there is no advance on any axis, loop should be stopped.
2014-07-13 03:19:28 +02:00