- Added CMDSender#supportsChatEvents because Nukkit players don't support
hover or click events. This means that isPlayer method is not sufficient
for finding out if the sender can produce these events.
* Improved Extension errors
* Removed scary reflective operation exception
* Additional context to SQL Exceptions
* Added error context to Listeners
* Added error context to most error logging places
* Ignore cyclomatic complexity of DBOpException
Adds context to almost all error logging situations, except those where it is unknown, or to commands that are being refactored on another branch.
Close#1245
Some paper methods are not available in old versions of Paper,
leading to exceptions.
Method for checking the existence of the methods was added
Affects issues:
- Fixed#1304
This commit is a squash of 8 optimization commits to TPSCounter.
1. Extracted duplicate code in TPSCounters to ServerSensors.
- TPSCounter tasks now live inside common module
- ServerTPSCounter and ProxyTPSCounter
- Gathering methods are implemented with ServerSensor interface:
Player count, TPS, Entity count, Chunk count
- ServerProperties#getOnlinePlayers was replaced with ServerSensor
- Fixed sonar smells: "Hiding field" in TPSStoreTransaction & NavLink
2. Optimizations down to 0.15ms / run
- Optimized entity+chunk count (same for loop)
- Added warm-up for system resource methods
- Removed Stream API usages
- Removed List copy operation
- Entities & chunks only count once per minute
- CPU & RAM averages now produced with Average class
- Maximum player count per minute now produced with Maximum class
Affects issues:
- Fixed#1289
- Reduced constructor parameters in Exporter
- Removed Throwable#printStackTrace calls
- Cleaned up SessionsMutator#toJSONMaps a little
- Replaced uses of getString/Number/ methods of PlanConfig with PlanConfig#get
- GeoLite2 downloads the file using License key, only if EULA is accepted
- Fallback to IP2C if GeoLite2 is not available
- Remove GeoIP.dat after successfully downloading GeoLite2-Country.mmdb
- Added case where geolocation fails to enable and doesn't cause issues
- Adds Apache commons-compress to the dependencies because of a tar archive
Affects issues:
- Fixed#1273
- Removed unused code in Reflection
- Removed duplicated Strings in GMTimes
- Added private constructor to TimeZoneUtility
- Renamed local variable in RegisterDateMinimizationPatch
- Replaced Function<String, Boolean> with Predicate in ExtensionRegister
- Changed AFKListeners to use primitive boolean
- Changed Config#get(Setting<Boolean>) uses to isTrue and isFalse
- comment to NukkitListenerSystem
- Implemented APF for Nukkit
- Copied Bukkit implementation and modified it for Nukkit
- Fixed SQLite not being present on Nukkit by switching to H2 on boot
Affects issues:
- Close#1020
Playtime was not being updated live for the player placeholders because
the Active session was not added in the PlayerContainer before
calculations.
- Added the active session (if present) to the placeholders
- Updated session state when it is fetched from the cache (world time)
Affects issues:
- Close#1209
- Fixed possible null issues with NicknameCache
- Removed bunch of unused code, such as:
- Point reduction algorithm implementations
- HighCharts data String parsing methods
- Unused Mutators
- Unused AnalysisKeys
- Leftovers from ConnectionSystem (Response codes)
- Unused queries (Leftovers from Server box and Players table queries)
- rendering.html.icon.Icons
- Made bunch of fields final
Note that old deprecated API classes do not have signature changes.
- Removed GenerateAnalysis & CacheAnalysis requests from InfoSystem
- Stopped using AnalysisContainer for /server page
- Moved constant placeholders to ServerPage
- Removed BootAnalysisTask, instead using PeriodicAnalysisTask
- Analysis command and periodic analysis task now export instead of
making requests anywhere, Bungee will not export on analyze command.
Bug:
- Unused result of orElseThrow in DataStoreQueries
- Missing synchronized keywords in ConfigChange
- PlanConfig#hashCode since equals exists
Blocker:
- Add assertion to BungeeSystemTest, SessionTest, CommonDBTest,
LocaleSystemTest, FileWatcherTest
- Removed BungeeBukkitConnectionTest (Not executed)
Critical:
- Fix typo in ErrorPageLang.AUTHENTICATION_FAILED_401 name
- Duplicate Exception definition in ConfigValueParser
Major:
- Renamed 'name' to 'playerName' in BukkitImporter
- Non generic exceptions to Reflection
- Extracted tenary to if in TableContainer, ProviderInformation
And some minor smells
* ShutdownHook: No sessions to save check
ShutdownHook now checks if it needs to save any sessions and does not
start the database if no sessions are unsaved.
* SessionCache.getActiveSessions() now immutable
* [#769] Bukkit and Sponge server shutdown save
Implemented following save procedure for Bukkit:
- On plugin disable check if server is shutting down and save sessions
- Shutdown hook triggered on JVM shutdown calls the same session save
- Save clears sessions from cache, so the sessions are not saved twice
Implemented following save procedure for Sponge:
- Listen for GameStoppingServerEvent
- On plugin disable ask listener if shutting down and save sessions
- Shutdown hook triggered on JVM shutdown calls the same session save
- Save clears sessions from cache, so the sessions are not saved twice
Test:
- Tests ShutdownSave on reload
- Tests ShutdownSave on shutdown
- Tests ShutdownSave on JVM shutdown
Fixed SonarCloud smells:
Level blocker:
- Removed 'dbType' field from CreateIndexTransaction (is in Transaction)
- Removed unused 'dbSystem' from AnalysisContainer
- Removed SaveOperations#session
- Removed DBSystem dependency from SessionCache, so SessionCache does
not need to be called from async thread. (SessionCache does not save,
responsibility now with the caller)
- Refactored UsersTable#getSavedUUIDs to a query
- Removed #getRegisterDates, #updateName, #getAllTimesKicked,
#getUUIDsAndNamesByID - not used
- Refactored UserInfoTable#getSavedUUIDs to a query
- Removed UserInfoTable#getServerUserInfo - not used
- Sorted out SessionQueries ORDER BY usefulness with a TreeMap
Level Critical (SonarCloud):
- Smell: Duplicated String literals in the Queries: " FROM ", " WHERE ",
" AND ", etc
- Smell: GeoInfoStoreTransaction static value assignment
- Smell: Patch - Duplicate switch case
- Smell: DataCache - Empty constructor without comment
- Some errors were encountered with removal of DataCache,
turns out if a dependency that has dagger modules that use some
class, a compile error occurs.
Thus the DataCache class was left in place until the uses are
removed from the PluginBridge.
- Removed RegisterProcessor
- Refactored UserInfoTable#isRegistered (both) to a query
- Removed UserInfoTable#isRegisteredOnThisServer
- Removed UserInfoTable#getServerUserInfo - not used
- Made login nickname processing non critical
- Removed ProxyRegisterProcessor
- Optimized name updating to occur on login instead of chat events
- This removes the need to store player names in the DataCache.
During testing it was found that:
- MySQL patches are still failing if they failed before (test_sessions
has foreign keys)
- Time.Thresholds.AFK_threshold was empty on fresh install (Leading to
NPE that was prevented)
This includes, but might not be limited to:
- First time the plugin enables successfully
- Plan is reloaded
- Bukkit-BungeeCord setup updates settings
- Plan is enabled after it was disabled
Following events are available:
Bukkit: PlanBukkitEnableEvent
Sponge: PlanSpongeEnableEvent
BungeeCord: PlanBungeeEnableEvent
Velocity: PlanVelocityEnableEvent
- Moved ConfigSystem classes to system.settings
- Moved WorldAliasSettings to system.settings.config
- Moved ServerSpecificSettings to system.settings.network
These labels have not been kept up to date and some might contain
out of date information (Packages have changed etc.)
It is better to not include them than include bad information.
- Added a new config updater that can move and remove config values
- Updated the config format to be easier to understand and read.
- Made config updater update old configs to the new format
- Removed Settings enum
- Added generics to Setting, changed from interface to a class
- Created new classes that hold static Setting objects
- Added generics to PlanConfig
- Added PlanConfig#get for getting Setting with generic types.
- Moved config calls made during object initialization,
possibly eliminating bugs that ignored config settings on first boot
- Added more export settings
- Added JSON Export (#700)
- Fixed Buycraft graph not following Locale setting for timestamps
- Extracted PluginBridge Bridge interface for mocking during tests
- Added Selenium test dependency
- Added Awaitility test dependency
- Added SeleniumDriver junit Rule that uses Chrome WebDriver
- Added all web files to Mocker in withPluginFiles()
- Added JSErrorRegressionTest
- Fixed Debug page error when testing
- Fixed BukkitTaskSystem error during tests
- Fixed missing demo.js from HtmlExport
These tests should prevent most issues of broken page in the future.
* Moved project files to 'common'-module
This is done so that refactoring into multiple smaller modules is easier
as the IDE will not attempt to move tests incorrectly when moving things
between different modules
* Created 'bukkit' module
Following classes were removed during the operation:
- BukkitServerInfo (Renamed to ServerServerInfo)
- SpongeServerInfo (could use ServerServerInfo)
- Hastebin (not viable on every platform, unused)
- HastebinTest
- MockPlayers (unused, bukkit specific)
Changes to classes:
- Renamed Importer to BukkitImporter (contained bukkit related impl.)
- Extracted Importer interface from BukkitImporter
- Turned BukkitPlanModule and BukkitClassBindingModule to interfaces by
using @Binds annotation
- Added Status class since PlayersOnlineListener had a boolean,
that stated if kicks were counted.
This commit completes split partially and was not pushed on commit.
* Created 'sponge' module
Changes to classes:
- Turned ServerSuperClassBindingModule, SuperClassBindingModule,
SpongePlanModule and SpongeClassBindingModule to interfaces by
using @Binds annotation
- Renamed SystemObjectBindingModule to SystemObjectProvidingModule
- Removed sponge related calls in ServerProperties
- Made EmptyImportSystem injectable
This commit completes split partially and was not pushed on commit.
* Changed shade configuration
Further tweaks required.
* Created 'bungeecord' module
Changes to classes:
- Removed use of BungeePingTimerTask in VelocityTaskSystem
- Removed use of RedisBungee in VelocityServerProperties
- Fixed bukkit command.commands.RegisterCommandFilter package
Changes to project structure:
- Dependency versions now in main pom via dependencyManagement
- Repositories now defined in main pom
* Created 'velocity' module
Changes to classes:
- Made RawDataResponse use Gson via reflection since it is no longer
available in dependencies of 'common' module
* Created 'plugin' module
This module is for creating a single deployment artifact and testing of
system interactions.
Fixes to tests:
- Reflection no longer fails to initialize if Bukkit.getServer() is null
- PingCountTimerBukkit no longer fails to be created if Reflection fails
- Removed unnecessary @AfterClass from H2Test
- Jar resource path fixes to Mocker
* Shading configuration
org.slf4j classes are relocated in 'common', 'bukkit' & 'bungeecord'.
In 'sponge' & 'velocity' they are not relocated, allowing injection
as plugin logger, while using slf4j-nop for HikariCP logging.
This allows single release artifact.
* Removed 'Icon' from .gitignore
* Attempt to fix test resources
Because all jar resources are located in 'common', an attempt to fetch
them is made to common/target/Plan-common.jar, which for some reason
is a bad path.
This attempts to remedy that by creating a temporary file from an
InputStream, read with Class#getResourceAsStream
Ignored HTTPSWebServerAuthTest as the certificate path was invalid for
some reason.