9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2026-01-04 15:31:38 +00:00

Fix various potential memory leak and concurrency issues with acccount storage

This commit is contained in:
SamB440
2022-11-15 16:05:18 +00:00
parent 5d7a736dc0
commit b1b1162686
4 changed files with 54 additions and 6 deletions

View File

@@ -42,11 +42,17 @@ public interface IStorageManager {
void clearDiscovery(UUID uuid, String regionId);
void deleteAccount(UUID uuid);
/**
* Removes an account from the storage cache and saves its data.
* Removes an account from the storage cache and optionally saves its data.
* @param uuid player's UUID
* @param save whether to save the player's data
*/
CompletableFuture<Void> removeCachedAccount(UUID uuid);
CompletableFuture<Void> removeCachedAccount(UUID uuid, boolean save);
default CompletableFuture<Void> removeCachedAccount(UUID uuid) {
return removeCachedAccount(uuid, true);
}
/**
* Gets a UUID safe to use in databases.