Commit Graph

38 Commits

Author SHA1 Message Date
Aurora Lahtela de9f9ec5b4
Sonar fixes (#3510)
* Remove deprecated code

- RemoveUnsatisfiedConditionalPlayerResultsTransaction.java
- RemoveUnsatisfiedConditionalServerResultsTransaction.java

* Fix apache compress deprecations

- Use org.apache.commons.io.IOUtils instead of org.apache.commons.compress.utils.IOUtils
- Use TarArchiveInputStream#getNextEntry instead of getNextTarEntry

* Rename variable in BukkitPingCounter

* Extract ApiServices from PlanSystem
2024-03-09 14:43:41 +02:00
Aurora Lahtela b92dfdb127 Fix webserver disabling always by accident 2023-10-10 10:03:50 +03:00
Aurora Lahtela f67a02775f Fix deprecation smells 2023-09-24 08:39:01 +03:00
Aurora Lahtela 5061439d14
1623/access control (#3173)
* Add web authorization permission based on groups
  * Access and parts of website are limited by permissions
* Add group management in /manage page
  * Higher level permissions grant lower level permissions similar to Sponge
* Add command /plan setgroup, which uses plan.setgroup.other permission
* Add command /plan groups, which uses plan.setgroup.other permission
* Add more navigation based on permissions
* API modifications
  * User#hasPermission now returns true if user has parent permission in the tree
  * ResolverService#registerPermissions and ResolverService#registerPermission methods for adding new permissions
* Update locale with new lines
* Various unrelated fixes to CSS and code

Affects issues:
- Close #1623
2023-08-20 11:56:13 +03:00
Henri Schubin 96a14a24f5
Component DataExtension API (#2686)
* Component DataExtension API

* Finish up component extension data, add react-mcjsonchat library to the react dashboard in preparation for the rewrite

* Update Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/results/ExtensionComponentData.java

* Update Plan/common/src/test/java/com/djrapitops/plan/storage/database/queries/ExtensionsDatabaseTest.java

* Update Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/providers/gathering/DataValueGatherer.java

Co-authored-by: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com>
2022-10-29 08:23:16 +03:00
Henri Schubin c49276369f
Component API by Vankka (#2665)
Adds a new Component API that allows converting between color code representations in Strings
2022-10-16 13:21:49 +03:00
Aurora Lahtela aaec5eda8b Add since tags and remove some internal deprecated code 2022-08-31 12:48:20 +03:00
Aurora Lahtela 0910b3adef Disable DataExtension data updates during plugin shutdown.
The storage of this data during shutdown is skipped already,
but method calls to other potentially disabled plugins can throw errors.

Affects issues:
- Fixed #2432
2022-07-15 08:49:48 +03:00
Aurora Lahtela 37f11e3269 Remove PlanSystem#getErrorLogger
This code was improper use of dagger for dependency injection,
and could be fixed by introducing new method to Component classes
that gives the initialized ErrorLogger directly.
2022-07-15 08:34:18 +03:00
Aurora Lahtela b0be4f296d Use plugin classloader for thread context when initializing system
This allows ServiceLoader to find slf4j-nop provider for Jetty
preventing SLF4J "No provider" error

Affects issues:
- Fixed #2438
2022-07-15 08:21:23 +03:00
Henri Schubin bab0f273a2
Sponge API 8 port (#2119)
* Initial commit for Sponge API 8 port
* Change Sponge PAL version to include -sponge version suffix
* Comment out Nucleus w/ needs a update in ExtensionRegister
* Fix error with ArtifactVersion (from org.apache.maven) being relocated
* Correct todos related to getting values from ResourceKeys
* Cleanup sponge buildscript a bit
* Remove sout
* Update Extension-Sponge-Economy to 8.0.0-R0.3
* Convert to Sponge's new preferred way to load in jar resources
* Convert SpongeMessageBuilder and VelocityMessageBuilder into AdventureMessageBuilder
* Add back the command
* Update bStats to 3.0.0, re-enable bStats for Sponge
* Implement gamemode change mixin
* Remove unused import
* Update SpongeGMChangeListener's error logging as suggested

Co-authored-by: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com>

* PAL 5.1.0
* Add a check in SpongeCommand to update the ErrorLogger and Subcommand if the PlanSpongeComponent changes
* Combine try-with-resources in SpongePlanFiles#asStringResource

Co-authored-by: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com>
2022-05-29 17:08:50 +03:00
Aurora Lahtela 3804ea860d Use console sender messages to log colors to console
Affects issues:
- Fixed #2313
2022-05-07 09:59:23 +03:00
Risto Lahtela a8e6ef2944 Add support for table row formats and hex color codes
- Table rows are now formatted with chat colors by default if § character is in them.
- Hex color codes §x§f§f§f§f§f§f are now supported by chat color to html translator.

Affects issues:
- Fix #2220
2022-02-02 17:36:20 +02:00
Risto Lahtela 02c3abaf1b Added a warning about Java 11 being needed for 5.5 2021-09-18 21:41:45 +03:00
Risto Lahtela 84fa3ad4cd
Added server uptime (#2012)
* Wrote a query and utility for getting server uptime
* Added current_uptime to json endpoints
* Load current uptime on the website
* Moved nukkit repo to nukkit module
* Added equals and hashcode to QueryStatement and QueryAPIQuery
* Remove dependency on codemc repository

Affects issues:
- Close #1845
2021-07-18 10:43:38 +03:00
Risto Lahtela c3ce37bfa9 Plan API 5.2-R0.4: SchedulerService
Allows scheduling async tasks for platforms that don't have static
accessors for registering tasks, such as Velocity
2021-04-11 10:28:08 +03:00
Risto Lahtela 9302067a49 Plan API 5.2-R0.3: ListenerService
Allows registering listeners for platforms that don't have static
accessors for registering listeners, such as Velocity
2021-04-11 10:16:37 +03:00
Risto Lahtela 113d46669b
DataExtension Builder API (#1833)
* Rewrote annotated extension method extraction
* Enclose annotation based methods into a single ExtensionDataBuilder

All of the reflection related to extension annotation was difficult,
so now it's all dealt with in one place and it's abstracted away with the
upcoming builder based API.

Some odd additions had to be made to the interface, but they are mostly harmless,
as the annotations are used as method parameters where necessary. This way the
users of the API are unable to give weird values.

It was possible to reuse MethodWrapper and Parameters classes for calling the methods.

* Refactored server value storage to use builder data
* Refactored player value storage to use builder data
* Refactored table gathering to use builders
* Handle extension errors properly
* Javadocs for DataExtension builder API
* Removed DataProviders based implementation

- Renamed ProviderValueGatherer to DataValueGatherer
2021-04-07 19:09:38 +03:00
Risto Lahtela e1bffbcc1f
Swap Abstract Plugin Framework for Platform Abstraction Layer library (#1787)
Replaced Abstract Plugin Framework with Platform Abstraction Layer

Large amount of changes due to removal of features from the library,
and change of the way the abstraction is achieved.
Removes features from Plan:

    Removed debug logging (Considered useless when debugging issues)
    Removed /debug page (Considered useless when debugging issues)
    Removed enable timing (Benchmarking utility was removed from the library)
2021-03-09 11:36:07 +02:00
Rsl1122 94c9dd3f95 Username change Rsl1122 -> AuroraLS3 2021-02-13 15:16:03 +02:00
Rsl1122 6effdbec39 Full System no longer required for database tests
- Extracted ErrorLogger interface
- Created a new Component for Database tests
- Added TestAPFModule and TestSystemObjectBindingModule
- Database tests no longer enable the full system

Affects issues:
- Close #1401
2020-11-08 11:46:44 +02:00
Risto Lahtela 7420e46df2 Fixed SonarCloud code smells
- Redundancies:
  - MySQLDB: Removed null check
  - DeathEventListener: Removed warning suppression
  - several Test classes: Removed public class identifier
  - Unused private fields
- Constructors of abstract classes should be protected x31
- Added missing Parameterized types x2
- "throws" declerations for runtime EnableException
- Prevented Boxed Boolean from causing NPE in the future x15
- Renamed lesser scope variables that were hiding variables x12

- Some smaller ones that I was too tired to write down
2020-11-05 23:16:01 +02: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 081f378135 Refactored Address based rules to a class
Affects issues:
- Fixed #1380
2020-03-28 11:51:11 +02:00
Risto Lahtela dae96ef53d Implemented ResourceSvc
- Customizable resources
- Snippets
- Fixed issue with a web resource being fetched on enable (favicon in ResponseResolver)
- Fixed some issues with Config#addNode used in an orElse block of Optional
- Deprecated PlanFiles#getCustomizableResourceOrDefault
2020-03-20 22:26:02 +02:00
Rsl1122 a8126f6669 Rename VersionCheckSystem -> VersionChecker 2020-03-14 12:39:56 +02:00
Rsl1122 2736ba042a Refactored /debug page to use ResolverService
Some issues that were identified:
- Going to /debug/ makes the style requests return the debug page content
  because the /debug resolver is used
- In the future when / is to be resolved it might override a bunch of requests.
- Use of RequestTarget as incompatible with URIPath for some reason which lead to infinite
  redirect, so the attempted change was reverted before this commit.
- Some Responses are using PlanFiles to obtain a html file (SRP violation)

Rest of the pages still use the old resolution that is now deprecated.
2020-03-14 12:37:23 +02:00
Rsl1122 9c74c40f72 Renamed some Service related classes 2020-03-14 12:35:06 +02:00
Rsl1122 36579cfcd0 Revert commit '4e8f509'
Affects issues:
- Fixed #1344
2020-02-29 10:00:03 +02:00
Rsl1122 4e8f509ebc Register extensions after all plugins finish starting up
Affects issues:
- Fixed #1335
2020-02-20 14:59:30 +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 fd3dd3e313 Added Logo to the plugin enable 2019-09-21 17:06:27 +03:00
Rsl1122 f27aece88b Disabled Bukkit/Sponge webserver if Proxy in db 2019-09-21 12:17:04 +03:00
Rsl1122 a6a16764dc Fixed old API (deprecated) not being initialized 2019-09-08 20:36:10 +03:00
Rsl1122 2059ac4f19 Registered FactionsExtension 2019-09-03 09:32:39 +03:00
Rsl1122 5d3bc4c95d Implemented SettingsService 2019-09-03 09:32:38 +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