Commit Graph

27 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
md_5 3a111dc4a5 Remove Block IDs 2017-12-06 16:55:29 +11:00
asofold 6584398d21 Re-check with alternate axis order on collision.
This will not check all possibilities, if default=YXZ fails:
* X or Z collision: test YZX as alternative.
* Y collision: test XZY then ZXY as alternatives.

Would need to check client code, possible of multiple client versions,
considering widespread use of protocol support plugins.
2017-05-04 13:19:56 +02:00
asofold b38cb4da99 Passable: Prepare fixes. Remove legacy code and options.
New
* Define a couple of default lists for axis order.
* Allow setting axis order via a list.

Removed
* Configuration option to disable ray-tracing.
* Configuration option 'blockchangeonly' - there may be an equivalent
later on, where checking accounts for the entire bounding box(es).
* Legacy code option (things have stabilized and axis order switching
should fix false positives).

Random
* Accidentally commit FastConsume (whitespace).
2017-05-04 13:17:36 +02:00
asofold c5e1f6ba2b [BLEEDING][BREAKING] Player move set back: cancel event + schedule TP.
Because Spigot changed to fire the teleport following an altered move
end point with TeleportCause.PLUGIN, we have to alter set back handling,
so we can ensure to keep TeleportCause.UNKNOWN for setting back players.

Instead of altering the move end point, the event is just cancelled, and
a teleport is scheduled (with a dedicated TickTask method). Uncancelled
moving events mean removing scheduled teleports.

[BLEEDING]
* Comparably simple change - more places and special cases may still be
uncovered.

[BREAKING]
* Plugins that may rely on the exact sequence of things within NCP, as
it used to be.

Random
* Change "set-back" to "set back" everywhere for simplicity, and to
obfuscate the actual code changes.
* Set backs are now going through MovingListener.onCancelledMove instead
of MovingListener.onMoveMonitorNotCancelled.
* Illegal move handling would still use event.setTo.
2017-04-02 15:01:23 +02:00
asofold 68eec44f14 [BREAKING] Move LocUtil to utilities.location 2016-12-27 15:28:36 +01:00
asofold 3cd7625516 [BREAKING] Make an extra package for block change tracking.
* Split off the BlockChangeReference, BlockChangeListener.
2016-12-05 14:29:57 +01:00
asofold e926f34963 [BLEEDING][BREAKING] Rework internals to use IBlockCacheNode (rough).
Intention is to work towards passing stored IBlockCacheNode instances to
methods in BlockProperties, i.e. to have
isOnGroundInAnOverlyOpportunisticWay implemented.

If you need one of the old BlockProperties signatures (or a more
simplified one), just open a GitHub issue.

This is a slightly peculiar change.
* Passing node and nodeAbove is a little bit odd, despite seemingly
efficient at present.
* Later we might need a BlockCache instance that busies about past
states (currently too complicated to implement).
* Uncertain impact (could perform better, could perform worse).
* Possibly left out a couple of places.
* Might have introduced bugs (fast forward).

On the other hand there may be a lot of other types of changes, if we
ever go for a less opportunistic implementation, which can not be
estimated simply, so this may be about the best that can be done, to get
a quick step in.
2016-11-28 14:30:57 +01:00
asofold baf09380f7 Check activity before using the BlockChangeTracker. 2016-11-26 22:57:28 +01:00
asofold 371afd91d0 Need to call updateFinal within MovingListener.
Necessary with multiple checks updating the BlockChangeReference/span.
2016-11-26 14:41:22 +01:00
asofold 206d627e9b Skip the legacy bull shit.
(Let's hope this doesn't enable anything unwaynted :p.)
2016-11-25 23:08:49 +01:00
asofold dec6ef1412 Opportunistic passable checking. 2016-11-25 23:06:06 +01:00
asofold 574390f90d Add 1.11 blocks. Add/alter comments. 2016-11-25 11:32:26 +01:00
asofold 7023fdb2af Fix passable fp with 2-high ceiling.
Can't judge side effects, concerning other passable like tests telling
the head to be inside a block by the micro margin, while passable allows
such a move now.
2016-10-31 22:00:52 +01:00
asofold 48a7e9c0e1 Run passable ignoring sneaking. Adjust box height for REL. 2016-08-07 15:18:45 +02:00
asofold 863b89763d [BREAKING] Move more classes around.
This time the focus is on the utilities package.

Possibly used, but not really official API:
* Move block cache to a 'map' sub-package.
* Move RichBounds/RichEntity/Player-Location and TrigUtil to a location
sub-package.

Not really official API, likely not used:
* Move AttribUtil to compat, since it belongs there.
* Split off direction check methods to collision.CollisionUtil.
* Move static BlockCache methods to map.MapUtil.
* Move food related methods from CheckUtils to InventoryUtil.
* Move vehicle/passenger related methods from CheckUtils to
PassengerUtil.

Not breaking:
* Move IdUtil to commons.
2016-06-21 09:56:50 +02:00
asofold da8b056a69 Decouple legacy code.
Easier to make configurable, easier to remove.
2016-06-11 20:23:36 +02:00
asofold fec027d41d Comments. 2016-06-11 20:04:38 +02:00
asofold 2ff0076e69 [BLEEDING] Switch implementation for moving.passable.
Switch to AxisTracing instead of RayTracing. This means most workarounds
are removed, including some (legacy) performance saving tweaks.
2016-06-11 15:49:49 +02:00
asofold b2d7c29814 [BLEEDING] Alter 'ignoreFirst' mechanics with collision checking.
Change to 'ignoreInitiallyColliding' and only ignore the first block, if
it really is colliding right now. The flag is not resetting with
set(...) anymore.
2016-06-11 12:39:25 +02:00
asofold f1ffb23686 Elaborate on ray-tracing with and/or passable.
* Add capability to cut margins opposite to the moving direction for
AxisTracing (extend interface(s)).
2016-06-10 13:36:04 +02:00
asofold 5d0d5d411d Meanwhile ... passable and ray-racing... and fixes.
* Increase precision of debug logging.
* Fix iteration conditions for the axes.
* Fix margins for collidesFence (method + THICK_FENCE workaround
parameter).
2016-06-10 11:29:25 +02:00
asofold 181502cdd4 More on Passable/RayTracing.
* Prepare more debugging.
* Move collides flag into RayTracing.
2016-06-10 08:46:09 +02:00
asofold 19312bdbfa [BREAKING] More on passable and ray tracing.
* Make RayTracing and PassableRayTracing implement interfaces. (rough,
not used in tests yet etc.).
* Optimize ray tracing use in BlockProperties.
* Add an axis-wise implementation (buggy, hardly tested, thus not used
yet).
2016-06-10 00:23:56 +02:00
asofold 4e91a9d5fc Ready for UEFA EC: GPLv3 headers.
Might need more training still.
2016-06-02 20:33:21 +02:00
asofold 96d95dff8e [BLEEDING][INSTABLE][BREAKING] Changes (see detailed commit message).
Major: Sketch vehicle envelope check.
* Renaming fields, methods, packages. Moving classes to other packages.
* Additions and refactoring for set-back handling and location tracking.
* Increase amount of debug logging.
* Adjustments to current vehicle set back handling.
* AuxMoving: call clear() on setMCAccess.

Minor: Adjust block change tracking implementation.
* Use a class instead of an id, in order to keep track of used entries.
* Allow reuse of an id, if the block still is intersecting.
* Improves situation for simple setup, issues remaining:
 * Random UNKNOWN teleport by server potentially interfering.
 * Distances > 1.0, possibly resulting from split move handling.
 * On-ground estimation and passable.
 * Blocks with gravity are worse (likely on-ground).
 * More in-depth checking of constraints of implementation.
 * Note that the block change tracker currently is disabled by default.
2016-04-26 13:31:20 +02:00
asofold a8954ad458 Moving: Move player checks into a player package for now. 2016-04-22 15:00:42 +02:00