SQLite now default as idiots can't read installation page.

This commit is contained in:
boy0001 2015-01-07 15:03:07 +11:00
parent 277018df63
commit 941b3d8c42
3 changed files with 51 additions and 2 deletions

View File

@ -1009,8 +1009,8 @@ import java.util.concurrent.TimeUnit;
private static void setupStorage() {
storage.set("version", storage_ver);
final Map<String, Object> options = new HashMap<>();
options.put("mysql.use", true);
options.put("sqlite.use", false);
options.put("mysql.use", false);
options.put("sqlite.use", true);
options.put("sqlite.db", "storage");
options.put("mysql.host", "localhost");
options.put("mysql.port", "3306");

View File

@ -21,11 +21,15 @@
package com.intellectualcrafters.plot.commands;
import java.util.UUID;
import com.intellectualcrafters.plot.PlotMain;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.util.PlayerFunctions;
import com.intellectualcrafters.plot.util.UUIDHandler;
import org.bukkit.entity.Player;
@SuppressWarnings({"unused", "deprecated", "javadoc"}) public class Purge extends SubCommand {
@ -34,12 +38,51 @@ import org.bukkit.entity.Player;
super("purge", "plots.admin", "Purge all plots for a world", "purge", "", CommandCategory.DEBUG, false);
}
public PlotId getId(String id) {
try {
String[] split = id.split(";");
return new PlotId(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
}
catch (Exception e) {
return null;
}
}
@Override
public boolean execute(final Player plr, final String... args) {
if (plr != null) {
PlayerFunctions.sendMessage(plr, (C.NOT_CONSOLE));
return false;
}
if (args.length == 1) {
String arg = args[0].toLowerCase();
PlotId id = getId(arg);
if (id != null || arg.equals("plotid")) {
PlayerFunctions.sendMessage(plr, "/plot x;z &l<world>");
return false;
}
UUID uuid = UUIDHandler.getUUID(args[0]);
if (uuid != null) {
PlayerFunctions.sendMessage(plr, "/plot "+args[0]+" &l<world>");
return false;
}
if (arg.equals("player")) {
PlayerFunctions.sendMessage(plr, "/plot &l<player> <world>");
return false;
}
if (arg.equals("unowned")) {
PlayerFunctions.sendMessage(plr, "/plot unowned &l<world>");
return false;
}
if (arg.equals("unknown")) {
PlayerFunctions.sendMessage(plr, "/plot unknown &l<world>");
return false;
}
PlayerFunctions.sendMessage(plr, "Use /plot <x;z|player|unowned|unkown>");
return false;
}
if (args.length != 2) {
if (args.length == 1) {
try {

View File

@ -78,6 +78,12 @@ import java.util.Set;
return newflags;
}
// FIXME get resultant flags for a plot (with DB change)
// remove a flag
// add a flag
/**
* Get a list of registered AbstractFlag objects
*