Commit Graph

3404 Commits

Author SHA1 Message Date
asofold 53f534b3c6 Split off logOnce to StaticLog. 2017-04-28 21:44:17 +02:00
asofold 180cf8a3c3 Let blockinteract.direction check queued packets. Unify loop (visible).
* Add a class to loop the flying queue with a block as target (look
only).
* Pass the flyingHandle to sub checks (doesn't necessarily make sense
with reach - should probably re-check reach with the used flying queue
state, but that's more complicated due to the possibility of split pos
vs. look).
* Use the loop class both for visible and direction (not reach).

Likely similar has to be done with BlockPlace and BlockBreak - would be
good to find a skipping heuristic for blockbreak.direction etc., so we
know we have successfully checked that block from that exact position
for this player and nothing has happened between (and so on, or a more
relaxed heuristic).
2017-04-28 19:03:10 +02:00
asofold 970ed6b126 Remove ominous count - all that remainded from the original was...
skipping redundant checking (limiting the number of visited packets
doesn't work - instead 'good candidated' for packet inversion with dig
packets should be stored together, so it's easy to just check vs. the
first/last stored one).
2017-04-28 17:20:24 +02:00
asofold 956c7ca803 Pass a handle for the flying queue to sub checks of blockinteract.
To be done:
* Use yaw and pitch of past packjets for Direction and Reach.
* If block break mathes the last interacted block (+ moving sequence
indicates no change), skip some checks like direction and reach there,
possibly keep track if those were run at all.
2017-04-28 00:27:36 +02:00
asofold 1655a90b2b [BLEEDING] Make use of the 'confirm teleport' packet. Cancel WAITING.
If the teleport confirm packet is available, flying packets with
AckResolution.WAITING will be cancelled.

This is real bleeding edge and might need other adjustments not to
freeze players for to be discovered edge cases. The TeleportQueue
already does contain a timeout mechanism and should return
AckResolution.IDLE after some time.
2017-04-27 12:53:47 +02:00
asofold 6ea30131ca Reduce (player) morepackets data on confirmed set back teleport.
Distantly related: Often an extra flying packet is sent to confirm a
teleport.
Here: Reduce effect of set-back loops with morepackets involved.
2017-04-27 10:34:41 +02:00
asofold 64c347f801 Don't hesitate: make use of the primaryThread flag. 2017-04-26 18:49:21 +02:00
asofold 7d7a0bf010 Add method to pass thread-indicator via an extra argument. 2017-04-26 18:45:28 +02:00
asofold 65fc88f41a Use Bukkit.isPrimaryThread and log inconsistencies. 2017-04-26 18:41:43 +02:00
asofold 1c8c3a8c3a Count all flying packets and PlayerMoveEventS, simplify.
* Count all events/packets regardless of settings.
* MovingListener: Remove pos/look counting for move events.
* MovingFlying: Call the counter method according to primaryThread flag.
2017-04-26 18:21:24 +02:00
asofold 458358f611 This is not a counter. 2017-04-26 14:29:53 +02:00
asofold 9339ccc0ef Error log the interpreted packet types (simplified). 2017-04-26 14:27:22 +02:00
asofold 68a7eab297 Allow join with a StringBuilder passed. Simplify some method signatures. 2017-04-26 14:26:24 +02:00
asofold 0969a5c939 Log packets cancelled by FlyingFrequency. Adjust comments/log messages. 2017-04-26 14:02:21 +02:00
asofold ad934f3a43 Continue checking if a packet can't be interpreted, log every minute.
Since the normal function is to interpret packets, it's not really a
performance hit, if we always try to interpret packets.

This way at least FlyingFrequency can still run. For incompatible setups
FlyingFrequency can still be disabled.
2017-04-26 12:40:29 +02:00
asofold 792bed452c [BREAKING] Ignore set-back override, if cancel is not set.
Seems better, cancel actions can be set manually.
2017-04-26 10:49:26 +02:00
asofold 34e3548ec5 [BLEEDING] Allow to override the set-back via MovingData.setTeleported.
This way, you can calculate a more interesting set-back location from
within a hook during violation handling. All you need to do to adjust
the set-back location is to call MovingData.setTeleported(newSetBack)
and NoCheatPlus should recognize this as the location to set back to.

Please do:
* Test if the check in question would set back at all
(IViolationData.wilCancel() returns true).

Please in such a case do not:
* Don't call setTeleported if IViolationData.willCancel() returns false
:).
* Cancel violation processing.
* Teleport the player.
* Do something complicated with MovingData otherwise :).
2017-04-25 23:58:48 +02:00
asofold 8fc9b1df91 [BREAKING] Change boolean mightBeMultipleMoves to int multiMoveCount.
Especially developers adding set-back alterations should have a look:
https://gist.github.com/asofold/b05c0a17c605e7c69bb30ee5e79a6e7b
2017-04-25 22:25:47 +02:00
asofold fe233d82ea Reorder the remainders of the previous draft. Keep an item array.
Store an extra array of items internally and allow fast fetching (for
fastest processing, where necessary). The sortedItemNodes array is kept
for future purpose.
2017-04-25 10:31:42 +02:00
asofold 2d25265588 Use an array for the output internally. 2017-04-25 09:51:48 +02:00
asofold 730d09aa78 [BLIND] Extend API further.
Despite having an interface yet, add things like unregister many objects
(items) and getting all registered items, e.g. for dealing with
sub-registries efficiently (at first code-wise).
2017-04-25 00:36:57 +02:00
asofold 2b51dfa8b8 [BLIND] Fixes for unregister + extend API.
Fix: Wrong object used for get, such.
Add: More convenience methods to remove items and types completely, clear, isRegistered variants.
2017-04-25 00:11:32 +02:00
asofold 190309e5f3 Add an auxiliary class, to delegate IRegisterWithOrder setup to. 2017-04-24 23:21:53 +02:00
asofold 6ce8e62e7e Support SetupOrder still (to be deprecated). 2017-04-24 20:16:49 +02:00
asofold f82d387a88 Don't create order twice. 2017-04-24 20:12:16 +02:00
asofold d2ed656409 Revert last minute change. 2017-04-24 20:09:25 +02:00
asofold be877c7e9b [BLIND] Sketch a registry helper for storing sorted lists by type.
Store items in lists by type, sort by RegistrationOrder either lazily on
fetch or upon request. Allow registering an item multiple times, but
only once per type.

Tests, adaption of signatures, additions and variants should follow.
2017-04-24 19:40:22 +02:00
asofold d0c42ab061 [BLEEDING] Prepare internal registry lists overhaul to support sorting.
* Add RegistrationOrder for order.
* Add sorting functionality with some tests. (See
RegistrationOrder.AbstractRegisTrationOrderSort.)
* (Except for test cases, all this is not yet in use.)

(Perhaps the sorting should be changed to use an array for output
instead of iterators, this just represents a quick way in.)

Further direction:
* Replace all the registry lists like for INotifyReload and
IDisableListener and so on within registries by a generic storage that
uses this for sorting. This way every such thing will support both
priority-based and tag-based order at the same time.
* To support different order definitions depending on what type an
interface like IRegisterWithOrder might be supported by a registry.
* Later generic event listeners might also use this, simply.
2017-04-24 18:58:36 +02:00
asofold 97cdbe8046 Move the java version into the root pom.
Not set higher, as we can't really make use of that now - diamond
operator postponed.
2017-04-24 18:35:25 +02:00
asofold f02a11e404 Move stray tests to a test sub package. Reduce tests in TestCoordMap.
TestCoordMap: Use less samples with extra testing not being set.
2017-04-24 17:27:06 +02:00
asofold 2ff5415601 Have a RegistryException super class. 2017-04-21 18:45:53 +02:00
asofold 672c6cf71f Fix AttackFrequency for MC 1.7.10 and MC 1.7.2. 2017-04-19 14:59:23 +02:00
asofold b3a9898900 Add the method getClassDescription for debugging purposes. 2017-04-19 14:08:21 +02:00
asofold bb96f63f7d Quick config notify overhaul.
* Reduce details and only send a configurable amount of lines in
notify/chat, default to 5, just state to check logs in the end,
instead of lengthy hints.
* Log detailed output to STATUS (file/s).
* Fix wrong build number printed to set configversion.created to.
2017-04-19 12:34:06 +02:00
asofold 45210e1a25 Build against ProtocolLib-API 4.2.1. 2017-04-18 20:32:47 +02:00
asofold 563ce080c6 [BLEEDING] Make improbable check configurable for inventory.instantbow.
feedonly: allow to only feed, instead of check
weight: allow to alter the weight and disable altering improbable (0.0).
2017-04-18 19:21:22 +02:00
asofold ca2d2398e4 [BLEEDING] Model (noob) tower with lost-ground only.
* lostGroundAscend: new condition.
* lostGroundStill: some precondition checks moved inside, new condition.
* vdistrel: Extra case with decreased lift-off gain, but second move as
if normal lift off.
* With from being on ground, and last move not having touched ground,
setSetBack(from).
2017-04-18 18:13:46 +02:00
asofold 6a4c75460a enoughFrictionEnvelope: Compare with the absolute change of distance. 2017-04-18 16:14:53 +02:00
asofold 55715b0a9a Set version to 3.15.2-SNAPSHOT for a development iteration. 2017-04-18 13:04:01 +02:00
asofold 9714790250 Set version to 3.15.1-RC for release. 2017-04-16 19:34:07 +02:00
asofold a5b0bd0fae Account for null blocks in PlayerInteractEvent handling.
Before elytra boost these events had been ignored for most, now instead
of an early return, just the checks/logging using the block are skipped.
2017-04-15 17:04:37 +02:00
asofold 0262ac4ccd Fix .silent permissions set up wrongly.
* The construction routine for ActionListS is to by passed the silent
permission already, so getting optimized copies will not add another
'.silent' to the already passed permission. (Correct me if i am
mistaken). 
* Clarified javadocs/names.
* Further null permissions are handled, even if not (yet) necessary.

Still to be called with the ordinary check bypass permission:
* ConfigFileWithActions: The convenience methods to obtain
(Optimized)ActionListS from the
configuration.
* AbstractActionFactory.createNewActionList: will then create actual
lists, extending the permission by '.silent', unless the permission is
null.

(Stumbled onto, while looking for optimization potential with log action
execution.)
2017-04-14 20:45:36 +02:00
asofold f262a831b0 Support setting values for any ParameterName key explicitly.
Previously the "dynamically" evaluated result would always have been
used, even if a value had been set explicitly before execution of
actions.
2017-04-14 19:56:38 +02:00
asofold 23f9ac5689 [BREAKING] Enable more precise sub check data removal (see details).
[BREAKING]
* Due to adding a method to CheckDataFactory.
* Might alter data removal (less is removed, might've overlooked
something).

For MOVING, FIGHT, COMBINED, data removal for sub checks now is
possible, allowing for more precise resetting via commands. Other check
groups may follow on request / randomly.

Data removal for check data is logged now (only CheckData, not
IRemoveData in general), in case the debug flag is set in the data.

Later, a more flexible method may get implemented, accepting a String
id, so not only check type related data, but also any type of special
data can be removed (e.g. moving.locationtrace would not be a check
type, but allow resetting the location trace of a player).
2017-04-14 15:48:03 +02:00
asofold f5d2cbc880 Add COMBINED_YAWRATE (allows exemption, later: remove data precisely).
No bypass permission is set. The yawrate part depends on multiple other
checks. Checking for exemption is a hack within feedYawRate, fastest way
to implement.
2017-04-14 14:14:16 +02:00
asofold 32589987c9 Spaces + some formatting. 2017-04-14 14:02:34 +02:00
asofold cc066292c8 More space available!
(Fuck headers, UEFA.)
2017-04-13 21:24:53 +02:00
asofold 8077b4a0dc Extend HashMapLOW interface. Put PlayerData FCFS under lock.
HashMapLOW
* Add a constructor for using an external lock.
* Add putIfAbsent.

DataManager
* Use playerDataMap.putIfAbsent, return the PlayerData instance that has
been there first.
2017-04-13 12:39:18 +02:00
asofold c53d3f1521 Fix NullpointerException. 2017-04-13 11:02:32 +02:00
asofold eb5db36dfd Fix survivalfly and creativefly actions.
Could bugs possibly fit in between?
2017-04-12 21:13:52 +02:00