Commit Graph

3404 Commits

Author SHA1 Message Date
asofold 1616962d07 [BLIND] Begin to terraform penalties. 2018-04-08 15:39:47 +02:00
asofold fcee52586f Add missing GPLv3 headers. 2018-04-07 15:31:53 +02:00
asofold ba13fa8c72 [BREAKING] Change ActionFactoryFactory related API. 2018-04-07 15:22:17 +02:00
asofold 3b8e34d192 Having a look at BridgeHealth. 2018-04-05 13:22:23 +02:00
asofold 274c15eccf [BLIND] Continue to implement input specific penalty support.
Have a penalty list to collect input specific penalties from
ViolationData and apply after event handling.

Pass through the list to fight.critical.

Missing:
* Penalty factories and configuration. Penalty registry. Link with
actions.
* Pass through the penalty list to all fight checks.
* (Implement default penalty types.)
* ((Implement stored penalties.))
2018-04-05 11:40:18 +02:00
asofold 96e3869ff1 Begin to shape penalties. 2018-04-04 12:55:16 +02:00
asofold bd47174a4a Implement default state for missing parent nodes.
For debug false should be used, in case someone accidentally sets
'default' for a production server.
2018-04-04 12:35:23 +02:00
asofold 588c356632 Remove not implemented options (fight.critical). (+)
(+) Preparatory comments.

Something came in between back then, but now it's not efficient to do a
special case here. Instead, generic penalties will be implemented to
some extent.
2018-04-04 11:34:27 +02:00
asofold 43ba77aaa0 Fetch MovingConfig only once. Log when appropriate. 2018-04-03 10:12:23 +02:00
asofold d52138ab60 Only disable the handle, if suitable. 2018-04-02 18:42:56 +02:00
asofold 59d518a6b9 Update handle if disabled. 2018-04-02 18:37:53 +02:00
asofold cf8f4826c5 Set/indicate default flags for activation/lag/debug. 2018-04-02 18:17:07 +02:00
asofold 0a373fb28b Block change tracking: add flags for use and redstone. (+)
Add block flags:
* F_VARIABLE_USE
* F_VARIABLE_REDSTONE

Add a test to ensure block flags are unique and not 0L.

(+) Use individual MiniListener instances.
(+) Track right click blocks (use block) and apply, aiming at trap door
issues.
2018-04-02 17:08:48 +02:00
asofold 4c30b3570e Fix NullPointerException in frequentTasks. 2018-04-02 11:06:51 +02:00
asofold de586853b0 Add missing GPLv3 headers. 2018-04-02 01:47:25 +02:00
asofold 82d6f94230 [BLEEDING][BREAKING][BROKEN] Continue data registry + API. (+)
Likely incomplete/broken somewhere.

Implement/extend/use/fix new data caches and factories.
(+) Fixes related to recent commits (e.g. log listener exceptions
properly, fight.wrongturn).

Missing:
* Debug logging (registry), consider a registry log file.
* Proper naming/tags for listeners.
* Consistency: ICheckData should probably be used with
removeData(CheckType)? Registration is arbitrary though.
* Consistency: clearData() vs clearData(CheckType.ALL) - should check
type related data be ICheckData only ?
* Data expiration stages and PlayerOfflineData - impact on memory...
* (...)

Further:
* WorldData inheritance issue: implement passing on changes to children.
(Current line of thought: rather extend IWorldDataManager to allow
change default+inherited only.)
* Shrink exposed API - uncertain: rather have a registration context
object or expose individual methods for factory registration and
grouping types?
* (...)
* Planned breakage: Project + package organization redone: move stuff
where it is best for having an API (components -> split to top level or
name it api, utilities ... parts belong into API, and the like...,
possibly split project further: commons, api(+-bukkit), core/checks,
plugin-bukkit).
2018-04-02 01:25:10 +02:00
asofold 350908cb47 [BLEEDING] Scan for ground with the void-to-void set back policy.
In case a player is above the void (no ground / liquid / web / climbable
underneath), they're teleported directly to the void.

Further adjustments:
* A flag for cobweb has been added.
* MovingUtil.getApplicableSetBackLocation / signature.

Missing:
* Precise scan (and set back policy down-to-ground, and what not).
* Special cases: illegal move, passable, morepackets. Some need an extra
policy.
* Standing on entities? Quite testing with scannning down to the void,
perhaps it'll be "ok" with a more complex scanning result, scanning for
entities near start and end only.
2018-03-01 21:12:25 +01:00
asofold a641137176 Route set back getting through a utility method (for most).
Preparation for set back policies.

Special cases missing: illegal move, passable, more packets.
2018-03-01 11:36:28 +01:00
asofold a3027eb6ce Further fiddle with sf vl relaxation. Use the move count instead of ms.
* Allow to relax with normal lift-off envelope, provided clean
descending (and not having had a violation since last lift off ground).
* (Maintain a flag for violation since lift off.)
* (Use the move count for vl freeze instead of milliseconds.)

Related:
* (Also set sfVLInAir with hover violations.)
2018-03-01 10:43:51 +01:00
asofold 04e631733b Merge branch 'master' of https://github.com/NoCheatPlus/NoCheatPlus.git 2018-02-28 12:34:29 +01:00
asofold 79b3221c12
Merge pull request #49 from NoCheatPlus/manual-sf-vl-cooldown
Manual sf vl cooldown
2018-02-28 12:15:32 +01:00
asofold 79e3cc9046
Add in-air VL freeze. Regain hbuf if not frozen 2018-02-28 12:11:32 +01:00
asofold b68265dd56
Update MovingConfig.java 2018-02-28 12:03:12 +01:00
asofold 99b75084ea
Update DefaultConfig.java 2018-02-28 11:56:25 +01:00
asofold 356bdd217c
Add config paths for extended leniency settings. 2018-02-28 11:48:15 +01:00
asofold 2de92a9476
Make all of hover @GlobalConfig. 2018-02-28 11:22:10 +01:00
asofold 30902ec352 [BROKEN] Data storage overhaul (basics). (+)
(SAFETY COMMIT)

Largely breaking change.
* Interfaces in front of data types (and 'managers'), some interfaces
removed.
* Data and configuration fetching.
* Check activation checking (config flags, isEnabled, hasBypass).
* CheckType (activation checks, factories removed).
* Lots of collateral signature changes, including IPlayerData.

The (I)WorldDataManager stores per-world data (+ per world per check
type).
* Raw configurations.
* Typical flags: check activation, debug, lag adaption.
* Generic data, such as check configurations or per world check data.

The (I)PlayerDataManager stores per player data.
* Check Data.
* Typical flags: debug
* Exemption
* Check data (and config cache).
* Further mappings and later OfflinePlayerData.
* The registration interface will allow defining, how instances are
handled for registered types (factory, proxy, what on world change, what
on logout, global removal handler, per player removal handler).

(I)PlayerData is intended to be/become the central access point.
* External interface is IPlayerData now.
* Per player debug flags, exemptions.
* Fetching configuration and data: local cache, relaying fetching to
registered factories and proxy-registries/storage (e.g. fetching
configuration from per world storage).

Other fixes/changes:
(+) Extend the debug player command (set true/false, reset to world
default, arbitrary check types).
(+) PlayerData maintains a currentWorldIdentifier (to be used instead of
ChatData in future).
(+) The WorldConfigProvider getAll implementation returns a
LinkedHashSet now, avoiding duplicates.
(+) Move DefaultGenericInstanceRegistry to NCPCore.
(+) Thread-safety considerations for DefaultGenericInstanceRegistry.
(+) Don't log errors on hasBypass checking. TBD: Instead intercept
during listener methods (or even as a feature within the listener node:
e.g. @ThreadContext(primaryThread=true, skipOffContext=true,
cancelOffContext=true).
(+) Add fight.wrongturn permissions to plugin.yml.
(+) Missing GPLv3 headers.

Broken/Missing:
* WorldData inheritance from default: propagate all changes done
directly to the default config to children (all worlds that don't have
an explicit world_config.yml set) - possibly add an OverrideState or
similar, (NONE, FROM_DEFAULT, EXPLICIT) and don't override EXPLICIT if
coming from the default. Calling override on the default WorldData is
not to be confused with calling override for WorldDataManager (override
for all worlds as EXPLICIT).
* Organize overriding for special circumstances (version dependent
activation  and the like). Might want to add registered override
handlers to be called on reload automatically.
* Store generic per check type per world data in the WorldDataManager,
such as configurations and per-world check data. TBD: Factories, cleanup
(!).
* Most efficient referencing (IWorldCheckTypeNode, IHandle<something>?).
* All the registry stuff (see PlayerData).
* Use interfaces for auto registry (and a flag within
RegistrationContext?) - world unload, world change, player join / leave.
* (Data expiration handling including transition to IOfflinePlayerData,
because now data is a little heavier.)
* Further details.
2018-02-26 12:15:53 +01:00
asofold f2ba25b51a
Merge pull request #46 from 369David369/SelfHitFix
Use Entity Id's instead of Player Name for SelfHit
2018-02-19 11:03:01 +01:00
asofold 1af25ed0eb
Merge pull request #48 from 369David369/fixReadme
fix CompatNoCheatPlus Link in README
2018-02-15 21:38:13 +01:00
david ae2a378232 fix CompatNoCheatPlus link in README 2018-02-14 22:36:54 +01:00
david b513e6dfbd Use Entity Id's instead of Player Name 2018-02-14 18:09:12 +01:00
asofold 806e3c2ef8 The Bukkit Metadata API base implementation is thread-safe.
(Checking can be turned off.)
2018-02-11 15:05:06 +01:00
asofold 4a7efdc3a4 Add identity checks with various implementations of equals(Object). 2018-02-11 14:21:14 +01:00
asofold 4705f75fa0 Lock NCPAPIProvider against changing.
(Not really the best example application for ILockable.)
2018-02-11 13:52:56 +01:00
asofold 7b8390dd5a Implement some kind of support for locking of registered items.
(Or registry items.)
2018-02-11 13:29:51 +01:00
asofold d3a66b01ba [BLIND] Add fight.wrongturn: Just kick for invalid pitch. 2018-02-10 10:24:04 +01:00
asofold cec4a4d129 [BLEEDING][BREAKING] New implementation for exemption. (+)
* Store the per check type flags within PlayerData/PlayerCheckTypeTree.
Access methods within PlayerData.
* (More) thread-safe access, with the twist that alterations are mostly
done within the thread-context (primary thread vs. asynchronous).
(+) Mimic legacy behavior, by non-nested entries. However untouched
nested entries are possible, creating ExemptionContext instances with
other negative ids.
(-) No ExemptionRegistry is implemented. This just aims at replacing the
internals, without altering the (legacy) behavior.
2018-02-08 12:48:33 +01:00
asofold eb41f4397a Add GPLv3 headers where missing. 2018-02-08 08:43:32 +01:00
asofold 0bfa016fc2 Iterate over the changed permissions.
Assume the referenced permissions in the cache to be rather complete,
and the changed ones to be few.
2018-02-08 08:35:37 +01:00
asofold 6dbb7d4299 [BREAKING ] Lazy permission updating.
* Each asynchronous permission check yields an update request anyway,
thus frequent bulk update requests have been removed.
* With join and world change, lazy permission updating is requested.

Breaking:
* Remove CheckConfig.getCachePermissions().
2018-02-08 01:27:47 +01:00
asofold 4bfc4f2cd2 Fix heavyLoad constant. Include TickTask.getLag.
The original idea had been to just count an abstract value for load, so
the number of permission checks per tick stays limited, however that
doesn't scale with the CPU power and other.
2018-02-07 23:44:46 +01:00
asofold 3d8eb00981 Despite soon to be replaced by thread-safe read, warn her.
*here.
2018-02-07 18:52:18 +01:00
asofold eabd648ad7 Skip (most) lazy permission updating in case of heavy load. (+)
This doesn't account for lag, but keeps the impact down slightly. Not
sure this is really useful.

(+) Only run set back for online players. Quitting has to be handled
differently.
(+) Comments.
2018-02-07 18:46:03 +01:00
asofold 5d5e45e2df Set default child permissions in plugin.yml. 2018-02-07 16:54:03 +01:00
asofold 6f4c61d8f3 [BREAKING] Remove legacy behavior for notify permissions.
* Remove the old per-world permission cache.
* Use the new permission caching feature.
* Always use permission subscriptions.

Pitfalls:
* Permission subscriptions might fail under certain conditions
(legacy?).
2018-02-07 15:15:34 +01:00
asofold c50cc4f052 Add child permissions within onEnable already. 2018-02-07 14:46:00 +01:00
asofold ad87137711 [BREAKING] Fix fall damage with jump effect (for most).
Only count the fall height below the set back y from lift-off (rather).

Breaking:
* Adjust method signatures and public visibility / interface for NoFall.
2018-02-06 14:53:42 +01:00
asofold f6519ef289 isInfinite... 2018-02-06 13:46:26 +01:00
asofold 658de28fcd lostground: adjust for equipped end portal frame.
Allow slightly lower amounts of negative y-Distance.
2018-02-06 12:36:07 +01:00
asofold 715a49d1bd Passable / initially colliding blocks: catch 1.5 height.
Just check bounds vs. blocks up to 0.5 blocks lower within
BlockProperties.collectInitiallyColliding.
2018-02-06 12:17:27 +01:00