Commit Graph

57 Commits

Author SHA1 Message Date
Phoenix616 e6a2d2f1c5
Cleanup: Properly log errors and remove unnecessary early return 2023-03-01 17:51:56 +01:00
Phoenix616 e3ab44ae32
Don't fail account UUID checks on players that are online
This should fix some issues with Floodgate which kept popping up
2022-11-23 22:15:21 +01:00
Phoenix616 d0af977212
Fix issue when creating sign with own name without existing account
This was only an issue if the autofill functionality for the own name wasn't used.
Now if there is no account with a certain name then the player can use it if it matches their user name
2022-07-06 20:05:21 +01:00
Phoenix616 e3cd50cf75
Add some debug logging for shop sign creation 2022-07-06 00:54:44 +01:00
Phoenix616 fd0035a99c
Build against 1.19 and replace apache-commons-lang 2022-06-13 22:52:26 +01:00
Phoenix616 f9a0bf90a3
Don't search unknown players by default
This shouldn't be needed in any of the internal usage of the event
 and could lead to unexpected network lookups.
2021-11-17 14:03:51 +01:00
Phoenix616 7b2fe6c1f3
Rework how accounts are queried from (short form) user names
The AccountQueryEvent will now check both, short names as well as full
 names and the getAccountFromShortName method will no longer check full
 names or offline player names. (Names in a short format wouldn't match
 them anyways)
This should not change the overal behaviour as the plugin uses the
 AccountQueryEvent internally as that is now checking for full name/
 offline player accounts. (And short names are matched first)
2021-02-24 15:18:15 +01:00
Phoenix616 22d3f262f5
Improve NameManager OfflinePlayer and UUID version handling (#383)
This also removes the deprecated methods which might interact with the
 changed methods in unintended ways from the NameManager and the
 PreTransactionEvent.
2021-01-28 15:26:23 +01:00
Phoenix616 00fa83c56a
Improve UUID version handling (Fixes #382, #337)
This adds a new config option ENSURE_CORRECT_PLAYERID which lets one
 disable the check whether or not a player's UUID version matches the
 server's online/offline mode UUID version. Due to potential issues with
 offline players which might occur when this isn't checked disabling
 this can't really be supported and any issues should first be tested if
 they still occur with this option enabled.

This also forces the UUID to version 4 if the server runs in online mode
 as it should not be necessary in any normal setup to detect the UUID
 version dynamically in that case. (Dynamic detection is only necessary
 for offline mode which might potentially run behind a proxy)
2020-11-16 14:09:07 +01:00
Phoenix616 741a10cb95
Update server economy account warning to include shop creation and uuid 2020-09-08 12:20:19 +01:00
Phoenix616 8c1c80e138
Don't log SERVER_ECONOMY_ACCOUNT warning if it's not set 2020-07-04 18:18:59 +01:00
Phoenix616 183c724583 Improve Metrics and add /csmetrics command
This adds some more logging to the metrics for some interesting plugin
 settings as well as player account and transaction counts. This data
 about account count and average transaction and item counts is also
 exposed ingame via the /csmetrics command.

This also removes the outdated mcstats metrics as that site is long dead
 now, the last data is from two years ago...
2020-06-19 21:47:28 +01:00
Phoenix616 4673a3f00c Use AccountQueryEvent in NameManager#canUseName utility method 2020-05-02 19:25:44 +01:00
Phoenix616 3bed1261aa Move account access check to an event
This should be the final addition that allows other plugins to implement
multi-owner/group shops like requested in #119 and #133 by listening to
all the transaction events to handle money flow and shop/account access
events to enable access to the actual shop.
2020-05-02 15:32:48 +01:00
Phoenix616 c6f6672188 Fix uuid version check 2020-04-27 21:39:46 +01:00
Phoenix616 744b02a447 Add ability to configure server economy account UUID
This adds better support for fake server economy accounts by not
requiring that a player with the name already has an account but allow
automatic creation of the account with the fake UUID provided in the
config.

Old configs that only define the name will still work though.
2020-04-27 21:00:46 +01:00
Phoenix616 2a37304113 Specify locale when changing case (Fixes #291) 2020-01-29 16:35:04 +01:00
Phoenix616 5eb467a1d3 Set UUID version if players are online when manager loads (Fixes #265) 2019-08-20 13:15:41 +01:00
Phoenix616 930b2cc07b Use prepared queries to avoid special character issues (Fixes #258) 2019-07-29 18:50:26 +01:00
Phoenix616 ca94031ddf Fix wrong UUID version comparison logic 2019-05-07 23:48:04 +01:00
Phoenix616 b300798a62 Make querying of accounts by (short) name an event too 2019-05-06 23:49:16 +01:00
Phoenix616 2e0c5a3cac Fix issues with user account storage on shop creation
This fixes a bug where shop owner accounts would not be created in certain cases e.g. when the owner had certain admin permissions or created the account for another player while having certain admin permissions.
2019-05-05 19:23:04 +01:00
Phoenix616 b853afbd52 Fix issues with the permissions for using different player names
This adds separate permissions for accessing, creating and destroying of shops.
It also adds a config entry to allow using of a shop even if someone have access to it due to their permissions.
2018-11-19 21:10:48 +01:00
Phoenix616 96b5a675d6 Allow admins to use the admin shop in all cases
This fixes issues with the auto complete right click functionality not working with admin shops
2018-09-18 00:08:54 +01:00
Phoenix616 06e4e1bf17 Don't search offline players when checking for existing (Fixes #162) 2018-08-31 13:55:36 +01:00
Phoenix616 dd4177e7cb Query server's player cache for missing players
This uses a cache for players that we haven't found before so to not check the cache too often and also checks if the online mode of the queried OfflinePlayer matches the server's mode (gotten from the first logged-in player in order to be compatible with BungeeCord requiring the server to be in offline-mode.
2018-08-29 21:29:27 +01:00
Phoenix616 036d309965 [CI-SKIP] Fix some formatting inconsistencies
Remove spaces on empty lines and changed doc comment formatting
Also includes some minor comments and import fixes
2018-05-07 15:32:51 +01:00
Phoenix616 b22d8fd95d Move cache to own class in Breeze package 2018-03-12 21:01:03 +01:00
Phoenix616 1276c6f031 Add method to get the last account information from a shortened name 2017-11-17 22:08:06 +01:00
Phoenix616 29ef7f25aa Fix errors when server economy account is not defined or invalid 2017-11-15 21:13:07 +01:00
Phoenix616 2d45dcdac0 Get rid of expensive calls to Bukkit#getOfflinePlayer with a username
This changes events to store the database Account instead of an OfflinePlayer and deprecates any event method that uses/returns OfflinePlayer. This is necessary as Bukkit#getOfflinePlayer(String) queries Mojang for the UUID when the user was not found in the local cache. As we already store this information (name to UUID mapping) in our database we should not have no need to rely on querying Mojang. (This might make transactions fail for shop owners that haven't played before but that shouldn't really be an issue in most cases)
2017-10-29 23:50:24 +01:00
Phoenix616 e81077143e Also check for full account name permission 2017-09-26 15:39:08 +01:00
Phoenix616 1d80edbf9b Get rid of google dependencies
Mostly replaced with Java 8 features and our own cache
2017-09-23 15:19:00 +01:00
Phoenix616 4a71af39af Return account by normal name if name is longer than 15 cars (DevBukkit-1217) 2017-07-09 17:30:26 +01:00
Phoenix616 b3b9e690dd Fix NPE when server economy account info can't be found (DevBukkit-1216)
Also add a warning to the startup if that happens
2017-07-09 17:00:31 +01:00
Phoenix616 0525c70452 Rewrite NameManager to support multiple short names per user
This should fix the issue where the player's short name on the shop sign does not reflect the actual player's name. This works by storing every uuid-username combination together with the associated short name and the last time the player logged in with that combination.
2017-07-01 17:14:41 +01:00
Phoenix616 7271cebd91 Properly use the plugin's logger 2017-06-30 21:00:30 +01:00
Phoenix616 0b65a7cc92 Rewrite (and document) the NameManager
This should fix issues with how name changes are handled and also prevent short names of different players from clashing. It also uses guava caches instead of maps now with a configurable cache size
2017-06-30 20:28:18 +01:00
L4BORG 24eb1b1e19 Economy fixes, fix for https://github.com/dmulloy2/ChestShop-3/issues/11 2016-10-13 18:11:23 +02:00
Dan Mulloy e186635484 Try to fix a few more errors
Fixes #7
2016-09-20 15:45:18 -04:00
Dan Mulloy 050ce61347 Try to fix (or just ignore) a weird null pointer
Fixes #6
2016-09-20 15:40:41 -04:00
Dan Mulloy a13b2c9070 Fix a few NPE's caused by null accounts
Thanks @mibby
2016-07-07 12:15:43 -04:00
Andrzej Pomirski 7bc452e203 Switch to thread-safe DTOs 2015-07-05 21:56:42 +02:00
Andrzej Pomirski 02673dec94 Make DB code nicer 2015-05-22 13:26:07 +02:00
Andrzej Pomirski 13d83ec92a Fix Essentials' Eco problem 2015-03-21 16:11:33 +01:00
Andrzej Pomirski 28f9f08987 Fix money being transferred to the old username 2015-03-11 18:02:30 +01:00
Andrzej Pomirski 8c77057703 Fix the issue with name changes 2015-02-04 20:14:35 +01:00
Andrzej Pomirski c646dd16a0 FOUND THE CULPRIT. 2014-08-13 17:22:52 +02:00
Andrzej Pomirski bed883f7ae A small bugfix 2014-07-28 20:51:04 +02:00
Andrzej Pomirski 6bbfc93b27 Fix the "value already present" error 2014-07-22 22:03:50 +02:00