Server-side multiworld support with several improvements overal.
This commit is contained in:
parent
2fd91ef94b
commit
5b0171c459
20 changed files with 398 additions and 296 deletions
|
|
@ -1,8 +1,6 @@
|
|||
package org.dynmap.debug;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -11,14 +9,9 @@ import org.bukkit.event.Event.Priority;
|
|||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.bukkit.event.player.PlayerListener;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class BukkitPlayerDebugger implements Debugger {
|
||||
protected static final Logger log = Logger.getLogger("Minecraft");
|
||||
|
||||
private boolean isLogging = false;
|
||||
|
||||
private JavaPlugin plugin;
|
||||
private HashSet<Player> debugees = new HashSet<Player>();
|
||||
private String debugCommand;
|
||||
|
|
@ -28,10 +21,10 @@ public class BukkitPlayerDebugger implements Debugger {
|
|||
public BukkitPlayerDebugger(JavaPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
PluginDescriptionFile pdfFile = plugin.getDescription();
|
||||
debugCommand = "/debug_" + pdfFile.getName();
|
||||
undebugCommand = "/undebug_" + pdfFile.getName();
|
||||
prepend = pdfFile.getName() + ": ";
|
||||
String name = "dynmap";
|
||||
debugCommand = "/debug_" + name;
|
||||
undebugCommand = "/undebug_" + name;
|
||||
prepend = name + ": ";
|
||||
}
|
||||
|
||||
public synchronized void enable() {
|
||||
|
|
@ -63,19 +56,15 @@ public class BukkitPlayerDebugger implements Debugger {
|
|||
|
||||
public synchronized void debug(String message) {
|
||||
sendToDebuggees(message);
|
||||
if (isLogging)
|
||||
log.info(prepend + message);
|
||||
}
|
||||
|
||||
public synchronized void error(String message) {
|
||||
sendToDebuggees(prepend + ChatColor.RED + message);
|
||||
log.log(Level.SEVERE, prepend + message);
|
||||
}
|
||||
|
||||
public synchronized void error(String message, Throwable thrown) {
|
||||
sendToDebuggees(prepend + ChatColor.RED + message);
|
||||
sendToDebuggees(thrown.toString());
|
||||
log.log(Level.SEVERE, prepend + message);
|
||||
}
|
||||
|
||||
protected class CommandListener extends PlayerListener {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue