Commit Graph

641 Commits

Author SHA1 Message Date
asofold
55cf5c0a6b Add convenience methods for comparison with the set minecraft version. 2015-11-25 08:16:21 +01:00
asofold
218fdc46c4 [BREAKING] Move ActionFrequency and ActionAccumulator to a sub-package. 2015-11-24 07:33:30 +01:00
asofold
8b1eb86543 Move AttackFrequency and KeepAliveFrequency as checks to NCPCore.
+ Add adapters to "packet-listeners" in feature tags.
2015-11-24 06:36:57 +01:00
asofold
98ae3fb192 Fix LogAction, let it extend a more generic one. 2015-11-24 04:01:08 +01:00
asofold
1c608ecda1 Clarify, potentially. 2015-11-23 08:30:32 +01:00
asofold
ea0e9e1ade Make FlyingFrequency a standard check in NCPCore. 2015-11-23 07:54:28 +01:00
asofold
88d3741cbd Work around issues with switching from flying to survivalfly. 2015-11-22 02:41:37 +01:00
asofold
83c8d52631 Let fly speed apply with flying upwards.
Might be different with earlier versions of MC. Can be made
version-dependent on request.
2015-11-22 02:40:49 +01:00
asofold
5e17ce05ff Count moves inside media other than water. Add lava special case. 2015-11-22 01:33:55 +01:00
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