X-Git-Url: https://git.pterodactylus.net/?p=jFCPlib.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fhighlevel%2FFcpClient.java;h=5bf4e1a3a57b33b514b809c810cfc3a9041aaa82;hp=3012e0011c1fc9b262921c3190b6ba2e5162fc5f;hb=2d2cb653da15b89e3161f5026c4778e08a8bff0a;hpb=b32d5232ee2ba5b0c1be36c80f68c55344153739 diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index 3012e00..5bf4e1a 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -89,6 +89,9 @@ public class FcpClient { /** The underlying FCP connection. */ private final FcpConnection fcpConnection; + /** The {@link NodeHello} data sent by the node on connection. */ + private volatile NodeHello nodeHello; + /** Whether the client is currently connected. */ private volatile boolean connected; @@ -218,6 +221,20 @@ public class FcpClient { } // + // ACCESSORS + // + + /** + * Returns the {@link NodeHello} object that the node returned when + * connecting. + * + * @return The {@code NodeHello} data container + */ + public NodeHello getNodeHello() { + return nodeHello; + } + + // // ACTIONS // @@ -251,8 +268,10 @@ public class FcpClient { * {@inheritDoc} */ @Override + @SuppressWarnings("synthetic-access") public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello) { completionLatch.countDown(); + FcpClient.this.nodeHello = nodeHello; } }.execute(); }