Fixes for updated warnings

This commit is contained in:
Admin
2011-12-06 16:30:59 +01:00
parent 2d3257f209
commit 2a1259fd93
3 changed files with 5 additions and 10 deletions

View File

@@ -194,9 +194,7 @@ public class Consumer extends TimerTask
public void queueKill(World world, String killerName, String victimName, int weapon) {
if (victimName == null || !worlds.containsKey(world.getName().hashCode()))
return;
killerName = killerName.replaceAll("[^a-zA-Z0-9_]", "");
victimName = victimName.replaceAll("[^a-zA-Z0-9_]", "");
queue.add(new KillRow(world.getName().hashCode(), killerName, victimName, weapon));
queue.add(new KillRow(world.getName().hashCode(), killerName.replaceAll("[^a-zA-Z0-9_]", ""), victimName.replaceAll("[^a-zA-Z0-9_]", ""), weapon));
}
/**
@@ -348,10 +346,7 @@ public class Consumer extends TimerTask
private void queueBlock(String playerName, Location loc, int typeBefore, int typeAfter, byte data, String signtext, ChestAccess ca) {
if (playerName == null || loc == null || typeBefore < 0 || typeAfter < 0 || typeBefore > 255 || typeAfter > 255 || hiddenPlayers.contains(playerName.hashCode()) || !worlds.containsKey(loc.getWorld().getName().hashCode()) || typeBefore != typeAfter && hiddenBlocks.contains(typeBefore) && hiddenBlocks.contains(typeAfter))
return;
playerName = playerName.replaceAll("[^a-zA-Z0-9_]", "");
if (signtext != null)
signtext = signtext.replace("\\", "\\\\").replace("'", "\\'");
queue.add(new BlockRow(loc, playerName, typeBefore, typeAfter, data, signtext, ca));
queue.add(new BlockRow(loc, playerName.replaceAll("[^a-zA-Z0-9_]", ""), typeBefore, typeAfter, data, signtext != null ? signtext.replace("\\", "\\\\").replace("'", "\\'") : null, ca));
}
private String playerID(String playerName) {

View File

@@ -163,7 +163,7 @@ class Updater
conn.close();
}
private void createTable(DatabaseMetaData dbm, Statement state, String table, String query) throws SQLException {
private static void createTable(DatabaseMetaData dbm, Statement state, String table, String query) throws SQLException {
if (!dbm.getTables(null, null, table, null).next()) {
getLogger().log(Level.INFO, "[LogBlock] Creating table " + table + ".");
state.execute("CREATE TABLE `" + table + "` " + query);

View File

@@ -1,6 +1,7 @@
package de.diddiz.util;
import static de.diddiz.util.MaterialName.materialName;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -102,8 +103,7 @@ public class BukkitUtils
}
public static String friendlyWorldname(String worldName) {
worldName = worldName.substring(worldName.lastIndexOf('/') + 1);
return worldName.substring(worldName.lastIndexOf('\\') + 1);
return new File(worldName).getName();
}
public static Set<Set<Integer>> getBlockEquivalents() {