mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 17:45:08 +02:00
More logging!
This commit is contained in:
@@ -159,8 +159,7 @@ public class ManagedFile
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bukkit.getLogger().warning(
|
Bukkit.getLogger().warning(
|
||||||
"File " + file.toString() + " has been modified by user and file version "
|
"File " + file.toString() + " has been modified by user and file version differs, please update the file manually.");
|
||||||
+ "differs, please update the file manually.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@@ -15,12 +15,12 @@ public class Essentials extends JavaPlugin
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable()
|
public void onEnable()
|
||||||
{
|
{
|
||||||
Bukkit.getLogger().info("You can remove this compatibility plugin, when all plugins are updated to Essentials-3");
|
IPlugin plugin = (IPlugin)getServer().getPluginManager().getPlugin("Essentials-3");
|
||||||
|
ess = plugin.getEssentials();
|
||||||
|
ess.getLogger().info("You can remove this compatibility plugin, when all plugins are updated to Essentials-3");
|
||||||
//TODO: Update files to new 3.0 format
|
//TODO: Update files to new 3.0 format
|
||||||
//TODO: Move Eco Api here
|
//TODO: Move Eco Api here
|
||||||
//TODO: write update methods for itemmeta
|
//TODO: write update methods for itemmeta
|
||||||
IPlugin plugin = (IPlugin)getServer().getPluginManager().getPlugin("Essentials-3");
|
|
||||||
ess = plugin.getEssentials();
|
|
||||||
updateSettings();
|
updateSettings();
|
||||||
updateUserfiles();
|
updateUserfiles();
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
public final class Settings implements ISettings
|
public final class Settings implements ISettings
|
||||||
{
|
{
|
||||||
private final EssentialsConf config;
|
private final EssentialsConf config;
|
||||||
private final static Logger logger = Logger.getLogger("Minecraft");
|
|
||||||
private final IEssentials ess;
|
private final IEssentials ess;
|
||||||
private boolean metricsEnabled = true;
|
private boolean metricsEnabled = true;
|
||||||
|
|
||||||
@@ -418,7 +417,7 @@ public final class Settings implements ISettings
|
|||||||
final List<Integer> epItemSpwn = new ArrayList<Integer>();
|
final List<Integer> epItemSpwn = new ArrayList<Integer>();
|
||||||
if (ess.getItemDb() == null)
|
if (ess.getItemDb() == null)
|
||||||
{
|
{
|
||||||
logger.log(Level.FINE, "Aborting ItemSpawnBL read, itemDB not yet loaded.");
|
ess.getLogger().log(Level.FINE, "Aborting ItemSpawnBL read, itemDB not yet loaded.");
|
||||||
return epItemSpwn;
|
return epItemSpwn;
|
||||||
}
|
}
|
||||||
for (String itemName : config.getString("item-spawn-blacklist", "").split(","))
|
for (String itemName : config.getString("item-spawn-blacklist", "").split(","))
|
||||||
@@ -435,7 +434,7 @@ public final class Settings implements ISettings
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
logger.log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, "item-spawn-blacklist"));
|
ess.getLogger().log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, "item-spawn-blacklist"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return epItemSpwn;
|
return epItemSpwn;
|
||||||
@@ -471,7 +470,7 @@ public final class Settings implements ISettings
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
logger.log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", signName, "enabledSigns"));
|
ess.getLogger().log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", signName, "enabledSigns"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
signsEnabled = true;
|
signsEnabled = true;
|
||||||
@@ -565,7 +564,7 @@ public final class Settings implements ISettings
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
logger.log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, configName));
|
ess.getLogger().log(Level.SEVERE, _("§4Unknown item {0} in {1} list.", itemName, configName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
@@ -12,7 +12,6 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class EssentialsConnect
|
public class EssentialsConnect
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
private final IEssentials ess;
|
private final IEssentials ess;
|
||||||
private final IAntiBuild antib;
|
private final IAntiBuild antib;
|
||||||
|
|
||||||
@@ -20,7 +19,7 @@ public class EssentialsConnect
|
|||||||
{
|
{
|
||||||
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
|
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
essPlugin.getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||||
}
|
}
|
||||||
ess = ((BukkitPlugin)essPlugin).getEssentials();
|
ess = ((BukkitPlugin)essPlugin).getEssentials();
|
||||||
antib = (IAntiBuild)essProtect;
|
antib = (IAntiBuild)essProtect;
|
||||||
@@ -43,7 +42,7 @@ public class EssentialsConnect
|
|||||||
final Location loc = user.getLocation();
|
final Location loc = user.getLocation();
|
||||||
final String warnMessage = _(
|
final String warnMessage = _(
|
||||||
"alertFormat", user.getName(), type, item, loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ());
|
"alertFormat", user.getName(), type, item, loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ());
|
||||||
LOGGER.log(Level.WARNING, warnMessage);
|
ess.getLogger().log(Level.WARNING, warnMessage);
|
||||||
for (Player p : ess.getServer().getOnlinePlayers())
|
for (Player p : ess.getServer().getOnlinePlayers())
|
||||||
{
|
{
|
||||||
if (Permissions.ALERTS.isAuthorized(p))
|
if (Permissions.ALERTS.isAuthorized(p))
|
||||||
|
@@ -18,7 +18,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
public class EssentialsChat extends JavaPlugin
|
public class EssentialsChat extends JavaPlugin
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable()
|
public void onEnable()
|
||||||
@@ -28,7 +27,7 @@ public class EssentialsChat extends JavaPlugin
|
|||||||
final IEssentials ess = (IEssentials)plugin.getEssentials();
|
final IEssentials ess = (IEssentials)plugin.getEssentials();
|
||||||
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||||
}
|
}
|
||||||
if (!plugin.isEnabled())
|
if (!plugin.isEnabled())
|
||||||
{
|
{
|
||||||
|
@@ -18,7 +18,6 @@ import org.bukkit.event.player.AsyncPlayerChatEvent;
|
|||||||
public abstract class EssentialsChatPlayer implements Listener
|
public abstract class EssentialsChatPlayer implements Listener
|
||||||
{
|
{
|
||||||
protected IEssentials ess;
|
protected IEssentials ess;
|
||||||
protected final static Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
protected final Server server;
|
protected final Server server;
|
||||||
protected final Map<AsyncPlayerChatEvent, ChatStore> chatStorage;
|
protected final Map<AsyncPlayerChatEvent, ChatStore> chatStorage;
|
||||||
|
|
||||||
|
@@ -27,7 +27,6 @@ import org.bukkit.plugin.Plugin;
|
|||||||
public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
||||||
{
|
{
|
||||||
private LookupService ls = null;
|
private LookupService ls = null;
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
private File databaseFile;
|
private File databaseFile;
|
||||||
private final ConfigHolder config;
|
private final ConfigHolder config;
|
||||||
private final IEssentials ess;
|
private final IEssentials ess;
|
||||||
@@ -127,7 +126,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, _("Can't find GeoIP database!"));
|
ess.getLogger().log(Level.SEVERE, _("Can't find GeoIP database!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,7 +136,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, _("Failed to read GeoIP database!"), ex);
|
ess.getLogger().log(Level.SEVERE, _("Failed to read GeoIP database!"), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +144,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
{
|
{
|
||||||
if (url == null || url.isEmpty())
|
if (url == null || url.isEmpty())
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, _("GeoIP download url is empty."));
|
ess.getLogger().log(Level.SEVERE, _("GeoIP download url is empty."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!databaseFile.getAbsoluteFile().getParentFile().exists())
|
if (!databaseFile.getAbsoluteFile().getParentFile().exists())
|
||||||
@@ -156,7 +155,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
OutputStream output = null;
|
OutputStream output = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.INFO, _("Downloading GeoIP database... this might take a while (country: 0.6 MB, city: 20MB)"));
|
ess.getLogger().log(Level.INFO, _("Downloading GeoIP database... this might take a while (country: 0.6 MB, city: 20MB)"));
|
||||||
final URL downloadUrl = new URL(url);
|
final URL downloadUrl = new URL(url);
|
||||||
final URLConnection conn = downloadUrl.openConnection();
|
final URLConnection conn = downloadUrl.openConnection();
|
||||||
conn.setConnectTimeout(10000);
|
conn.setConnectTimeout(10000);
|
||||||
@@ -179,11 +178,11 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
}
|
}
|
||||||
catch (MalformedURLException ex)
|
catch (MalformedURLException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, _("GeoIP download url is invalid."), ex);
|
ess.getLogger().log(Level.SEVERE, _("GeoIP download url is invalid."), ex);
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, _("Failed to open connection."), ex);
|
ess.getLogger().log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -195,7 +194,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, _("Failed to open connection."), ex);
|
ess.getLogger().log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (input != null)
|
if (input != null)
|
||||||
@@ -206,7 +205,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload
|
|||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, _("Failed to open connection."), ex);
|
ess.getLogger().log(Level.SEVERE, _("Failed to open connection."), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,6 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class EssentialsConnect
|
public class EssentialsConnect
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
private final IEssentials ess;
|
private final IEssentials ess;
|
||||||
private final IProtect protect;
|
private final IProtect protect;
|
||||||
|
|
||||||
@@ -18,7 +17,7 @@ public class EssentialsConnect
|
|||||||
{
|
{
|
||||||
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
|
if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
essPlugin.getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||||
}
|
}
|
||||||
ess = ((BukkitPlugin)essPlugin).getEssentials();
|
ess = ((BukkitPlugin)essPlugin).getEssentials();
|
||||||
protect = (IProtect)essProtect;
|
protect = (IProtect)essProtect;
|
||||||
|
@@ -10,7 +10,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
public class EssentialsProtect extends JavaPlugin implements IProtect
|
public class EssentialsProtect extends JavaPlugin implements IProtect
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
private EssentialsConnect ess = null;
|
private EssentialsConnect ess = null;
|
||||||
private ProtectHolder settings = null;
|
private ProtectHolder settings = null;
|
||||||
|
|
||||||
@@ -45,7 +44,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
|||||||
{
|
{
|
||||||
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors."); //TODO: tl this
|
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors."); //TODO: tl this
|
||||||
}
|
}
|
||||||
LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essentials Protect is in emergency mode now."); //TODO: tl this
|
getLogger().log(Level.SEVERE, "Essentials not installed or failed to load. Essentials Protect is in emergency mode now."); //TODO: tl this
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -15,7 +15,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
public class EssentialsSignsPlugin extends JavaPlugin implements ISignsPlugin
|
public class EssentialsSignsPlugin extends JavaPlugin implements ISignsPlugin
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Bukkit.getLogger();
|
|
||||||
private SignsConfigHolder config;
|
private SignsConfigHolder config;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -26,7 +25,7 @@ public class EssentialsSignsPlugin extends JavaPlugin implements ISignsPlugin
|
|||||||
final IEssentials ess = (IEssentials)plugin.getEssentials();
|
final IEssentials ess = (IEssentials)plugin.getEssentials();
|
||||||
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||||
}
|
}
|
||||||
if (!plugin.isEnabled())
|
if (!plugin.isEnabled())
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,6 @@ public class SignBlockListener implements Listener
|
|||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final IEssentials ess;
|
||||||
private final ISignsPlugin plugin;
|
private final ISignsPlugin plugin;
|
||||||
private final static Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
private final static int WALL_SIGN = Material.WALL_SIGN.getId();
|
private final static int WALL_SIGN = Material.WALL_SIGN.getId();
|
||||||
private final static int SIGN_POST = Material.SIGN_POST.getId();
|
private final static int SIGN_POST = Material.SIGN_POST.getId();
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ public class SignBlockListener implements Listener
|
|||||||
// prevent any signs be broken by destroying the block they are attached to
|
// prevent any signs be broken by destroying the block they are attached to
|
||||||
if (EssentialsSign.checkIfBlockBreaksSigns(block))
|
if (EssentialsSign.checkIfBlockBreaksSigns(block))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
ess.getLogger().log(Level.INFO, "Prevented that a block was broken next to a sign.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +72,7 @@ public class SignBlockListener implements Listener
|
|||||||
{
|
{
|
||||||
if (sign.getBlocks().contains(block.getType()) && !sign.onBlockBreak(block, player, ess))
|
if (sign.getBlocks().contains(block.getType()) && !sign.onBlockBreak(block, player, ess))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.INFO, "A block was protected by a sign.");
|
ess.getLogger().log(Level.INFO, "A block was protected by a sign.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,7 @@ public class EssentialsUpdate extends JavaPlugin
|
|||||||
{
|
{
|
||||||
if (!getDataFolder().exists() && !getDataFolder().mkdirs())
|
if (!getDataFolder().exists() && !getDataFolder().mkdirs())
|
||||||
{
|
{
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "Could not create data folder: {0}", getDataFolder().getPath());
|
getLogger().log(Level.SEVERE, "Could not create data folder: {0}", getDataFolder().getPath());
|
||||||
}
|
}
|
||||||
essentialsHelp = new EssentialsHelp(this);
|
essentialsHelp = new EssentialsHelp(this);
|
||||||
essentialsHelp.registerEvents();
|
essentialsHelp.registerEvents();
|
||||||
@@ -33,7 +33,7 @@ public class EssentialsUpdate extends JavaPlugin
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Bukkit.getLogger().info("Essentials is ready for installation. Join the game and follow the instructions.");
|
getLogger().info("Essentials is ready for installation. Join the game and follow the instructions.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ public class UpdateCheck
|
|||||||
{
|
{
|
||||||
if (new File(plugin.getDataFolder().getParentFile(), "Essentials.jar").exists())
|
if (new File(plugin.getDataFolder().getParentFile(), "Essentials.jar").exists())
|
||||||
{
|
{
|
||||||
Bukkit.getLogger().severe("Essentials.jar found, but not recognized by Bukkit. Broken download?");
|
plugin.getLogger().severe("Essentials.jar found, but not recognized by Bukkit. Broken download?");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,6 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class UpdateFile
|
public class UpdateFile
|
||||||
{
|
{
|
||||||
private final static Logger LOGGER = Bukkit.getLogger();
|
|
||||||
private final static String UPDATE_URL = "http://goo.gl/67jev";
|
private final static String UPDATE_URL = "http://goo.gl/67jev";
|
||||||
private final static BigInteger PUBLIC_KEY = new BigInteger(
|
private final static BigInteger PUBLIC_KEY = new BigInteger(
|
||||||
"5ha6a2d4qdy17ttkg8evh74sl5a87djojwenu12k1lvy8ui6003e6l06rntczpoh99mhc3txj8mqlxw111oyy9yl7s7qpyluyzix3j1odxrxx4u52gxvyu6qiteapczkzvi7rxgeqsozz7b19rdx73a7quo9ybwpz1cr82r7x5k0pg2a73pjjsv2j1awr13azo7klrcxp9y5xxwf5qv1s3tw4zqftli18u0ek5qkbzfbgk1v5n2f11pkwwk6p0mibrn26wnjbv11vyiqgu95o7busmt6vf5q7grpcenl637w83mbin56s3asj1131b2mscj9xep3cbj7la9tgsxl5bj87vzy8sk2d34kzwqdqgh9nry43nqqus12l1stmiv184r8r3jcy8w43e8h1u1mzklldb5eytkuhayqik8l3ns04hwt8sgacvw534be8sx26qrn5s1",
|
"5ha6a2d4qdy17ttkg8evh74sl5a87djojwenu12k1lvy8ui6003e6l06rntczpoh99mhc3txj8mqlxw111oyy9yl7s7qpyluyzix3j1odxrxx4u52gxvyu6qiteapczkzvi7rxgeqsozz7b19rdx73a7quo9ybwpz1cr82r7x5k0pg2a73pjjsv2j1awr13azo7klrcxp9y5xxwf5qv1s3tw4zqftli18u0ek5qkbzfbgk1v5n2f11pkwwk6p0mibrn26wnjbv11vyiqgu95o7busmt6vf5q7grpcenl637w83mbin56s3asj1131b2mscj9xep3cbj7la9tgsxl5bj87vzy8sk2d34kzwqdqgh9nry43nqqus12l1stmiv184r8r3jcy8w43e8h1u1mzklldb5eytkuhayqik8l3ns04hwt8sgacvw534be8sx26qrn5s1",
|
||||||
@@ -37,12 +36,12 @@ public class UpdateFile
|
|||||||
{
|
{
|
||||||
if (file.exists() && !file.delete())
|
if (file.exists() && !file.delete())
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not delete file update.yml!");
|
plugin.getLogger().log(Level.SEVERE, "Could not delete file update.yml!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!downloadFile() || !checkFile())
|
if (!downloadFile() || !checkFile())
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not download and verify file update.yml!");
|
plugin.getLogger().log(Level.SEVERE, "Could not download and verify file update.yml!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,7 +51,7 @@ public class UpdateFile
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Could not load update.yml!");
|
plugin.getLogger().log(Level.SEVERE, "Could not load update.yml!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +68,7 @@ public class UpdateFile
|
|||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "Error while downloading update.yml", ex);
|
plugin.getLogger().log(Level.SEVERE, "Error while downloading update.yml", ex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +162,7 @@ public class UpdateFile
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
|
plugin.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -176,7 +175,7 @@ public class UpdateFile
|
|||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
|
plugin.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@@ -43,7 +43,7 @@ public class UpdateProcess implements Listener
|
|||||||
{
|
{
|
||||||
currentPlayer.sendMessage("A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
|
currentPlayer.sendMessage("A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
|
||||||
}
|
}
|
||||||
Bukkit.getLogger().log(Level.INFO, "A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
|
plugin.getLogger().log(Level.INFO, "A newer version of EssentialsUpdate is found. Downloading new file and reloading server.");
|
||||||
new SelfUpdate(
|
new SelfUpdate(
|
||||||
new AbstractWorkListener(plugin, updateCheck.getNewVersionInfo())
|
new AbstractWorkListener(plugin, updateCheck.getNewVersionInfo())
|
||||||
{
|
{
|
||||||
@@ -70,7 +70,7 @@ public class UpdateProcess implements Listener
|
|||||||
}
|
}
|
||||||
if (message != null && !message.isEmpty())
|
if (message != null && !message.isEmpty())
|
||||||
{
|
{
|
||||||
Bukkit.getLogger().log(Level.INFO, message);
|
plugin.getLogger().log(Level.INFO, message);
|
||||||
}
|
}
|
||||||
UpdateProcess.this.currentPlayer = null;
|
UpdateProcess.this.currentPlayer = null;
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
|
public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
private static EssentialsXMPP instance = null;
|
private static EssentialsXMPP instance = null;
|
||||||
private UserManager users;
|
private UserManager users;
|
||||||
private XMPPManager xmpp;
|
private XMPPManager xmpp;
|
||||||
@@ -40,7 +39,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
|
|||||||
ess = plugin.getEssentials();
|
ess = plugin.getEssentials();
|
||||||
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
if (!this.getDescription().getVersion().equals(plugin.getDescription().getVersion()))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
getLogger().log(Level.WARNING, _("§4Version mismatch! Please update all Essentials jars to the same version."));
|
||||||
}
|
}
|
||||||
if (!plugin.isEnabled())
|
if (!plugin.isEnabled())
|
||||||
{
|
{
|
||||||
|
@@ -3,6 +3,7 @@ package net.ess3.xmpp;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
|
import net.ess3.api.IEssentials;
|
||||||
import net.ess3.api.IReload;
|
import net.ess3.api.IReload;
|
||||||
import net.ess3.api.IUser;
|
import net.ess3.api.IUser;
|
||||||
import net.ess3.utils.FormatUtil;
|
import net.ess3.utils.FormatUtil;
|
||||||
@@ -17,7 +18,6 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||||||
|
|
||||||
public final class XMPPManager extends Handler implements MessageListener, ChatManagerListener, IReload
|
public final class XMPPManager extends Handler implements MessageListener, ChatManagerListener, IReload
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
|
||||||
private static final SimpleFormatter formatter = new SimpleFormatter();
|
private static final SimpleFormatter formatter = new SimpleFormatter();
|
||||||
private YamlConfiguration config = null;
|
private YamlConfiguration config = null;
|
||||||
private XMPPConnection connection;
|
private XMPPConnection connection;
|
||||||
@@ -98,7 +98,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
final String server = config.getString("xmpp.server");
|
final String server = config.getString("xmpp.server");
|
||||||
if (server == null || server.equals("example.com"))
|
if (server == null || server.equals("example.com"))
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "config broken for xmpp");
|
parent.getLogger().log(Level.WARNING, "config broken for xmpp");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final int port = config.getInt("xmpp.port", 5222);
|
final int port = config.getInt("xmpp.port", 5222);
|
||||||
@@ -109,7 +109,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
final StringBuilder stringBuilder = new StringBuilder();
|
final StringBuilder stringBuilder = new StringBuilder();
|
||||||
stringBuilder.append("Connecting to xmpp server ").append(server).append(":").append(port);
|
stringBuilder.append("Connecting to xmpp server ").append(server).append(":").append(port);
|
||||||
stringBuilder.append(" as user ").append(xmppuser).append(".");
|
stringBuilder.append(" as user ").append(xmppuser).append(".");
|
||||||
LOGGER.log(Level.INFO, stringBuilder.toString());
|
parent.getLogger().log(Level.INFO, stringBuilder.toString());
|
||||||
connConf.setSASLAuthenticationEnabled(config.getBoolean("xmpp.sasl-enabled", false));
|
connConf.setSASLAuthenticationEnabled(config.getBoolean("xmpp.sasl-enabled", false));
|
||||||
connConf.setSendPresence(true);
|
connConf.setSendPresence(true);
|
||||||
connConf.setReconnectionAllowed(true);
|
connConf.setReconnectionAllowed(true);
|
||||||
@@ -125,7 +125,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
}
|
}
|
||||||
catch (XMPPException ex)
|
catch (XMPPException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Failed to connect to server: " + server, ex);
|
parent.getLogger().log(Level.WARNING, "Failed to connect to server: " + server, ex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
@Override
|
@Override
|
||||||
public void onReload()
|
public void onReload()
|
||||||
{
|
{
|
||||||
LOGGER.removeHandler(this);
|
parent.getLogger().removeHandler(this);
|
||||||
config = YamlConfiguration.loadConfiguration(new File(parent.getDataFolder(), "config.yml"));
|
config = YamlConfiguration.loadConfiguration(new File(parent.getDataFolder(), "config.yml"));
|
||||||
synchronized (chats)
|
synchronized (chats)
|
||||||
{
|
{
|
||||||
@@ -179,7 +179,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
}
|
}
|
||||||
if (config.getBoolean("log-enabled", false))
|
if (config.getBoolean("log-enabled", false))
|
||||||
{
|
{
|
||||||
LOGGER.addHandler(this);
|
parent.getLogger().addHandler(this);
|
||||||
logUsers = config.getStringList("log-users");
|
logUsers = config.getStringList("log-users");
|
||||||
final String level = config.getString("log-level", "info");
|
final String level = config.getString("log-level", "info");
|
||||||
try
|
try
|
||||||
@@ -271,14 +271,14 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
catch (XMPPException ex)
|
catch (XMPPException ex)
|
||||||
{
|
{
|
||||||
failedUsers.add(user);
|
failedUsers.add(user);
|
||||||
LOGGER.removeHandler(XMPPManager.this);
|
parent.getLogger().removeHandler(XMPPManager.this);
|
||||||
LOGGER.log(Level.SEVERE, "Failed to deliver log message! Disabling logging to XMPP.", ex);
|
parent.getLogger().log(Level.SEVERE, "Failed to deliver log message! Disabling logging to XMPP.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logUsers.removeAll(failedUsers);
|
logUsers.removeAll(failedUsers);
|
||||||
if (logUsers.isEmpty())
|
if (logUsers.isEmpty())
|
||||||
{
|
{
|
||||||
LOGGER.removeHandler(XMPPManager.this);
|
parent.getLogger().removeHandler(XMPPManager.this);
|
||||||
threadrunning = false;
|
threadrunning = false;
|
||||||
}
|
}
|
||||||
copy.clear();
|
copy.clear();
|
||||||
@@ -292,7 +292,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
threadrunning = false;
|
threadrunning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.removeHandler(XMPPManager.this);
|
parent.getLogger().removeHandler(XMPPManager.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
loggerThread.start();
|
loggerThread.start();
|
||||||
@@ -333,7 +333,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
}
|
}
|
||||||
catch (XMPPException ex)
|
catch (XMPPException ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Failed to send xmpp message.", ex);
|
parent.getLogger().log(Level.WARNING, "Failed to send xmpp message.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -357,7 +357,7 @@ public final class XMPPManager extends Handler implements MessageListener, ChatM
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
|
parent.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user