mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 05:05:16 +01:00
Merge remote-tracking branch 'zeez/master'
This commit is contained in:
commit
92e3ec5f08
@ -15,7 +15,7 @@ public class Client {
|
|||||||
public double x, y, z;
|
public double x, y, z;
|
||||||
|
|
||||||
public Player(String name, String world, double x, double y, double 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.world = world;
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
@ -35,8 +35,8 @@ public class Client {
|
|||||||
|
|
||||||
public ChatMessage(String source, String playerName, String message) {
|
public ChatMessage(String source, String playerName, String message) {
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.playerName = playerName;
|
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||||
this.message = message;
|
this.message = message.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ public class Client {
|
|||||||
public String type = "playerjoin";
|
public String type = "playerjoin";
|
||||||
public String playerName;
|
public String playerName;
|
||||||
public PlayerJoinMessage(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 type = "playerquit";
|
||||||
public String playerName;
|
public String playerName;
|
||||||
public PlayerQuitMessage(String playerName) {
|
public PlayerQuitMessage(String playerName) {
|
||||||
this.playerName = playerName;
|
this.playerName = playerName.replaceAll("\u00A7[0-9a-fA-F]", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,17 +15,17 @@ public class DynmapPlayerChatListener extends PlayerListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onPlayerChat(PlayerChatEvent event) {
|
public void onPlayerChat(PlayerChatEvent event) {
|
||||||
if(event.isCancelled()) return;
|
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
|
@Override
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getName()));
|
plugin.mapManager.pushUpdate(new Client.PlayerJoinMessage(event.getPlayer().getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getName()));
|
plugin.mapManager.pushUpdate(new Client.PlayerQuitMessage(event.getPlayer().getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -89,7 +89,7 @@ class JsonTimerTask extends TimerTask {
|
|||||||
for (int i = 0; i < players.length; i++) {
|
for (int i = 0; i < players.length; i++) {
|
||||||
Player p = players[i];
|
Player p = players[i];
|
||||||
Location pl = p.getLocation();
|
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));
|
update.updates = mapManager.getWorldUpdates(world.getName(), current - (jsonInterval + 10000));
|
||||||
|
@ -71,7 +71,7 @@ public class ClientUpdateHandler implements HttpHandler {
|
|||||||
for(int i=0;i<players.length;i++) {
|
for(int i=0;i<players.length;i++) {
|
||||||
Player p = players[i];
|
Player p = players[i];
|
||||||
Location pl = p.getLocation();
|
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);
|
update.updates = mapManager.getWorldUpdates(worldName, since);
|
||||||
|
Loading…
Reference in New Issue
Block a user