Waterfall/BungeeCord-Patches/0019-Improve-server-list-ping-logging.patch
2021-11-12 19:47:23 +00:00

74 lines
3.2 KiB
Diff

From 7f0cf613be361f1370bad6bd97e28f7d2d6049ef Mon Sep 17 00:00:00 2001
From: Janmm14 <computerjanimaus@yahoo.de>
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 0825a5a1..175150c7 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -460,6 +460,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 d9facc62..dd742d01 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
@@ -674,6 +674,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 c254379a..465fb3c1 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
@@ -646,20 +646,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 5b58fdea..af19796f 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
@@ -287,6 +287,6 @@ public class UpstreamBridge extends PacketHandler
@Override
public String toString()
{
- return "[" + con.getName() + "] -> UpstreamBridge";
+ return "[" + con.getAddress() + "|" + con.getName() + "] -> UpstreamBridge";
}
}
--
2.33.0