1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-09-25 21:38:59 +02:00

Add flatfile storage support

This commit is contained in:
Luck
2016-06-23 16:37:29 +01:00
parent 85989aeb7c
commit 0781637617
6 changed files with 437 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package me.lucko.luckperms;
import lombok.Getter;
import me.lucko.luckperms.data.Datastore;
import me.lucko.luckperms.data.MySQLConfiguration;
import me.lucko.luckperms.data.methods.FlatfileDatastore;
import me.lucko.luckperms.data.methods.MySQLDatastore;
import me.lucko.luckperms.data.methods.SQLiteDatastore;
import me.lucko.luckperms.groups.GroupManager;
@@ -58,6 +59,9 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
} else if (storageMethod.equalsIgnoreCase("sqlite")) {
getLogger().info("Using SQLite as storage method.");
datastore = new SQLiteDatastore(this, new File(getDataFolder(), "luckperms.sqlite"));
} else if (storageMethod.equalsIgnoreCase("flatfile")) {
getLogger().info("Using Flatfile (JSON) as storage method.");
datastore = new FlatfileDatastore(this, getDataFolder());
} else {
getLogger().warning("Storage method '" + storageMethod + "' was not recognised. Using SQLite as fallback.");
datastore = new SQLiteDatastore(this, new File(getDataFolder(), "luckperms.sqlite"));