Commit Graph

16 Commits

Author SHA1 Message Date
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 d3a66b01ba [BLIND] Add fight.wrongturn: Just kick for invalid pitch. 2018-02-10 10:24:04 +01:00
asofold 4e91a9d5fc Ready for UEFA EC: GPLv3 headers.
Might need more training still.
2016-06-02 20:33:21 +02:00
asofold f3d4941a6f Force disable FastHeal on Minecraft 1.9 and later.
Assume player ticking changes covering this.
2016-03-15 23:57:23 +01:00
asofold 70ce2086ab Let target switching only count with significant yaw changes. 2015-05-31 20:35:08 +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 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 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
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 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 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 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 24ccc4a5ea Spaces + comments, modifier. 2014-11-24 15:47:52 +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 4031cb55e8 [MEANWHILE] Refactor penalty time handling + add one for "item change".
Refactored penalty time handling to use a PenaltyTime object, taking
into account time running backwards, also unify attack (close combat)
penalties to a generic attack penalty. Combined.yawrate still keeps the
timeFreeze penalty, due to also cancelling other actions than melee,
still changed to a PenaltyTime object.

Changing the item in hand now leads to an attack penalty (that also goes 
for not changing the item, but changing the slot).

"Quick" addition, not much testing, except few unit tests.

Note that this could change false detection behavior of other sub-checks
of fight, because the penalty time is checked last. Previously checks
like direction or reach would have cancelled already if the player was 
within their penalty time. Hard to say if this creates new false
positives, but it will be more strict on continuous violations.
2014-02-02 23:37:29 +01:00
asofold ce834675d7 Move most code to NCPCore, removes NCPCompat.
Factories are now on NCPPlugin level, thus all the core stuff can be in
one module, giving better source code browsing.

Updates has been moved into an updates package, because there is to be
expected more content, and to make utilities less fat.

To indicate the direction, the basic infra-structure has been added to
allow adding components to the DefaultComponentFactory. Further
processQueuedSubComponents is now called after each components adding in
order to allow more flexible registry features.
2013-05-22 12:24:48 +02:00