Commit Graph

847 Commits

Author SHA1 Message Date
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
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
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
asofold
aba5674f6a Correct log messages. 2014-07-13 01:45:39 +02:00
asofold
aa91a39eea Some Formatting. 2014-07-13 01:14:17 +02:00
asofold
e09d024101 Un-fix tempkickillegal issue: Do kick if location could not be restored. 2014-07-13 01:13:50 +02:00
asofold
607407d4fa Fix tempkickillegal setting being ignored. 2014-07-13 00:29:52 +02:00
asofold
74e6844e00 Check child individual child permissions for checks.blockplace.against. 2014-07-06 21:36:18 +02:00
asofold
5d8f77f309 Change "ncp ban ..." command to use the vanilla command.
This should be better in case the vanilla command allows UUIDs some day.
At least during testing in uuids did not work, so we added a warning
message if uuids are used for banning.

Using player names for actions should be safe anyway.
2014-06-15 02:57:24 +02:00
asofold
754fea92d8 Add some utility methods for names/uuids (taken from TrustCore).
Someone remind me of rendering TrustCore "uploadable" or to just upload
it.
2014-06-15 02:54:50 +02:00
asofold
24aecb58d3 Set dependency for NCPCore to Bukkit 1.7.9-R0.2.
This might allow to add compatibility stuff similar to BridgeHealth,
just for UUIDs.

Shortly tested on 1.7.9, 1.7.2 and 1.5.2 (no joke).
2014-06-15 02:52:41 +02:00
asofold
fc83b884b3 Whoops. 2014-06-15 01:34:22 +02:00
asofold
b25b2be62c Hide some more warnings behind BlockProperties. 2014-06-14 22:29:10 +02:00
asofold
ae9415a012 More use of Material instead of ids... 2014-06-14 20:45:51 +02:00
asofold
c23e5e15a7 Remove unused calls. 2014-06-14 20:42:46 +02:00
asofold
785de7c0f4 Suppress deprecation warnings for BlockProperties.
Access by id may or may not be changed internally, depending on what
happens on the API side.

For performance reasons we might like to do without passing on extra
stuff like Material, or even do String-comparison.

If ids will become more expensive to use than other ways, or if it will
be possible/accepted that ids get reused during runtime, then we will
have to change all internals.
2014-06-14 20:39:32 +02:00
asofold
98f101e9ff Import cleanup. 2014-06-14 20:33:30 +02:00
asofold
f53cf96e78 Fix test failure due to invalid input.
A merge can happen if the maximum distance between any two points
exceeds the merge distance, because LocationTrace attempts to balance
distances entries. Thus this test must not bne able to walk further than
the merge distance.
2014-06-14 20:22:02 +02:00
asofold
6afaf4ebbd Formatting, shuffling, commenting. 2014-06-14 16:40:43 +02:00
asofold
75224adf63 Reduce use of using block-ids in more places.
* Use Material directly in more places.
* Hide id-getting within BlockProperties.

TODO:
* BlockInit, BlockFlags + use of those.
* Possibly other.
2014-06-13 12:01:44 +02:00
asofold
5bfad6016c Small cleanup for fastbreak: creative mode is not handled by this check. 2014-06-13 11:12:50 +02:00
asofold
587236dfdc Alter resetting of FastConsume timings.
* Reset to time, if time ran backwards.
* Reset to time instead of 0, on eating.

TODO: Switch to Monotonic.
2014-06-13 00:39:42 +02:00
asofold
56bab0a3ae Cancel various actions for dead players. Config pending. 2014-06-04 23:52:07 +02:00
asofold
a75e32b2d3 Ra-add the instant-break compatibility code.
For whatever reason it was commented out, it is now put back, assuming
that the reason was "it did not help with mcMMO", because mcMMO used to
fire extra BlockBreakEventS.

Now we use a tri-state and set it to MAYBE if instantBreak is set
already on lowest priority, to have a rough indicator if a plugin set
it, or if the server might have done it. Later we might let FastBreak
assume some maximal duration for either case, instead of ignoring these.
2014-06-04 22:31:31 +02:00
asofold
d6e66dc22d Simplify and extend AlmostBoolean. 2014-06-04 22:04:26 +02:00
asofold
f4b109ec3b Comment added. 2014-06-04 21:54:13 +02:00
asofold
5c243aa4bc Add exception list for blockplace.noswing (water lily, flint and steel). 2014-05-18 20:57:04 +02:00
asofold
258dbbdf84 Deprecate some unused config methods for getting type ids. 2014-05-18 20:49:41 +02:00
asofold
c6dbd7330b Rename + extend config support for reading Material. 2014-05-18 20:46:29 +02:00
asofold
c93edcbbe9 Remove direction correction, as it does not seem to be effective. 2014-05-15 10:44:34 +02:00
asofold
24bc2816e6 Throw more npes for null worlds, to ensure things blow up in time. 2014-05-15 10:37:24 +02:00
asofold
521b4feb25 Re-check use of "useLoc" once more.
Fixes:
* On passable-violations useLoc might have been passed as newTo.

Reduce potential for accidental future misuse:
* Call useLoc.setWorld(null) as late as possible.
* Do not reset world of MoveInfo.useLoc in MoveInfo.set.
2014-05-15 10:09:53 +02:00
asofold
e7f292ebe0 Too loud thinking. 2014-05-13 10:27:19 +02:00
asofold
35684208f0 Set default delay to 100 in fastbreak. 2014-05-13 10:22:36 +02:00
asofold
4213002653 Fix instantbow resetting, e.g. with item changing, if in strict mode. 2014-05-13 10:22:07 +02:00
asofold
b822b5c08a Wrong way round - default behavior was to allow it (be it a bug or not). 2014-05-11 23:03:19 +02:00
asofold
0024e16112 Add config flag to allow preventing vl reset in chat.text.
This might be temporary, the resetting could get removed completely,
or it might be fixed/altered.
2014-05-11 22:59:37 +02:00
asofold
fc69b10fa4 Set max steps for ray tracing in BlockProperties as well. 2014-05-05 23:53:59 +02:00
asofold
307e2c6cac Fix handling move events while in vehicles.
Bug by "refactoring".
2014-04-27 22:34:25 +02:00
asofold
b4f9c5d8a6 Apply yaw/pitch correction in fight-handling directly.
Might later do without having this done after moving all the time.
2014-04-23 20:54:02 +02:00
asofold
146936b326 [BLEEDING] Treat respawn mostly like join. 2014-04-23 20:49:07 +02:00
asofold
62b3088082 Wrong API used. 2014-04-21 14:25:23 +02:00
asofold
db7b34e50c Make use of yaw/pitch correction (silent correction). 2014-04-21 14:17:00 +02:00
asofold
59054b402b Add Methods to correct yaw and pitch to MCAccess.
An implementation for NCPCompatBukkit is missing.

Note that the native access can not set lastYaw nor lastPitch in
PlayerConnection (private), but it could set lastYaw and lastPitch in
EntityPlayer.

Can't guarantee this actually helps with stuff like derp/magnet, because
we can not really set the outcome of a PlayerMoveEvent without
rubberbanding the whole planet. Hacks could send enough packets per tick
to keep freezing people - we might be able to keep track of yaw/pitch
correction and cancel (most) attacking for the same tick after yaw
correction (invalidate "same" with in-bounds yaw).
2014-04-21 14:16:11 +02:00
asofold
829e52d473 Add methods to check and correct yaw and pitch to LocUtil. 2014-04-21 14:10:43 +02:00
asofold
2d07fa1b5a Add method to DataManager to retrieve data for a Player instance. 2014-04-21 14:09:38 +02:00
asofold
53f027c3a3 [BLEEDING] Something quick against "magnet".
"Magnet" refers to a player seemingly freezing other nearby players onto
the spot, causing them to yaw-glitch, seemingly getting attracted by the
cheater.

Thanks again @Iceee for reporting and @Amaranth for finding cause +
suggested fix.

Not sure this both helps and prevents false positives, so it could get
redone a couple of times, might also result in being impossible to fix
with a plugin in an acceptable way.
2014-04-20 16:04:07 +02:00
asofold
b8fd9da08f Partly stitch up command protection.
- Never skip undoing changes. This is necessary to also process commands
that are not registered or that are fall-back aliases.
- Check adding all plugin commands always.
- Check for aliases as well for decision if to match a command.
2014-04-15 22:31:53 +02:00
asofold
547dfc890b Harden the command-pre-process handling against fall-back aliases.
These seem not to have been affected beforehand, due to the nature of
the SimpleCommandMap, however we don't want to exclusively rely on
fetching that one successfully.
2014-04-15 20:31:37 +02:00
asofold
e017ebf54a Increase VL change for blockplace.fastplace by a factor of 1000.
There had been a divisor of 1000, not sure why exactly.
2014-04-15 20:13:03 +02:00
asofold
1f0aafb63e Add a fail for null-worlds on updating set-back locations internally.
Setting a set-back location with a null World will now lead to a
NullPointerException. Setting null worlds on set-back locations is not
intended by contract, however due to using temporary Location instances
with Entity.getLocation(Location) and setting the world to null
afterwards to prevent memory leaks, also considering the number of
places where setSetBack is used, this seems to be an appropriate measure
to track better or help excluding violations of that contract.
2014-04-12 20:31:03 +02:00
asofold
af5e38b0a8 No extra NCP prefixes on commands. 2014-04-05 00:33:28 +02:00
asofold
e103acea4a ParameterName.UUID: Allow [uuid] in the strings configuration. 2014-04-01 23:13:29 +02:00
asofold
b6034162ee Add guard for not having checked at all. 2014-03-25 10:48:08 +01:00
asofold
c9b2ae1a3d Ignore players in vehicles with the fall damage events. 2014-03-24 22:03:01 +01:00
asofold
ea682417bc [RAW] First version for direction + reach using a moving trace.
This does not change the used methods much, thus it will rather allow
much more cheating, however it allows some basic testing for false
positives. The reach implementation has been slightly optimized to run
faster. The current implementation is not final and only uses trace
elements that were added in the current tick, the latest is always
included.

Next steps will probably be:
* Stricter methods for an individual TraceEntry (demand near-exact hit).
* Don't allow random latency shifting. Maintain a window-thing.
* Probably get rid of the classic method for attacking other entities.
2014-03-24 21:05:20 +01:00
asofold
f0f4a7ec2c Add test for first element for a maxAge iterator. 2014-03-23 19:05:15 +01:00
asofold
a4aad90c82 Fight checks: Use data and config from arguments. Prepare new methods. 2014-03-23 18:49:30 +01:00
asofold
4dc6b58920 Prepare fight checks for using a moving trace.
* Get+update players moving traces, create fake ones for other entities.
* Reorder checks + add some comments (not in use yet).
2014-03-22 19:19:23 +01:00
asofold
79b0feb28e Add more tests for LocationTrace. 2014-03-22 09:54:41 +01:00
asofold
75da549f25 Use the preset TAG for some commands. 2014-03-21 22:17:37 +01:00
asofold
6767bd7eec Ensure no fall distance remains for leaving players who could fly. 2014-03-21 20:42:32 +01:00
asofold
c27c03cf8e [BLEEDING] Maintain location traces (not making use of those, yet).
No change for the function of the plugin, except if there are new bugs.
Actual changes:
* Keep track of squared distance to the previous element in a trace.
* Balance mergeDist: prevent merging the latest entry, if the squared
	distance from the latest to the second latest element is greater
	than mergeDist. Never merge if there are only two entries in total.
* Add convenience methods for resetting and updating the trace.
* Maintain the moving traces actively. With intended use being
	player-player interaction, we will not reset with every teleport.
2014-03-21 20:29:09 +01:00
asofold
520e7bab74 Set fall distance to 0, if the player could fly or is in creative mode. 2014-03-21 10:11:47 +01:00
asofold
f1342fd021 First rough version of a LocationTrace implementation.
Just the raw implementation + initial test cases. To keep memory use
constant, a ring-buffer with some maximal size will be used. The
iterators are meant for faster implementation, rather than fastest
iteration. Later some trigonometric functions could be added to
LocationTrace, depending on if that may gain a lot of performance.

Next we will add the logics for adding entries and resetting the trace
to NCP (moving, teleporting, joining), on Logout the trace must not stay
in MovingData but should be garbage collected. That should be a
milestone dev build, though it does nothing for the user, it might help
finding crash bugs :p.

Soon to follow will be changing some fight checks to be able to use the
moving trace, then alter them to actually use it. Fight and interact
checks could also do moving consistency checking (tp exploit).

Who reads this?
2014-03-20 23:29:57 +01:00
asofold
2478ae787b Just a typo. 2014-03-18 23:34:45 +01:00
asofold
f8d72eb591 Make message for consoleonly feature configurable. [TICKET DBO 711] 2014-03-15 16:05:49 +01:00
asofold
d130a3d583 Random formatting change. 2014-03-15 15:48:20 +01:00
asofold
b9bcce1292 Fix for stained glass panes.
Adding a flag for ~ thin fence.
2014-03-03 23:13:05 +01:00
asofold
ce2d0dbc3c Add configurability to enforcing the players location. 2014-03-03 22:52:46 +01:00
asofold
2b2ace4a4b Set assumesprint to true by default (accidentally committed earlier!).
This will allow saving hunger, but there will be much less false
positives with current server versions.
2014-03-01 15:57:13 +01:00
asofold
9c29d32a98 Reviewing several places for use of Double.MAX_VALUE and similar.
(No game-changing stuff.)
2014-03-01 15:53:51 +01:00
asofold
ce5a90201c Ensure wrongBlock does not add Integer.MAX_VALUE as violation level.
Also cap violation at 4.
2014-03-01 15:15:10 +01:00
asofold
894aa466d6 Force return air for y outside of map bounds. 2014-02-25 11:43:44 +01:00
asofold
cb557122b8 Set maxBlockY from given world. 2014-02-25 11:22:39 +01:00
asofold
1cb9a18174 Rather use prepareSetBack than setTeleported before set-back. 2014-02-24 13:08:18 +01:00
asofold
8eebda863f Ensure TeleportCause.PLUGIN is used for teleporting. 2014-02-24 12:57:31 +01:00
asofold
65b3c4440d [BLEEDING/INSTABLE] Add actual move location consistency checking. 2014-02-23 03:30:27 +01:00
asofold
abdeb12377 Less object creation with short-use Locations + other preparation.
* Make use of Entity.getLocation(Location) in most places, for starters.
* Prepare a check for moving location consistency.
2014-02-23 02:01:28 +01:00
asofold
187a7ef094 Need to use isOnGroundOrResetCond here. 2014-02-22 22:43:20 +01:00
asofold
c08366b59b Merge pull request #23 from MyPictures/master
Remove "ASCII art" from the source code (finally?).
2014-02-22 22:20:46 +01:00
asofold
f1d7aa8a35 Clean up moving-data resetting on players joining the server. 2014-02-22 22:04:31 +01:00
MyPictures
add2179dc9 Cleanup "ASCII art" from the sourcecode
Wiped every ASCII related thing that I could find in the NoCheatPlus
source.
2014-02-22 19:26:06 +01:00
asofold
06aff0b0a6 [CONFIG] Reduce logging of blockinteract.visible by a lot. 2014-02-22 18:35:21 +01:00
asofold
1284fffdf1 Move some code off SurvivalFly.check. 2014-02-22 13:24:22 +01:00
asofold
888c18a908 Further confine pre-conditions for the sprintback check. 2014-02-22 13:03:00 +01:00
asofold
05372fbef4 Add comment. 2014-02-22 13:02:24 +01:00
asofold
d24a13ed12 Process captcha for cancelled chat events as well. 2014-02-22 00:00:10 +01:00
asofold
34c26c8791 ERR 2014-02-17 02:07:51 +01:00
asofold
9528b15f55 Avoid sign duplication due to a bug in CraftBukkit.
The cancelled BlockPlaceEvent will lead to an extra sign being dropped,
while the item in hand stays. Odd enough, the cactus is removed before
the BlockPlaceEvent - need to check if a ticket exists for CraftBukkit
already...
2014-02-17 01:58:44 +01:00
asofold
3361280cc7 Correct type of placed block, autosign uses Material.SIGN now. 2014-02-16 22:54:16 +01:00
asofold
598896a7cc Forgot to alter VL. 2014-02-16 22:31:09 +01:00
asofold
4ddfcc9063 Set dependencies to current snapshots. 2014-02-16 21:49:33 +01:00
asofold
8b298337ae Add a "Against" check, complementing the already exisiting CheckType.
* Promote BLOCKPLACE_AGAINST to "full check", with silent cancelling.
* Refactor listener for check arguments and order.
2014-02-16 21:29:52 +01:00