Commit Graph

24 Commits

Author SHA1 Message Date
Aurora Lahtela 8116063e62
Whitelist bounce gathering (#3511)
* Store bounced whitelist logins

* Add allowlist bounce endpoint

* Restore locale file indent from master branch

* Add UI for allowlist

* Update locale

* Fix sonar detected bug and implement database tests

Affects issues:
- Close #2233
2024-03-10 10:25:42 +02:00
Aurora Lahtela 3eff46523d Test and fix user move and combination transactions 2022-08-27 15:20:23 +03:00
Aurora Lahtela 368f1e5002 Various fixes to transactions
- Hopefully fix user_id relation error once and for all.
- Set timezone to 00:00 properly when MySQL initializes connection

Affects issues:
- Close #1239
2022-05-26 21:51:22 +03:00
Aurora Lahtela 17d39f518d Fix user_id reference error on ShutdownDataPreservationTransaction 2022-05-26 08:16:00 +03:00
Aurora Lahtela 52b8afe6cb Store join addresses separately and link to plan_sessions table for time data.
Affects issues:
- #2362
2022-05-20 19:32:00 +03:00
Aurora Lahtela 8bbbde4556 Fix registering plan_user row if missing when required
There was one error code for MySQL that used wrong message context to detect the missing user_id properly.

Wrote tests for all the extra functionality ensuring no exceptions occur.

Affects issues:
- Fixed #2361
- Fixed #2343
2022-05-14 11:00:34 +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 604bfd9e67 Add Plan version to /plan servers
Affects issues:
- Resolve #2245
2022-04-07 18:24:40 +03:00
Risto Lahtela 599bf4a837 LargeStoreQueries now stores missing world names as well.
Affects issues:
- Fixed #1848
2021-04-18 09:23:09 +03:00
Risto Lahtela 2bc15db6d0 Sort out player join address things
Applied some thought to how this stuff should work.
- nulls now possible in the column when value is not available
- Called "Join addresses" instead of hostnames
- Remove bogus data with a patch

- Proper hostname method for spigot
- Removed method calls from nukkit since there was nothing that sounded
  proper

Affects:
- Close #1798 (Copied all code over)
2021-03-17 11:31:27 +02:00
Risto Lahtela 8f85c23c2f Refactoring: ActiveSession, FinishedSession and ServerUUID
- Split Session into ActiveSession and FinishedSession, replaced their usage
- Replaced UUID with ServerUUID when the data type

Affects issues:
- Close #1746
2021-03-12 18:03:12 +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 4da7497d82
Player Hostname PieChart Added (#1679 #1786)
Affects issues:
- Close #783

Co-authored-by: Arnold Hamstra <youtube@minecraftercity.com>
Co-authored-by: Arnold <a_hamstra@hotmail.com>
2021-03-09 10:01:09 +02:00
Risto Lahtela ae4fb0c98e Fixed error in serverPreferencePieValuesAreCorrect test 2021-02-02 14:01:16 +02:00
Risto Lahtela 25e98ef7b5 Reproduced, tested and fixed DbOpException
Error was caused by table name alias in the query

Affects issues:
- Fixed #1731
2021-02-02 07:51:43 +02:00
Risto Lahtela bb5195e26d Changed all player tables to show active playtime
Previously the tables showed playtime (with afk time)

- Query result table
- Server players table
- Players page table

Affects issues:
- #1235
2021-01-29 11:02:51 +02:00
Risto Lahtela 5c102458ae Added a player table as a result to the query
Rewrote PlayersTableJSONCreator to not use String format anymore
2021-01-29 11:02:40 +02:00
Risto Lahtela 78888ff26d Fixed broken test 2020-10-06 10:59:53 +03:00
Risto Lahtela b375661047 Fixed inconsistency issues related to activity index SQL
- Subquery was not returning rows for active playtime of 0, fix: COALESCE
- Union was removing duplicate 0s, replaced with UNION ALL
- Query did not use floating point for calculation

Affects issues:
- Fixed #1388
2020-05-08 20:53:52 +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 65ca05a18e Tests to try reproduce #1396 #1388
- Reproduces activity index difference issue
  on H2 randomly.
2020-04-18 10:35:08 +03:00
Risto Lahtela 3e1f8e3c47 Split even more queries from DatabaseTest:
- Backup tests
- Nickname tests
- Ping tests (new tests)
- Server tests
- TPS tests
- World name tests
- UserInfo & BaseUser tests
- RemoveEverythingTransaction tests to each query test
2020-03-14 12:40:28 +02:00
Risto Lahtela 463b2edb02 Split more queries from DatabaseTest:
- WebUserQueriesTest for WebUser related queries
- More Session related queries
- Reduced checkstyle file length 1750 -> 1000
- Reduced checkstyle class fanout complexity 87 -> 60
- Reduced checkstyle cyclomatic complexity 18 -> 17
2020-03-14 12:40:27 +02:00
Risto Lahtela fd6877dcad Split Session related queries to own test class:
- Added a lot of new utility methods to RandomData
- Fixed a bug where duplicate PlayerKills were queried
  This bug was discovered by accident when PlayerKill saving was randomized
  for the tests.
- Testing constant REGISTER_TIME extracted
- String truncation constant extracted for KillsTable
  This was causing some Session equals issues due to truncated weapon names
- Session now sorts PlayerKill list as this was assumed in some places.
2020-03-14 12:40:27 +02:00