forked from LogBlock/LogBlock
Increase default table sizes and default to OP.
This commit is contained in:
@@ -197,6 +197,23 @@ class Updater
|
||||
}
|
||||
config.set("version", "1.52");
|
||||
}
|
||||
if (config.getString("version").compareTo("1.57") < 0) {
|
||||
getLogger().info("[LogBlock] Updating tables to 1.57 ...");
|
||||
final Connection conn = logblock.getConnection();
|
||||
try {
|
||||
conn.setAutoCommit(true);
|
||||
final Statement st = conn.createStatement();
|
||||
st.execute("ALTER TABLE `lb-world` MODIFY x MEDIUMINT NOT NULL");
|
||||
st.execute("ALTER TABLE `lb-world` MODIFY y SMALLINT NOT NULL");
|
||||
st.execute("ALTER TABLE `lb-world` MODIFY z MEDIUMINT NOT NULL");
|
||||
st.close();
|
||||
conn.close();
|
||||
} catch (final SQLException ex) {
|
||||
Bukkit.getLogger().log(Level.SEVERE, "[LogBlock Updater] Error: ", ex);
|
||||
return false;
|
||||
}
|
||||
config.set("version", "1.57");
|
||||
}
|
||||
logblock.saveConfig();
|
||||
return true;
|
||||
}
|
||||
@@ -212,7 +229,7 @@ class Updater
|
||||
if (isLogging(Logging.CHAT))
|
||||
createTable(dbm, state, "lb-chat", "(id INT UNSIGNED NOT NULL AUTO_INCREMENT, date DATETIME NOT NULL, playerid SMALLINT UNSIGNED NOT NULL, message VARCHAR(255) NOT NULL, PRIMARY KEY (id), KEY playerid (playerid), FULLTEXT message (message)) ENGINE=MyISAM");
|
||||
for (final WorldConfig wcfg : getLoggedWorlds()) {
|
||||
createTable(dbm, state, wcfg.table, "(id INT UNSIGNED NOT NULL AUTO_INCREMENT, date DATETIME NOT NULL, playerid SMALLINT UNSIGNED NOT NULL, replaced TINYINT UNSIGNED NOT NULL, type TINYINT UNSIGNED NOT NULL, data TINYINT UNSIGNED NOT NULL, x SMALLINT NOT NULL, y TINYINT UNSIGNED NOT NULL, z SMALLINT NOT NULL, PRIMARY KEY (id), KEY coords (x, z, y), KEY date (date), KEY playerid (playerid))");
|
||||
createTable(dbm, state, wcfg.table, "(id INT UNSIGNED NOT NULL AUTO_INCREMENT, date DATETIME NOT NULL, playerid SMALLINT UNSIGNED NOT NULL, replaced TINYINT UNSIGNED NOT NULL, type TINYINT UNSIGNED NOT NULL, data TINYINT UNSIGNED NOT NULL, x MEDIUMINT NOT NULL, y SMALLINT UNSIGNED NOT NULL, z MEDIUMINT NOT NULL, PRIMARY KEY (id), KEY coords (x, z, y), KEY date (date), KEY playerid (playerid))");
|
||||
createTable(dbm, state, wcfg.table + "-sign", "(id INT UNSIGNED NOT NULL, signtext VARCHAR(255) NOT NULL, PRIMARY KEY (id))");
|
||||
createTable(dbm, state, wcfg.table + "-chest", "(id INT UNSIGNED NOT NULL, itemtype SMALLINT UNSIGNED NOT NULL, itemamount SMALLINT NOT NULL, itemdata TINYINT UNSIGNED NOT NULL, PRIMARY KEY (id))");
|
||||
if (wcfg.isLogging(Logging.KILL))
|
||||
|
@@ -113,7 +113,7 @@ public class Config
|
||||
def.put("tools.tool.canDrop", true);
|
||||
def.put("tools.tool.params", "area 0 all sum none limit 15 desc silent");
|
||||
def.put("tools.tool.mode", "LOOKUP");
|
||||
def.put("tools.tool.permissionDefault", "FALSE");
|
||||
def.put("tools.tool.permissionDefault", "OP");
|
||||
def.put("tools.toolblock.aliases", Arrays.asList("tb"));
|
||||
def.put("tools.toolblock.leftClickBehavior", "TOOL");
|
||||
def.put("tools.toolblock.rightClickBehavior", "BLOCK");
|
||||
@@ -122,7 +122,7 @@ public class Config
|
||||
def.put("tools.toolblock.canDrop", false);
|
||||
def.put("tools.toolblock.params", "area 0 all sum none limit 15 desc silent");
|
||||
def.put("tools.toolblock.mode", "LOOKUP");
|
||||
def.put("tools.toolblock.permissionDefault", "FALSE");
|
||||
def.put("tools.toolblock.permissionDefault", "OP");
|
||||
for (final Entry<String, Object> e : def.entrySet())
|
||||
if (!config.contains(e.getKey()))
|
||||
config.set(e.getKey(), e.getValue());
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name: ${project.name}
|
||||
version: '1.56'
|
||||
version: '1.57'
|
||||
author: DiddiZ
|
||||
website: http://www.diddiz.de/minecraft/
|
||||
main: de.diddiz.LogBlock.LogBlock
|
||||
|
Reference in New Issue
Block a user