Commit Graph

2463 Commits

Author SHA1 Message Date
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
d05e683ee6 Too quick. 2015-10-23 19:52:56 +02:00
asofold
b443ae7db3 Quick link CONTRIBUTE.md from README.md. 2015-10-23 19:51:38 +02:00
asofold
1663305401 One mroe. 2015-10-23 17:57:20 +02:00
asofold
5587d7f3e3 A little bit extra. 2015-10-23 17:53:42 +02:00
asofold
975aa41b58 Update CONTRIBUTING.md. 2015-10-23 17:48:23 +02:00
asofold
9a3b901770 Not bullet this. 2015-10-23 17:33:03 +02:00
asofold
603a4dbb81 Update README.md (mostly wiki links), add CONTRIBUTING.md. 2015-10-23 17:26:46 +02: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
2dd081d118 Bump version to 3.13.0. 2015-10-18 18:49:05 +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
dcc4e80cd6 Update repository references. 2015-10-10 23:27:12 +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
b749dfdc42 Fix npe. 2015-10-04 21:51:00 +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
f0c6ab69b5 Don't call move, if there is no entry. 2015-09-28 15:16:54 +02:00
asofold
08c5aa2d7c Implement a linked coord hash map, custom order, tests.
Can't implement "dumb" access order, because we will have to move
entries to the front with setting and altering data, but we don't want
the data to be changed every time get is called, e.g. with piston
tracking.

Efficiency could be increased, using the entry as reference instead of
duplicate calls with coordinates.
2015-09-28 15:10:02 +02:00
asofold
f70151d8c7 Use an iterator for remove. 2015-09-28 13:09:45 +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