Commit Graph

126 Commits

Author SHA1 Message Date
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
Aurora Lahtela
f0a5b43f02 Fix Javadoc errors 2022-10-22 11:45:01 +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
a095eb2178 Javadocs for Table column formats 2022-09-04 09:05:06 +03:00
Aurora Lahtela
6f6b4f149f Fix gzip support for Jetty 2022-08-31 19:44:38 +03:00
Aurora Lahtela
6aae823850 Implement Access log functionality to Plan
- Store access log in database, clean logs after 30 days by default
- Add Webserver.Security.Access_log.Print_to_console setting
- Add Webserver.Security.Access_log.Remove_logs_after_days setting

Affects issues:
- Close #2328
2022-06-24 11:09:14 +03:00
Aurora Lahtela
c93317d0c7 Bump version to 5.5 2022-06-18 11:45:59 +03:00
Aurora Lahtela
92910d647a Revert API jar to Java 8 and update to Java 11 APIs 2022-06-18 11:31:53 +03:00
Aurora Lahtela
71424fa2ec Fixing IDEA code inspection issues
- Removed MethodAnnotations use in ExtensionExtractor
- Refactored duplicate code in
  - BaseUserQueries
  - GeoInfoQueries
  - JoinAddressQueries
  - KillQueries
  - NicknameQueries
  - WebUserQueries
  - TopListQueries
2022-06-05 16:59:35 +03:00
Aurora Lahtela
b74e338721
Query optimizations (#2320)
* Optimized network ping table query
* Removed icon id selection subqueries

- Take the icon ID into memory when the icons are stored

* Fix typos in the optimized ping table query
* Optimize server ping table query
* Attempt to optimize /v1/servers tps data query
* Optimize ping and geolocations tables uuid -> user_id foreign key
* Prevent Plan from crashing if patching takes too long

- HikariCP auto commit was true for some reason even though all transactions have commit mechanism built-in.
- The setting was reset during connection recreation and that could cause an index out of bounds error.

* Reduce try-nesting in ExecStatement
* Use user_id and server_id instead of uuid for plan_world_times table
* Use user_id and server_id instead of uuid for plan_sessions and plan_user_info table
* Fix more issues and test queries used by Query Filters
* Use deferRender for data tables to load data into the table faster
* Swap uuids to user ids for query page filters

Fixes an issue where SQL is too big to execute

Affects issues:
- #2196
2022-04-09 20:52:29 +03:00
Aurora Lahtela
3822155b40
Frontend BETA: Rewrite Player page with React (#2312)
* Add extension data to /v1/player endpoint
* Use node gradle plugin for building with yarn
* Add /v1/whoami endpoint
* Add back button to sidebar
* Selenium Tests for locale related js errors
* Convert locale system to use YAML-based storage
* Added a conversion process that runs on startup
* Replace cravatar.eu with crafatar.com for skins (more reliable)
* Add the Header made by Kopo to React

Co-authored-by: Antti Koponen <koponen942@outlook.com>

Affected issues:
- Resolve #1733
- Fixed #1092
- Resolve #1895
- Resolve #1965
- Partial #2260 
- Partial #2099
2022-04-06 17:37: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
Antti Koponen
2293760e7f
Add user & version JSON endpoints (#2131) 2021-10-18 19:25:25 +03:00
Aurora Lahtela
7d8b797b42
Fix CompositeResolver using its own isAuthRequired method (#2124)
Fixes CompositeResolver using its own isAuthRequired method instead of the child resolver, leading NoAuthResolver to need authentication in some cases.
2021-10-11 20:24:39 +03:00
Risto Lahtela
78209e99a6
Sonar cleanup for new smells (#1996)
* Rename "byKey" which hides the field declared at line 36.
* Define a constant instead of duplicating this literal "isStopped" 3 times.
* Remove this assignment of "pingMethodAvailable".
* Invoke method(s) only conditionally. Use the built-in formatting to construct this argument.
* Rename "getHandleMethod" which hides the field declared at line 36.

Make the enclosing method "static" or remove this set.
* Refactored some ping method things
* Rename "files" which hides the field declared at line 41.
* Add at least one assertion to this test case.
2021-07-10 14:52:24 +03:00
Risto Lahtela
c523e40b7f Refactored the request body PR stuff
- Made sure to not break compatibility with discord bots that use the old
  authentication via query parameters
- Query parameters now accept no-value keys
- Added access control checks for the errors endpoints
2021-07-10 09:11:39 +03:00
Emilia Dreamer
7a51ad9f15
Use POST method in requests such as login (#1988)
- Adds Request#getRequestBody method to the API
- Moves login and register parameters to request body

Co-authored-by: Risto Lahtela <24460436+AuroraLS3@users.noreply.github.com>
Co-authored-by: Henri S <vankka.main@gmail.com>
2021-07-09 20:31:04 +03:00
Risto Lahtela
e90606b68a
5.4: Java 16 support, remove H2 (#1932)
* Stop downloading dependencies at startup, include them instead
* 5.4: Removed H2
* Platform Abstraction Layer 5.0.0, delete dependency downloading
* Removed some unnecessary native sqlite drivers
* Serve jquery via CDN

Affects issues:
- Fixes #1886
- Close #1908 (No longer relevant, library no longer included)
2021-06-12 10:21:38 +03:00
Risto Lahtela
fa4a2e6595
Gradle 7 Update by Kopo (#1931)
Updates gradle to version 7 and sorts out all the deprecated stuff

Affects issues:
- Clsoe #1871

Co-authored-by: Antti Koponen <koponen942@outlook.com>
2021-06-12 08:24:24 +03:00
Risto Lahtela
99a13dfb04 Bump version to 5.3 2021-04-25 11:27:57 +03:00
Risto Lahtela
d3c4fd1f92 Made Caller more resilient to null player identifiers
It is now possible to call Caller#updatePlayerData with only one of the parameters
2021-04-25 11:25:30 +03:00
Risto Lahtela
bd7336b411 Plan API 5.2-R0.9: Fixed access issue with package private classes
Affects issues:
- Fixed #1862
2021-04-23 08:56:11 +03:00
Risto Lahtela
2247b9099c Plan API 5.2-R0.8: Reduced builder compiler errors 2021-04-17 09:40:07 +03:00
Risto Lahtela
9bf0838026 Plan API 5.2-R0.7: Group method databuilders & reduced builder compiler errors 2021-04-17 09:35:18 +03:00
Risto Lahtela
af858b8455 Plan API 5.2-R0.6: InvalidateMethod equivalent to ExtensionDataBuilder 2021-04-13 11:57:38 +03:00
Risto Lahtela
ab31f8a074 Plan API 5.2-R0.5: More lenient TabInfo annotation usage
- No more warning when TabInfo is defined without Tab annotations.
  This is because builders can define tabs regardless.
2021-04-11 11:53:44 +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
1fafd303d3 Publish Plan API 5.2-R0.2 with DataExtension Builder API 2021-04-09 11:00:53 +03:00
Risto Lahtela
9466dc3e9d Added a valueBuilder convenience method to DataExtension 2021-04-07 20:11:59 +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
2997e882a5 Fixed a bunch of IntelliJ inspection issues and typos 2021-03-23 11:57:01 +02:00
Risto Lahtela
9ee2a15008 Wrote tests for ElementOrder serialization 2021-03-20 17:34:58 +02:00
Risto Lahtela
2e753516e2 Revert changes to URIPathTest.java 2021-03-16 11:36:45 +02:00
Risto Lahtela
1c8fa4c18e Removed parameterized test names 2021-03-16 11:29:55 +02:00
Risto Lahtela
ebffd886fe Fixed parameterized test errors 2021-03-16 10:51:46 +02:00
Risto Lahtela
baab6e5f88 Fixing sonarcloud bugs and smells
Bugs fixed:
- LinkCommands: The return value of "orElseThrow" must be used.
- RegistrationCommands: Optional isPresent not same instance as Optional get

Smells fixed:
- Plan: "logger" is the name of a field in "JavaPlugin"
- PlayersTableJSONCreator: Reduce the total number of break and continue statements in this loop to use at most one.
- BukkitAFKListener, SpongeAFKListener, NukkitAFKListener, PlanAPI, CapabilityService: match the regular expression '^[a-z][a-zA-Z0-9]*$'
- TaskSystem: Reorder the modifiers to comply with the Java Language Specification.
- EntityNameFormatter: StringUtils.removeAll moved to RegExUtils.removeAll
- FiltersJSONResolver: fulfill compareTo contract
- ExportTask: Removed duplicate string literal
- FinishedSession.Id: Rename field "id"
2021-03-16 10:41:17 +02:00
Risto Lahtela
bdcd84749b Added some package-info files for javadocs 2021-03-10 11:38:48 +02: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
Risto Lahtela
b7af2a5717 Moved to using the new repository
- Updated some extensions
- Removed GriefPreventionPlus extension since it was no longer
  available anywhere for installing

Affects issues:
- Close #1779
2021-03-05 14:27:30 +02:00
Risto Lahtela
92cefaafa3 Publish plan-api with Github Packages instead
Affects issues:
- #1779
2021-03-04 09:41:12 +02:00
Rsl1122
94c9dd3f95 Username change Rsl1122 -> AuroraLS3 2021-02-13 15:16:03 +02:00
Risto Lahtela
15c9325eb4 Added activity index queries and placeholders.
- Added CommonQueries#fetchActivityIndexOf
- Added CommonQueries#getActivityGroupForIndex

- Added %plan_player_activity_index%
- Added %plan_player_activity_group%

Affects issues:
- Close #1663
2021-01-20 16:58:46 +02:00
Risto Lahtela
1664199574 Extension Table now handles Optionals
Updated mcMMO Extension to R1.2

Affects issues:
- Fixed #1643
2021-01-03 12:27:49 +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
e6f879783d Made a bunch of API holders use AtomicReference 2020-11-05 21:58:31 +02:00
FluxCapacitor
0ac5ad6f23
Send no response body when the response status code is 204. (#1610)
Affects issues:
- Fixed #1605
2020-10-15 21:03:13 +03:00
Risto Lahtela
12a264b1ea Made API Services volatile to avoid thread visibility issues 2020-10-11 15:12:26 +03:00
dependabot-preview[bot]
3d29aa0d98 Bump commons-lang3 from 3.10 to 3.11 in /Plan
Bumps commons-lang3 from 3.10 to 3.11.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-17 05:45:45 +00: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