Add display name to player list JSON.

Send a player list update when someone enables enhanced mode.
This commit is contained in:
StevenLawson 2014-08-16 23:10:52 -04:00
parent b355edb37b
commit c5aa5f813d
2 changed files with 7 additions and 1 deletions

View file

@ -40,7 +40,7 @@ public class PlayerEventListener implements Listener
private static BukkitTask updateTask = null;
private static void triggerPlayerListUpdates()
public static void triggerPlayerListUpdates()
{
if (updateTask != null)
{
@ -72,6 +72,7 @@ public class PlayerEventListener implements Listener
info.put("name", player.getName());
info.put("ip", player.getAddress().getAddress().getHostAddress());
info.put("displayName", player.getDisplayName().trim());
players.add(info);
}

View file

@ -12,6 +12,7 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import me.StevenLawson.BukkitTelnet.BukkitTelnet;
import me.StevenLawson.BukkitTelnet.PlayerEventListener;
import me.StevenLawson.BukkitTelnet.TelnetConfig;
import me.StevenLawson.BukkitTelnet.TelnetLogAppender;
import me.StevenLawson.BukkitTelnet.TelnetLogger;
@ -460,6 +461,10 @@ public final class ClientSession extends Thread
{
enhancedMode = !enhancedMode;
println((enhancedMode ? "A" : "Dea") + "ctivated enhanced mode.");
if (enhancedMode)
{
PlayerEventListener.triggerPlayerListUpdates();
}
}
else
{