Commit Graph

638 Commits

Author SHA1 Message Date
asofold
5b0807847f Don't give silent permissions as child permissions by default. 2017-01-17 01:03:55 +01:00
asofold
8465c40d93 Register .silent check permission in postEnable.
Issue: https://github.com/NoCheatPlus/Issues/issues/353)
2016-12-28 10:37:34 +01:00
asofold
11be3c7c0d Register the inventory.open permission.
Found via auto-generating .silent check permissions :p.
2016-12-28 10:30:35 +01:00
asofold
5089447aa1 Add a dedicated compatibility module for 1.10.x (1.10 R1).
* Auto generate the sub-module file structure.
* Add rest manually.

Rest
* Enter new classes into factories.
* Add entries for modules and dependencies to the root pon and the
NCPPlugin pom, to make the new module represent 1.10 R1.
* Point the 1.10_r1 build profiles to the new module.
* Add a new module for 1.11, point to cbdev (which still is 1.10.2,
though).

Next steps (next MC release, probably):
* At least auto generate a file, containing all entries to make for the
new module, for convenient use with copy and paste.
* (Later: alter the files automatically, possibly interactive. Needs
more care, e.g. if profile entries already exist. The factory entries
can have a marker each.)
2016-12-27 23:36:03 +01:00
asofold
21eb53f7f2 Guard vs. ReflectBase not being available. 2016-12-19 07:51:12 +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
e7aab4272e Use https for dbo. 2016-12-04 14:35:07 +01:00
asofold
5939e1e206 Add per-path build numbers. Activate BlockChangeTRacker by default. 2016-11-26 14:16:08 +01:00
asofold
892af50209 Ensure to keep handles forever, once fetched.
(Less headaches with reloading the configuration and similar.)
2016-11-25 22:25:51 +01:00
asofold
6c73ab005e Properly unregister disabled handles, lazily.
Actually, proper would be to unregister the handle properly on disabling
it, not with the next fetch.
2016-11-24 00:40:58 +01:00
asofold
1058a45bbe Ensure we don't attempt to hand out disabled handles.
https://github.com/NoCheatPlus/Issues/issues/313
2016-11-24 00:25:56 +01:00
asofold
7db3a7d45a Note on order of registration. 2016-11-24 00:24:58 +01:00
asofold
f2b245010f Allow ProtocolLib 4.2.0 on MC 1.11.x. 2016-11-22 12:49:48 +01:00
asofold
da40bd06e2 Keep track of past block states within BlockChangeTracker.
We only have pistons for now, previous states of blocks are not yet used
for anything with this commit.
2016-11-21 01:09:37 +01:00
asofold
e3304141b2 Add MCaccess to registry early, also add a BlockCache instance. 2016-11-21 00:42:40 +01:00
asofold
b8746efcb7 Include the entire MC 1.10.x range with ProtocolLib 4.1 and later. 2016-11-02 19:10:46 +01:00
Gabriele C
84763fa113 Allow latest version of protocollib on 1.8+ servers 2016-08-16 22:37:02 +02:00
asofold
4b76522b06 Add [NoCheatPlus] tag for earliest/latest log messages. 2016-08-11 22:38:16 +02:00
asofold
20779443a2 Allow higher ProtocolLib versions for MC 1.10. 2016-07-11 01:06:01 +02:00
asofold
fc24fe529c [BLEEDING] Overall packet spam check for pre-1.9.
Not sure if this really pays, if most people use protocol-support
plugins that limit packets anyway. There could be some future use, e.g.
generic rate limiting with configurable implementation.

Other:
* New methods for RawConfigFile+ConfigManager to check for
AlmostBooleanS.
* Add all net check permissions to plugin.yml.
2016-06-26 22:18:43 +02:00
asofold
28f2a8928e Allow thread-safe fetching of instances (for now).
Using a LinkedHashMapCOW for now, fetching instances should be
thread-safe. This isn't such a big issue, but there might be handles in
asynchronously processed threads later on, and the handle will
initialize lazily. Copy on write won't be nice during registry setup, if
we have hundreds of objects registered at some point in the future,
neither would locking be too nice to have - but locking could be
acceptable with using handles, as those get updated by overriding the
instance field. Using locking would affect static utilities, but this
could be mended. An alternative could be to have some registration stage
'setup', during which fetching will yield the old state, while new
registrations will be added to a new map. Upon changing the registration
stage to 'live', the map reference is switched simply, this could be
acceptable even with a completely new setup after reloading the
configuration.
2016-06-26 14:12:12 +02:00
asofold
89dcd79327 Consistency fixes.
* Only unregister once really.
* Don't count to below 0.
* Throw a RuntimeException in getNewHandle, if already disabled.

(+ Allow checking if disabled for sub classes.
2016-06-26 14:03:49 +02:00
asofold
c9efd7b76c Add locking against changes to generic registrations.
Let default implementation use registration nodes.
2016-06-22 23:04:44 +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
bfc6422115 Move entity last position and look access to another package. 2016-06-20 22:14:35 +02:00
asofold
4653b46579 Quickly add box margins to LocationTrace/ITraceElement.
* Remove SharedContext.
2016-06-20 22:07:53 +02:00
asofold
b6088c3e3a [BLEEDING][BREAKING] Registry changes concerning MCAccess.
Main objective is to get rid of too complex setMCAccess methods and to
be able to store handles rather permanently instead.

* Remove MCAccessHolder.
* Add/refine interfaces and implementations.
* Change constructors.
2016-06-19 16:55:44 +02:00
asofold
92252a9dc4 [BREAKING] Rename the new DisableListener to IDisableListener.
(Plus call in reverse order of registration.)
2016-06-19 12:29:53 +02:00
asofold
d4acad924a Change order in onDisable (DisableListener, exemption, hooks).
The idea is to change internals towards having a 'default'
DisableListener executing onDisable before the data removal of checks
and DataManager have been called, thus plugins or even checks might
still access all sorts data with disabling the plugin.
2016-06-19 12:01:37 +02:00
asofold
931c02714a Register MCAccess with the GenericInstanceFactory as well. 2016-06-18 22:01:45 +02:00
asofold
bb8c8f4156 Add missing GPLv3 headers + accidentally add useless javadoc comments. 2016-06-18 17:57:16 +02:00
asofold
d6bb1e84bc Implement more efficient handles. 2016-06-16 23:34:52 +02:00
asofold
2bf3e14ab9 More on GenericInstanceRegistry.
* Add a way to stay updated about the latest registration state for a
class.
* Add a class for the registry.
* Let the registry log all registrations.
* Make super interfaces for LogManager (simple logging of
String/Throwable).

Missing:
* More streams (REGISTRY, PLAYER/CHECK_STATUS/EVENTS or just CHECKS at
least). Make status rather the plugin status. Registry could have an
extra file.
* More efficient IGenericInstanceHandle use (wrap + reference counting).
2016-06-16 22:23:54 +02:00
asofold
0868e30994 Allow to detect delegate players for some contexts. Other fix(es).
Attempt to treat fake players less Concept is subject to change, might
want fall-back methods or skipping native access in general where it's
not needed (thus not need to check for native entities).

Other
* Don't insert dataMan into disableListeners twice.
2016-06-16 01:30:19 +02:00
asofold
d5b45e53f9 Add support for IPostRegisterRunnable.
Allows to register with the generic instance registry for another class,
after component registration, with implementing this method.
2016-06-16 00:04:46 +02:00
asofold
d521a99ffc Remove legacy compatibility module for glowstone.
(Should have a look at GlowstonePlusPlus, perhaps.)
2016-06-15 23:08:59 +02:00
asofold
77465b09e3 [BREAKING] Move (registry) interfaces to sub-packages.
This is neither complete nor final. Intentions are to group interfaces
better, rather organizing packages in a flat way.

At some point there will be other major move-arounds, but that'll
hopefully be a point where we have a better idea of where to put what
(...). For now the approach is to move interfaces/things rather where
it's not interfering with profane exemption API use, preferably neither
taking down the top level API layer
(NoCheatPlusAPI). 

Added deprecated interfaces to prevent cncp to break too quickly.

Outlook:
* Classes that are rather only expected to be used internally for setup
will likely get moved around freely.
* Classes that have been added since last release might also get moved
around freely.
2016-06-15 16:13:59 +02:00
asofold
bcbab97f71 [BREAKING] Move default factories to a registry sub-package. 2016-06-15 14:03:55 +02:00
asofold
48bc795fd5 Make limiting parameters for block change tracking accessible.
(Not yet in use by default.
2016-06-15 13:51:36 +02:00
asofold
6f78eba4c4 Add build profile for 1.7_r4 (1.7.10). 2016-06-14 23:36:51 +02:00
asofold
8aced9d116 Use a class for version checking with ProtocolLib. 2016-06-14 00:16:30 +02:00
asofold
bddd898857 [BREAKING] Demand build profile ncp_base to be activated.
In order to simplify the pom.xml files, we now work with a ncp_base
(formerly 'minimal')
profile for the minimal configuration and demand this to be activated in
addition to other profiles. This means the build parameter 'ncp_base'
can/should be used as well. See the README.md for a table of build
profiles).
2016-06-13 12:45:50 +02:00
asofold
8ae36791a9 Let's not debug log these.
Perhaps later there will be extra settings and an extra log file for
registry/setup related output, while real errors would still be logged
to file/console.
2016-06-13 11:05:28 +02:00
asofold
d948357b46 Destructive hot fix for item duplication via end portals.
Configurable. Falling blocks, piston, end portal, roughly. Destructive:
the entity is removed.

(In addition some of the feature tags are added regardless activation
flags, because 'ncp reload' could change things anyway.)

Feel free to suggest alternatives/variations...
2016-06-13 00:14:15 +02:00
asofold
052e8c13ee Log supported version of ProtocolLib for MC 1.10. 2016-06-11 16:51:43 +02:00
asofold
1e3620ac38 Re-add/repair reflection based attribute access. 2016-06-11 10:26:24 +02:00
asofold
e0d6585f67 More flexible registration (fall-backs for dedicated and reflection). 2016-06-10 15:44:44 +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
f18e7e46d1 [BLEEDING] Guards for activation of IAtributeAccess implementations. 2016-06-09 23:40:09 +02:00
asofold
765383834b [BREAKING] Generic instance based attribute access.
MCAccess will be split into smaller providers with time, so do expect
more breaking changes of this type. If this is an issue, please contact
us, so we can see how to smoothen things. E.g. we could still make
MCAccess an aggregate, that just delegates to the more fine grained
providers, or we could provide other 
(default) aggregates.

This also adds a Bukkit-based provider for future updates.
2016-06-09 20:14:39 +02:00