From 5bf22ce8a29b6f74cc0fc029bc9095c0223dced3 Mon Sep 17 00:00:00 2001 From: ImmuState Date: Mon, 9 May 2022 10:09:19 -0700 Subject: [PATCH] Remove commented method and unused import. --- src/main/java/emu/grasscutter/database/DatabaseHelper.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/emu/grasscutter/database/DatabaseHelper.java b/src/main/java/emu/grasscutter/database/DatabaseHelper.java index 14a3e1c72..bfcd006df 100644 --- a/src/main/java/emu/grasscutter/database/DatabaseHelper.java +++ b/src/main/java/emu/grasscutter/database/DatabaseHelper.java @@ -4,7 +4,6 @@ import java.util.List; import com.mongodb.client.result.DeleteResult; -import dev.morphia.experimental.MorphiaSession; import dev.morphia.query.FindOptions; import dev.morphia.query.Sort; import dev.morphia.query.experimental.filters.Filters; @@ -97,14 +96,11 @@ public final class DatabaseHelper { return DatabaseManager.getDatastore().find(Account.class).filter(Filters.eq("playerId", playerId)).first(); } - //public static boolean deleteAccount(String username) { - // return DatabaseManager.getDatastore().find(Account.class).filter(Filters.eq("username", username)).delete().getDeletedCount() > 0; - //} public static void deleteAccount(Account target) { // To delete an account, we need to also delete all the other documents in the database that reference the account. // This should optimally be wrapped inside a transaction, to make sure an error thrown mid-way does not leave the // database in an inconsistent state, but unfortunately Mongo only supports that when we have a replica set ... - + // Delete mails, gacha records, items and avatars. DatabaseManager.getDatastore().find(Mail.class).filter(Filters.eq("ownerUid", target.getPlayerUid())).delete(); DatabaseManager.getDatastore().find(GachaRecord.class).filter(Filters.eq("ownerId", target.getPlayerUid())).delete();