From 4cc999421f4825bfa3bc5bfd5c298f6e0990a254 Mon Sep 17 00:00:00 2001 From: Janmm14 Date: Sat, 12 Dec 2015 23:43:30 +0100 Subject: [PATCH] Improve server list ping logging This functionality of this patch was adopted upstream, however, this patch remains for a few misc improvements around here diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 4894b3ee..a8e938be 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -514,6 +514,6 @@ public class ServerConnector extends PacketHandler @Override public String toString() { - return "[" + user.getName() + "] <-> ServerConnector [" + target.getName() + "]"; + return "[" + user.getName() + "|" + user.getAddress() + "] <-> ServerConnector [" + target.getName() + "]"; } } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java index 61ce9ed6..976c8e26 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -790,6 +790,6 @@ public class DownstreamBridge extends PacketHandler @Override public String toString() { - return "[" + con.getName() + "] <-> DownstreamBridge <-> [" + server.getInfo().getName() + "]"; + return "[" + con.getAddress() + "|" + con.getName() + "] <-> DownstreamBridge <-> [" + server.getInfo().getName() + "]"; } } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index b51263a2..ea3a9248 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -727,20 +727,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append( '[' ); - - String currentName = getName(); - if ( currentName != null ) - { - sb.append( currentName ); - sb.append( ',' ); - } - - sb.append( getSocketAddress() ); - sb.append( "] <-> InitialHandler" ); - - return sb.toString(); + return "[" + getSocketAddress() + ( getName() != null ? "|" + getName() : "" ) + "] <-> InitialHandler"; } @Override diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index 84be12e5..6acbf7bf 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -382,6 +382,6 @@ public class UpstreamBridge extends PacketHandler @Override public String toString() { - return "[" + con.getName() + "] -> UpstreamBridge"; + return "[" + con.getAddress() + "|" + con.getName() + "] -> UpstreamBridge"; } } -- 2.43.0