Commit Graph

2968 Commits

Author SHA1 Message Date
asofold
7243ab7538 Quick fix attempt for placed material issues with off-hand. 2016-07-20 10:03:17 +02:00
asofold
20779443a2 Allow higher ProtocolLib versions for MC 1.10. 2016-07-11 01:06:01 +02:00
asofold
514877e1d1 Another reason for dynamic check type registration. 2016-06-27 06:52:33 +02:00
asofold
eeb4922ca8 Proper activation check. 2016-06-26 22:25:35 +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
b420f34f23 Add a method to test activation via AlmostBoolean for all configs. 2016-06-26 14:37:03 +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
2623a1ae5c Add a sequence count to DataPacketFlying.
Set with adding to the flyingQueue.
2016-06-25 10:57:43 +02:00
asofold
cce7e76211 The idea of choosing a simple implementation was to skip debugging. 2016-06-24 23:38:27 +02:00
asofold
889d21c1d5 Add convenience method to set the AABB. 2016-06-24 20:54:08 +02:00
asofold
050760afd2 Complete initial draft for ICollideRayVsAABB.
(Blind/untested.)
2016-06-24 20:38:43 +02:00
asofold
a38e63d4a9 Let DataLocation extend IGetPositionWithLook.
(+Implement DataLocation.hashCode.)
2016-06-24 19:15:14 +02:00
asofold
3bdb5414ae Simple and incomplete implementation for ICollideRayVsAABB. 2016-06-24 19:04:44 +02:00
asofold
de2db16d08 Correction/clarify. 2016-06-24 10:09:43 +02:00
asofold
7df0f74d5d vehicle.envelope: Minecarts.
The envelope check will need more adaption for false positives, e.g. for
skipped moves with boats.
2016-06-24 09:55:55 +02:00
asofold
67e7b95901 Allow walking on soil at the reported height (~1.10.2). 2016-06-23 22:41:18 +02:00
asofold
99df1f65da Let's have different climb speed thresholds for ascend and descend.
Configurability ... later.
2016-06-23 20:23:18 +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
97129c13d6 Watching football yields... 2016-06-22 18:59:49 +02:00
asofold
f32f4f6080 [BREAKING] Rename ICollide to ICollideBlocks. Add interface.
* ICollideBlocks matches the interface better. If we ever need ICollide
for something common (e.g. set(ICollisionSetup) allows to fetch
information about start conditions and run generic tests !? not really
sure if such will happen...)
* Add ICollideRayVsAABB, to prepare other types of direction/visible
checking (enable more precision, but also configurable leniency).
2016-06-21 10:58:16 +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
2c614cce91 Prepare a more strict fight.direction check. 2016-06-20 22:56:43 +02:00
asofold
d8e8ecdeb0 One more header. 2016-06-20 22:32:21 +02:00
asofold
7130fed017 Add a minimized interface for the odd width and height getting. 2016-06-20 22:21:34 +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
65525f3c14 [BREAKING] Move interfaces that don't auto register outside of feature.
registry.feature is rather meant for stuff that registers automatically
with adding as a component to the NoCheatPlus API.

Package organization isn't done in a very consistent way, this is just
taking a step into looking at how it would/could look like.

Likely that kind of separation can't be kept, so things will in the end
be organized by their main topic perhaps, and a registry implementation
will have to state what will be registered in what way, and possibly
have a method to allow checking what's possible to register.
2016-06-20 18:51:07 +02:00
asofold
fc90c7ef20 More headers. 2016-06-19 17:27:07 +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
9c9210e411 Make illegal move kick messages configurable. 2016-06-18 17:39:45 +02:00
asofold
307374254b Fixes for handling illegal vehicle coordinates.
* Only load chunks, if there is no illegal coordinates.
* If there is no valid set-back on receiving illegal coordinates,
attempt to recover from past move / current (bug), or kick.
2016-06-18 17:28:50 +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
87d3e5149b Notes. 2016-06-15 14:40:15 +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
c7f19bdbe6 Add PISTON_MOVING_PIECE as a default exception for now. 2016-06-15 13:50:48 +02:00
asofold
e8ff907f45 Implement peekFlyingQueue. 2016-06-15 01:03:32 +02:00
asofold
f87307562b Make the maximum for the horizontal buffer configurable (sf). 2016-06-15 00:44:22 +02:00
asofold
6f78eba4c4 Add build profile for 1.7_r4 (1.7.10). 2016-06-14 23:36:51 +02:00
asofold
acca3244a8 Also detect v123.5 for plugin versions. 2016-06-14 10:17:01 +02:00