Commit Graph

221 Commits

Author SHA1 Message Date
Risto Lahtela
007e5bf1fb Implemented Nukkit MessageBuilder
- 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.
2020-10-06 10:59:38 +03:00
Risto Lahtela
97fdc4646b Implemented Velocity MessageBuilder 2020-10-06 10:59:38 +03:00
Risto Lahtela
a6af091e89 Implemented Sponge MessageBuilder 2020-10-06 10:59:37 +03:00
Risto Lahtela
01fb4c7d84 Registered plan export command
- Fixed dagger compile error
- Fixed checkstyle errors
2020-10-06 10:59:32 +03:00
Risto Lahtela
42669b7367 Merged Manage disable to disable command 2020-10-06 10:59:31 +03:00
Risto Lahtela
53e1539da9 Removed currently reimplemented commands 2020-10-06 10:59:25 +03:00
Risto Lahtela
c91d4f410b Table Formatter for console 2020-10-06 10:59:24 +03:00
Risto Lahtela
03bfe28762 unfinished work commit 2020-10-06 10:59:23 +03:00
Risto Lahtela
23b9d79dca Moved bukkit ping method check to enable
This static block was causing compatibility issues with some plugins that
modify classes at runtime.

Affects issues:
- Possibly fixed #1492
- References https://github.com/konsolas/AAC-Issues/issues/1971
2020-08-08 17:02:20 +03:00
Risto Lahtela
47ef46eb97 Handle null player for PlaceholderAPI
Affects issues:
- Fixed #1493
2020-06-19 16:38:23 +03:00
Risto Lahtela
93dc1bbb9e
Added more context to errors (#1450)
* 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
2020-05-15 12:20:29 +03:00
Risto Lahtela
e53b9f1602 Replace ErrorHandler usage with ErrorLogger
This was done to get deprecation to show up where context is not
given to the error logger.
2020-05-14 16:57:29 +03:00
Risto Lahtela
053e497fb5 Fixed build errors:
- Fixed PlaceholderAPI requirement for Bukkit
- Fixed Checkstyle errors
- Commented out some tests that were flaky
2020-05-03 10:12:11 +03:00
Risto Lahtela
24af980d39 More cleanup on placeholder classes 2020-05-01 10:49:55 +03:00
Risto Lahtela
4371595ccf Removed static usage from placeholders
- Dagger used to reduce the amount of method parameters.

Affects:
- #1404
2020-05-01 10:49:55 +03:00
Creeperface01
0066813c28 Refactor placeholders and add support for nukkit PlaceholderAPI (#1404)
by Creeperface01
2020-05-01 10:49:54 +03:00
Risto Lahtela
d6a7a43428 Made CPU, RAM and Disk gathering async
Affects issues:
- Fixed #1364
2020-04-12 14:26:30 +03:00
Risto Lahtela
081f378135 Refactored Address based rules to a class
Affects issues:
- Fixed #1380
2020-03-28 11:51:11 +02:00
Risto Lahtela
b339800650 Removed JUnit 4 2020-03-14 12:40:23 +02:00
Rsl1122
a8126f6669 Rename VersionCheckSystem -> VersionChecker 2020-03-14 12:39:56 +02:00
Rsl1122
9c74c40f72 Renamed some Service related classes 2020-03-14 12:35:06 +02:00
Rsl1122
9d26591dfc Formatted ping placeholder values
Affects issues:
- Fixed #1324
2020-02-08 19:20:19 +02:00
Rsl1122
0ee2d9a1e0 Fixed some issues with javadoc task 2020-01-24 12:22:41 +02:00
Rsl1122
d731919b26 Implemented %plan_player_favorite_server% placeholder
Requested on Discord in priority-support.
2020-01-24 10:45:26 +02:00
Rsl1122
73343f8d20 Change false assumption about paper methods
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
2020-01-24 10:41:23 +02:00
Rsl1122
c87f981d6a Rewrote TPSCounter Task
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
2020-01-17 21:11:05 +02:00
Rsl1122
8a059ced0b Added SystemUsage class
This class is collection of some methods in TPSCounter that
were refactored out of it.
2020-01-17 21:11:05 +02:00
Rsl1122
8dcfd3ad9a Fixed new sonar smells
- 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
2020-01-17 21:11:04 +02:00
Rsl1122
16a5b41db5 Implemented new GeoLite2 & IP2C geolocators
- 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
2020-01-17 21:11:02 +02:00
Rsl1122
732c7858d0 Fixing Sonar smells:
- 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
2019-12-17 10:41:50 +02:00
Risto Lahtela
2877fdc5ca
Implemented Nukkit Support (#1244)
- 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
2019-12-08 10:26:24 +02:00
Rsl1122
f641c44bf2 Added ACTIVE_SESSION to Player placeholders
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
2019-11-07 12:55:57 +02:00
Rsl1122
1511162f5b Fixed a bunch of IntelliJ inspections
- 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.
2019-11-02 16:28:43 +02:00
Rsl1122
0a2bb0d203 Player time placeholder changes
- Fixed time amount formatting
- Added player_server_ placeholders for all _time placeholders
2019-10-25 13:26:35 +03:00
Rsl1122
d20427ca5e Fixed some warnings reported by tools 2019-10-19 14:17:58 +03:00
Rsl1122
177c0af7d2 Fixed catch in Placeholder registering 2019-10-04 20:22:57 +03:00
Rsl1122
4c55c642bd Fixed Placeholder Registration on Bukkit 1.14 2019-10-04 20:20:41 +03:00
Rsl1122
e6696abffa PlaceholderAPI support (Thanks to aidn5) 2019-09-29 13:00:55 +03:00
Rsl1122
2fb979fc95 Added api as a dependency to other non-common modules 2019-09-26 11:14:46 +03:00
Rsl1122
dd6f2a1e30 Deleted Command usage related code 2019-09-21 12:51:56 +03:00
Rsl1122
826faa1b1a Deleted IP related code 2019-09-21 12:36:35 +03:00
Rsl1122
004364ca61 Fixed Session list displaying UUIDs for online sessions 2019-09-15 15:37:20 +03:00
Rsl1122
fee603a657 Fixed a few sonar smells 2019-09-03 18:22:27 +03:00
Rsl1122
8a5656e9dc Export of /player pages 2019-09-03 09:32:35 +03:00
Rsl1122
d1123525ac Export of /network page 2019-09-03 09:32:34 +03:00
Rsl1122
3f8a3d1521 Task for JSONCache cleanup 2019-09-03 09:32:33 +03:00
Rsl1122
d47dccc0f7 Removed ResponseCache invalidation calls 2019-09-03 09:32:32 +03:00
Rsl1122
fbdf6dbb45 JSONCache invalidation to some events 2019-09-03 09:32:31 +03:00
Rsl1122
06d4d2fef2 Moved utilities.formatting -> delivery.formatting 2019-09-03 09:32:31 +03:00
Risto Lahtela
66a19d7de1 Removed system. from packages (#1147)
* system.commands -> commands

* system.delivery -> delivery

* system.gathering -> gathering

* system.identification -> identification

* system.processing -> processing

* system.settings -> settings

* system.storage -> storage

* system.version -> version

* system -> com.djrapitops.plan
2019-09-03 09:32:30 +03:00
Risto Lahtela
0650f3e338 Interface redesign package restructuring (#1146)
* command.commands -> command.subcommands

* command -> commands

* commands -> system.commands

* system.locale -> system.settings.locale

* system.settings.changes -> system.settings.config.changes

* system.settings.paths -> system.settings.config.paths

* system.database -> system.storage.database

* db -> system.storage.database

* system.storage.database.access.queries -> system.storage.database.queries

* system.storage.database.access.transactions -> system.storage.database.transactions

* system.storage.database.access -> system.storage.database.operation

* Moved Query classes to system.storage.database.queries

* Moved Executable classes to system.storage.database.transactions

* system.storage.database.patches -> system.storage.database.transactions.patches

* system.file -> system.storage.file

* system.settings.upkeep

* system.storage.upkeep

* system.server.info -> system.identification

* system.importing -> system.gathering.importing

* system.listeners -> system.gathering.listeners

* system.gathering.timed

* Removed duplicate class

* data.container -> system.gathering.domain

* data.plugin.PluginsConfigSection -> system.settings.config.ExtensionSettings

* data.time -> system.gathering.domain

* system.afk -> system.gathering.afk

* system.cache -> system.gathering.cache

* system.status -> system.gathering.listeners

* system.export -> system.delivery.export

* system.webserver -> system.delivery.webserver

* system.json -> system.delivery.rendering.json

* utilities.html -> system.delivery.rendering.html

* system.delivery.rendering.html.graphs -> system.delivery.rendering.json.graphs

* system.delivery.rendering.html.pages -> system.delivery.rendering.pages

* system.delivery.upkeep

* utilities.file -> system.settings.upkeep

* data.store -> system.delivery.domain

* system.update -> system.version

* api.exceptions -> exceptions

* ShutdownHook -> system.gathering

* system.HtmlUtilities - > system.delivery.DeliveryUtilities

* PeriodicAnalysisTask -> PeriodicServerExportTask

* Deprecated APIv4 classes

* Removed ServerTaskSystem (Reduces headache)

* Moved & Fixed some tests
2019-09-03 09:32:26 +03:00
Rsl1122
7b52342d26 Removed pluginbridge as a dependency 2019-09-03 09:32:23 +03:00
Rsl1122
040c2c4f4b Fixed some tests not closing resources properly 2019-09-03 09:32:15 +03:00
Rsl1122
94506cb771 Removed "Refreshing Analysis" page
- 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.
2019-09-03 09:31:41 +03:00
Rsl1122
9613c1d7b8 Removed afk permission from map on leave (Memory leak) 2019-08-18 09:40:38 +03:00
Rsl1122
f9389c0ef8 Ported afk permission optimization to sponge
- Sponge AFK listener no longer constantly asks for afk permission
2019-08-18 09:34:16 +03:00
Rsl1122
c3f9d77698 Moved Bukkit tests to JUnit 5 2019-08-10 08:36:14 +03:00
Rsl1122
a802a56223 Updated Server platform versions
- Updated Bukkit versions to 1.13.2
  - Removed RegisterCommandFilter due to removed dependencies
  - Added api-version: 1.13 to plugin.yml
- Updated Bungee to 1.13

Affects issues:
- Close #1086
2019-08-09 09:42:33 +03:00
Risto Lahtela
b05ca2e5eb
Enforced some upper-limit checkstyle rules (#1132)
* Checkstyle: Enforced catch parameter name

* Checkstyle: Enforced ClassFanOutComplexity 85

* Checkstyle: Enforced ClassTypeParameterName

* Checkstyle: Enforced CommentsIndentation

* Checkstyle: Enforced CovariantEquals

* Checkstyle: Enforced CyclomaticComplexity 18

* Checkstyle: Enforced DefaultComesLast

* Checkstyle: Enforced EmptyCatchBlock

* Checkstyle: Enforced EmptyForIteratorPad

* Checkstyle: Enforced EmptyStatement

* Checkstyle: Enforced FileLength 1750

* Checkstyle: Enforced GenericWhitespace

* Checkstyle: Enforced HideUtilityClassConstructor

* Checkstyle: Enforced IllegalInstantiation

* Checkstyle: Enforced IllegalThrows

* Checkstyle: Enforced LambdaParameterName

* Checkstyle: Enforced LineLength 3000

* Checkstyle: Enforced MissingOverride

* Checkstyle: Enforced PackageAnnotation

* Checkstyle: Enforced NestedTryDepth 1

* Checkstyle: Enforced UnnecessaryParentheses

* Checkstyle: Enforced MethodLength 150

* Checkstyle: Enforced NoWhitespaceAfter
2019-08-09 09:02:46 +03:00
Rsl1122
484f3d5976 Fixed some code smells
! Removed BukkitImporter#getNames
- Refactored duplicate code in PerServerAggregateQueries
- Refactored duplicate code in BaseUserQueries
- Refactored duplicate code in GeoInfoQueries
- Refactored duplicate code in PingQueries
- Refactored duplicate code in 3 patches
- Refactored many duplicated string literals (SQL)
! Removed unnecessary Exception in GeoInfoStoreTransaction
2019-08-06 22:34:50 +03:00
Rsl1122
d81a2932ec [#1034] Setting for ping gathering 2019-05-09 15:41:33 +03:00
Rsl1122
4d261ce6e8 [#1034] sane handling of large delay options 2019-05-09 15:39:22 +03:00
Rsl1122
3e5a1ce793 Registered metrics on bukkit (forgot) 2019-05-09 14:53:24 +03:00
Rsl1122
eb78468f01 [#1029] Move bukkit bStats registration to server thread 2019-05-05 16:40:47 +03:00
Rsl1122
7510841ebd Fixed old code smells:
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
2019-05-03 15:11:56 +03:00
Rsl1122
bbb1152cd5 [#1012] Removed ServerProperties#getServerId 2019-04-24 22:16:04 +03:00
Rsl1122
23485310d1 Fixed wrong webserver address in db after enable 2019-04-23 19:51:07 +03:00
Rsl1122
24342947e3 Removed IP Hashes from database 2019-04-23 19:15:55 +03:00
Rsl1122
e18bf38637 Added a CapabilityService to api module 2019-04-07 13:45:44 +03:00
Rsl1122
ee795b7702 CallEvents.SERVER_PERIODICAL calls 2019-03-31 12:46:26 +03:00
Rsl1122
adb0a93713 Implemented Extension player method calls 2019-03-31 12:36:01 +03:00
Rsl1122
58e7534501 Implemented Caller and CallEvents filtering 2019-03-31 12:26:22 +03:00
Rsl1122
da33ec0b9e Extension data updating to login listeners 2019-03-20 15:55:48 +02:00
Rsl1122
e8da008538 Added 'extensions' module:
- Module is in charge of registering built in DataExtensions
- This is done via ExtensionRegister
2019-03-20 13:37:56 +02:00
Rsl1122
42464d503e Moved shutdown session save message to ServerShutdownSave 2019-02-24 12:41:07 +02:00
Risto Lahtela
16e6ef1dc7
[#769, #928] Session save on server shutdown (#927)
* 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
2019-02-24 12:28:58 +02:00
Rsl1122
8caa8350ca Fix nickname cache call blocking server thread 2019-02-21 21:25:27 +02:00
Rsl1122
1e87145767 Fixed sonar smells:
Level major:
- Specified exception in ServerServerInfo

Level minor:
- Unnecessary parentheses removed in BukkitUserImportRefiner

Level info:
- Removed DataCache
- Finished a todo in H2DB
2019-02-19 12:56:12 +02:00
Rsl1122
4f63a3771b Refactored database clean task out of the database
Fixed SonarCloud smells:

Level blocker:
- Removed 'dbType' field from CreateIndexTransaction (is in Transaction)
- Removed unused 'dbSystem' from AnalysisContainer
2019-02-19 12:51:52 +02:00
Rsl1122
0c893ea59c Ban and Operator status Transactions:
- Removed SaveOperations
- Removed BanAndOpProcessor, PlayerProcessors
- Removed UserInfoTable#updateOpStatus, UserInfoTable#updateBanStatus
2019-02-16 14:29:20 +02:00
Rsl1122
57695d6e43 Created SessionEndTransaction:
- 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)
2019-02-16 14:29:19 +02:00
Rsl1122
70e83a12b4 Refactored UsersTable#kicked to a transaction 2019-02-16 14:29:16 +02:00
Rsl1122
57f7cb710a Split identifier (UUID, name) related queries to own class. 2019-02-16 14:29:13 +02:00
Rsl1122
ee74fc328e Refactored BukkitImporter to use new db things:
- Refactored UsersTable#getSavedUUIDs to a query
- Removed #getRegisterDates, #updateName, #getAllTimesKicked,
  #getUUIDsAndNamesByID - not used
- Refactored UserInfoTable#getSavedUUIDs to a query
- Removed UserInfoTable#getServerUserInfo - not used
2019-02-16 14:29:09 +02:00
Rsl1122
9616d5b6f0 Fixed possible ExecutorService leak in BukkitImporter 2019-02-16 14:29:08 +02:00
Rsl1122
4f68a59dcb Removed old world removal from UserImportRefiner 2019-02-16 14:29:08 +02:00
Rsl1122
4eb8c6476a Bunch of code smells:
- 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
2019-02-16 14:28:55 +02:00
Rsl1122
71a5592fd1 Refactored NicknamesTable#saveUserName to a transaction:
- Removed NameProcessor
2019-02-16 14:28:37 +02:00
Rsl1122
4ecdc38f0a Fixed PaperTPSCountTimer constructor 2019-02-16 14:28:28 +02:00
Rsl1122
af674919e7 Refactored TPSTable#insertTPS to a transaction:
- Removed TPSInsertProcessor
2019-02-16 14:28:27 +02:00
Rsl1122
95d14ed73f Rename DataCache to NicknameCache:
- 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.
2019-02-16 14:28:23 +02:00
Rsl1122
5b3d687a60 Refactored PingTable#insertPing to a transaction 2019-02-16 14:28:20 +02:00
Rsl1122
acd2225c49 Refactored UserInfoTable#registerUserInfo to a transaction:
- Removed RegisterProcessor
- Refactored UserInfoTable#isRegistered (both) to a query
- Removed UserInfoTable#isRegisteredOnThisServer
- Removed UserInfoTable#getServerUserInfo - not used
- Made login nickname processing non critical
2019-02-16 14:28:15 +02:00
Rsl1122
feaf7849d2 Refactored UsersTable#registerUser to a transaction:
- Removed ProxyRegisterProcessor
- Optimized name updating to occur on login instead of chat events
  - This removes the need to store player names in the DataCache.
2019-02-16 14:28:14 +02:00
Rsl1122
d5adc7f428 Refactored UserInfo to have Server UUID in it 2019-02-16 14:28:12 +02:00
Rsl1122
cb22c0f80a Refactored GeoInfo storage into a Transaction:
- Refactored GeoInfoTable#saveGeoInfo into queries
- Removed IPUpdateProcessor
2019-02-16 14:28:07 +02:00
Rsl1122
9e9196b181 Transaction for storing World names.
Used on Gamemode change, World change or on join event.
This should ensure that the world name is stored when the session is
saved.
2019-02-16 14:27:59 +02:00
Rsl1122
2951be69a5 CommandStoreTransaction, changes to CommandUseTable:
- Refactored CommandUseTable#commandUsed into a transaction
- Removed 'extends Table' from CommandUseTable
- Made CommandUseTable constructor private
- Removed SaveOperations#commandUsed
- Removed CommandProcessor
2019-02-16 14:27:50 +02:00
Rsl1122
afa0715416 Removed outdated TODOs 2019-02-16 14:27:32 +02:00
Rsl1122
ef85cf942a Move DBType & Database related classes:
system.database.databases -> db
system.database.databases.sql -> db

- DBType
- Database
- SQLDB
- H2DB
- MySQLDB
- SpongeMySQLDB
- SQLiteDB
2019-02-16 14:26:18 +02:00
Rsl1122
57ddf070d2 [#777] Fixed network-server config file updating
TimeUnit.MINUTES was used where MILLISECONDS was appropriate,
the task would have ran once every 1000 hours instead of 1 minute.
2019-01-08 21:31:10 +02:00
Rsl1122
5d0f03c4c1 Fixed javadoc compile errors 2019-01-08 17:55:15 +02:00
Rsl1122
a59e5d65ea Fixed "async task can't be called from server thread"
This exception occurred at least on Bukkit.
2019-01-08 11:18:10 +02:00
Rsl1122
ca5eed979a Smell: duplicated implementation 2019-01-06 12:47:32 +02:00
Rsl1122
ff266893d1 More tests against issues found during manual testing
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)
2019-01-04 17:09:28 +02:00
Rsl1122
dd904b84fc Updated missing or outdated license headers 2019-01-03 13:12:19 +02:00
Rsl1122
4c7636b0c2 Removed Maven configurations (poms) 2018-12-19 19:14:06 +02:00
Rsl1122
51eb37c382 Fixed gradle shadow issues
Now relocation works, the relocated items were not being depended on
2018-12-19 19:08:07 +02:00
Rsl1122
8e2df1de9b Fixed Gradle build failing, shadow problems remain.
Shadow does not relocate classes in the final jar for some reason, and the final jar is bigger than what is produced by maven
2018-12-18 23:06:47 +02:00
MicleBrick
65221b1ba9 Add WIP gradle build scripts (#833) by Miclebrick
> Not actually fully functional, but it's a start
2018-12-18 21:13:05 +02:00
Rsl1122
8d199bcdc3 [#845] Added an event that is called when Plan enables.
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
2018-12-18 18:01:58 +02:00
Rsl1122
30bce4e365 Made it possible to run tests in parallel by class 2018-12-18 17:16:33 +02:00
Rsl1122
557fa83177 Sorted system.settings.config package
- Moved ConfigSystem classes to system.settings
- Moved WorldAliasSettings to system.settings.config
- Moved ServerSpecificSettings to system.settings.network
2018-12-16 14:53:12 +02:00
Rsl1122
3629a62fcf Removed @since labels
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.
2018-12-16 14:49:43 +02:00
Rsl1122
715111b433 Removed uses of PlanConfig#getString 2018-12-16 14:37:38 +02:00
Rsl1122
8161488747 [#777] Configuration format change
- 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
2018-12-08 11:44:10 +02:00
Rsl1122
f0deb1ce20 Test clean-up with ComponentMocker class rules 2018-11-26 11:02:18 +02:00
Rsl1122
b9fa29544d [#820] Regression tests using Selenium
- 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.
2018-11-25 19:11:24 +02:00
dependabot[bot]
23226b8aff
Bump maven-shade-plugin from 3.2.0 to 3.2.1 in /Plan/bukkit
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.2.0...maven-shade-plugin-3.2.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-11-12 06:47:59 +00:00
Rsl1122
9eaa350758 [Typo] Fix typo in license headers LGNU -> GNU 2018-11-11 20:55:44 +02:00
Risto Lahtela
ebaffcab5e
[Merge] Module split (#786)
* 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.
2018-11-11 12:55:09 +02:00