Commit Graph

2986 Commits

Author SHA1 Message Date
Rsl1122
e04633d916 Improved name encoding of export filenames 2019-03-10 13:55:02 +02:00
Rsl1122
5ef3c64dc3 Added progress messages to export players command 2019-03-10 13:54:43 +02:00
Rsl1122
228e2d509c Removed some usages of DataContainer#getUnsafe
Fixes Unsupported Key exception on player JSON export
2019-03-10 13:27:04 +02:00
Rsl1122
3167cc5f6a [#958] Export Command + online status change export
Added /plan manage export that can be used to export all players
based on config settings. Arguments: list, players, server_json
Permission: plan.manage

Added a config setting 'Export.Export_player_on_login_and_logout' for
exporting player page and JSON based on config settings on
login or logout.
2019-03-10 13:11:39 +02:00
Rsl1122
0ed86b532c Workaround for ServerInfo related hang on enable 2019-03-08 16:31:10 +02:00
Rsl1122
c22740deaa [#956] Made serverBaseUser Query return a Set instead of List
Also changed BaseUser#equals to make sure only a single BaseUser per
UUID + name is present
2019-03-08 14:44:46 +02:00
Rsl1122
248e662414 Fixed test fail caused by transaction isolation
Since each transaction is isolated, any inserts done in the
transaction do not affect the queries in the transaction.

Since TestData had both PlayerRegisterTransaction and
PlayerServerRegisterTransaction (extends former) the tests failed as
query for plan_users register status returned false even though
the previously executed statement inserted the user.
2019-03-08 10:26:29 +02:00
Rsl1122
4215939deb Attempt to catch #956 with tests 2019-03-08 10:00:49 +02:00
Rsl1122
8a13f1d792 Created a better test dataset 2019-03-08 09:35:23 +02:00
dependabot[bot]
9fbf354cdd Bump nucleus-api from 1.9.0-S7.1 to 1.9.1-S7.1 in /PlanPluginBridge
Bumps nucleus-api from 1.9.0-S7.1 to 1.9.1-S7.1.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-07 12:22:03 +00:00
Rsl1122
972e54a351 Merge branch 'master' into development 2019-03-06 15:55:39 +02:00
dependabot[bot]
01eb4ead44 Bump mockito-core from 2.24.5 to 2.25.0 in /Plan
Bumps [mockito-core](https://github.com/mockito/mockito) from 2.24.5 to 2.25.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v2.24.5...v2.25.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-06 12:34:13 +00:00
dependabot[bot]
c6ad91241d Bump mockito-junit-jupiter from 2.24.5 to 2.25.0 in /Plan
Bumps [mockito-junit-jupiter](https://github.com/mockito/mockito) from 2.24.5 to 2.25.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v2.24.5...v2.25.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-06 12:20:43 +00:00
Risto Lahtela
f281f26543
[Merge] Version 4.7.1 (#950) 2019-03-06 10:25:26 +02:00
Risto Lahtela
302f36ab7f
Update versions.txt 2019-03-06 10:24:37 +02:00
Rsl1122
37a1d53251 Version bump to 4.7.1 2019-03-06 10:14:53 +02:00
Rsl1122
19f85afea3 [#948] Fixed Server JSON export 2019-03-05 16:47:55 +02:00
dependabot[bot]
ddf4414348 Bump nucleus-api from 1.8.3-S7.1 to 1.9.0-S7.1 in /PlanPluginBridge
Bumps nucleus-api from 1.8.3-S7.1 to 1.9.0-S7.1.

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-05 12:21:22 +00:00
Risto Lahtela
8cccd4d4d6
Update versions.txt 2019-03-05 14:15:23 +02:00
Rsl1122
423d9c88a0 [#943] Removed unnecessary Server UUID column from some queries 2019-03-05 13:36:29 +02:00
Rsl1122
a235bda099 [#942] Reproduced & fixed WorldMap error
Error was caused by two different unknown geolocations ("Local Machine",
"Not Known") mapping to null due to missing Geo code (eg. 'FIN')
2019-03-04 10:31:22 +02:00
Risto Lahtela
0f32c030e6
Update versions.txt 2019-03-03 19:42:29 +02:00
Risto Lahtela
45b33e49e0
[Merge] 4.7.0 (#941) 2019-03-03 19:41:32 +02:00
Risto Lahtela
720bfafb02
Merge branch 'master' into development 2019-03-03 19:40:53 +02:00
Rsl1122
cc4af67412 Fixed /server page back button 2019-03-03 19:15:37 +02:00
Rsl1122
d2551a206d Fixed concurrent modification on FileWatcher 2019-03-03 19:12:48 +02:00
Rsl1122
1f341c0921 Version bump to 4.7.0 2019-03-03 19:11:50 +02:00
Rsl1122
016e1dc4bc PluginData related error message clarification 2019-03-03 18:59:27 +02:00
Rsl1122
1c4938a3db [#934, #939] Attempt to fix broken databases 2019-03-03 18:46:28 +02:00
Risto Lahtela
d9c2934104
Update versions.txt 2019-03-01 11:32:49 +02:00
Rsl1122
fd2e45b204 Test against #934 on MySQL 2019-03-01 11:14:21 +02:00
Rsl1122
c9c696e71d [#935] Made GenerateAnalysisPageRequest run analysis async 2019-03-01 10:26:56 +02:00
Rsl1122
ad2208d7ff [Vuln] Login now blocked for 90s after 5 failed attempts. 2019-03-01 10:16:13 +02:00
Rsl1122
75782562f9 Fixed authentication message showing '/' 2019-03-01 09:41:41 +02:00
Rsl1122
6806e6c98e [#937] Fixed nested transactions that query database.
Nested transactions, Transaction#executeOther(Transaction), where the
inner transaction performed a query ran into NPE since the Database
used for the query had not been defined.
2019-02-28 19:18:17 +02:00
Rsl1122
5eef819308 Fixed bad default value in bungee config 2019-02-28 19:14:52 +02:00
Rsl1122
93e7410ad2 Fix PlanConfig constructor usage in tests 2019-02-28 17:52:05 +02:00
Rsl1122
be8a3b484f PlanConfig#getOrDefault 2019-02-28 17:46:23 +02:00
Rsl1122
233a930c9c Made transaction wait delay configurable 2019-02-28 12:54:31 +02:00
Rsl1122
b9ec70619a Increased database stop wait time: 5s -> 20s
This is to give more time for unfinished data transactions to execute.
2019-02-28 12:47:37 +02:00
dependabot[bot]
abc5296ee2
Bump caffeine from 2.6.2 to 2.7.0 in /Plan (#931) 2019-02-25 12:23:37 +00:00
Risto Lahtela
d5f51f52d3
Update versions.txt 2019-02-25 10:58:55 +02:00
Rsl1122
af8ff43c39 [#929] Removed custom Sponge DataSource MySQL implementation 2019-02-25 10:48:12 +02:00
Rsl1122
2fc8c7c29b [#930] Null check to WorldTimes#updateState 2019-02-25 10:36:53 +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
Risto Lahtela
bc2dc4abb8
Update versions.txt 2019-02-22 11:18:02 +02:00
Risto Lahtela
96564c90be
[Merge] [#818] Organized Database Classes (#920)
These can be summarized in 3 categories of changes:

### Moved SQL queries from `Table` classes to `Queries` classes.

`Table` classes were turned into static information classes that only contain statements and table fields for the tables. Classes with static methods were created that return `Query<T>` objects that can be passed to the Database. This simplifies addition of multi-table queries.

### Changes are now executed via Transactions

A new `Transaction` class was made, and executing row updating statements was limited inside these classes. This allows committing changes once per multiple statements (speedup) and rolling back partial failed transactions (reliability).

### Database ExecutorService and access lock

A single thread executor was added to be in charge of executing Transactions. All submitted transactions will be executed by this one thread.
Queries will be held until database is operational (Patches have been applied). This should alleviate issues such as #893

## Other changes

- SaveOperations, CheckOperations, CountOperations, SearchOperations were all removed. FetchOperations was completely deprecated, but since it is still provided by `PlanAPI` it was kept in place.
`FetchOperations` is scheduled for removal upon implementation of the new PluginData API.

- Database interface was not very useful, so it was changed to make it usable instead of SQLDB.

- [Wrong branch] Moved to using JUnit 5.4 TempDir instead of junitpioneer 

- `DataCache` was split off to a separate class `NicknameCache` and `SessionCache` no longer saves the session when ended, responsibility is now with the caller
2019-02-22 10:49:58 +02:00
Rsl1122
871fa9b979 Added a fail message to web traffic if database is not open 2019-02-22 10:35:36 +02:00
Rsl1122
ac7093237e Added a fail message to commands if database is not open 2019-02-22 10:17:27 +02:00