Merge remote-tracking branch 'zeez/master'

This commit is contained in:
FrozenCow 2011-05-06 23:19:37 +02:00
commit 92e3ec5f08
4 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@ public class Client {
public double x, y, z;
public Player(String name, String world, double x, double y, double z) {
this.name = name;
this.name = name.replaceAll("\u00A7[0-9a-fA-F]", "");
this.world = world;
this.x = x;
this.y = y;
@ -35,8 +35,8 @@ public class Client {
public ChatMessage(String source, String playerName, String message) {
this.source = source;
this.playerName = playerName;
this.message = message;
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
this.message = message.replaceAll("\u00A7[0-9a-fA-F]", "");
}
}
@ -44,7 +44,7 @@ public class Client {
public String type = "playerjoin";
public String playerName;
public PlayerJoinMessage(String playerName) {
this.playerName = playerName;
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
}
}
@ -52,7 +52,7 @@ public class Client {
public String type = "playerquit";
public String playerName;
public PlayerQuitMessage(String playerName) {
this.playerName = playerName;
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
}
}

View File

@ -15,17 +15,17 @@ public class DynmapPlayerChatListener extends PlayerListener {
@Override
public void onPlayerChat(PlayerChatEvent event) {
if(event.isCancelled()) return;
plugin.mapManager.pushUpdate(new Client.ChatMessage("player", event.getPlayer().getName(), event.getMessage()));
plugin.mapManager.pushUpdate(new Client.ChatMessage("player", event.getPlayer().getDisplayName(), event.getMessage()));
}
@Override
public void onPlayerJoin(PlayerJoinEvent event) {
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getName()));
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getDisplayName()));
}
@Override
public void onPlayerQuit(PlayerQuitEvent event) {
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getName()));
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getDisplayName()));
}
}

View File

@ -89,7 +89,7 @@ class JsonTimerTask extends TimerTask {
for (int i = 0; i < players.length; i++) {
Player p = players[i];
Location pl = p.getLocation();
update.players[i] = new Client.Player(p.getName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ());
update.players[i] = new Client.Player(p.getDisplayName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ());
}
update.updates = mapManager.getWorldUpdates(world.getName(), current - (jsonInterval + 10000));

View File

@ -71,7 +71,7 @@ public class ClientUpdateHandler implements HttpHandler {
for(int i=0;i<players.length;i++) {
Player p = players[i];
Location pl = p.getLocation();
update.players[i] = new Client.Player(p.getName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ());
update.players[i] = new Client.Player(p.getDisplayName(), pl.getWorld().getName(), pl.getX(), pl.getY(), pl.getZ());
}
update.updates = mapManager.getWorldUpdates(worldName, since);