mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 02:40:50 +00:00
Fix game-related data not saving
This commit is contained in:
parent
31a02050cf
commit
bef455d50c
@ -1,7 +1,5 @@
|
|||||||
package emu.grasscutter.database;
|
package emu.grasscutter.database;
|
||||||
|
|
||||||
import static com.mongodb.client.model.Filters.eq;
|
|
||||||
|
|
||||||
import dev.morphia.query.FindOptions;
|
import dev.morphia.query.FindOptions;
|
||||||
import dev.morphia.query.Sort;
|
import dev.morphia.query.Sort;
|
||||||
import dev.morphia.query.experimental.filters.Filters;
|
import dev.morphia.query.experimental.filters.Filters;
|
||||||
@ -23,10 +21,13 @@ import emu.grasscutter.game.quest.GameMainQuest;
|
|||||||
import emu.grasscutter.game.world.SceneGroupInstance;
|
import emu.grasscutter.game.world.SceneGroupInstance;
|
||||||
import emu.grasscutter.utils.objects.Returnable;
|
import emu.grasscutter.utils.objects.Returnable;
|
||||||
import io.netty.util.concurrent.FastThreadLocalThread;
|
import io.netty.util.concurrent.FastThreadLocalThread;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static com.mongodb.client.model.Filters.eq;
|
||||||
|
|
||||||
public final class DatabaseHelper {
|
public final class DatabaseHelper {
|
||||||
private static final ExecutorService eventExecutor =
|
private static final ExecutorService eventExecutor =
|
||||||
new ThreadPoolExecutor(
|
new ThreadPoolExecutor(
|
||||||
@ -53,7 +54,7 @@ public final class DatabaseHelper {
|
|||||||
* @param object The object to save.
|
* @param object The object to save.
|
||||||
*/
|
*/
|
||||||
public static void saveGameAsync(Object object) {
|
public static void saveGameAsync(Object object) {
|
||||||
DatabaseHelper.eventExecutor.submit(() -> DatabaseHelper.saveGameAsync(object));
|
DatabaseHelper.eventExecutor.submit(() -> DatabaseManager.getGameDatastore().save(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user