X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fhighlevel%2FFcpClient.java;h=a7ccd3ec77059b2f43a664a2c64b7163e5d38eae;hb=960c723062d160be95e526ac24b7a664e0ac217e;hp=3012e0011c1fc9b262921c3190b6ba2e5162fc5f;hpb=508624458578f01a393f8b44f32b98b40054fdc8;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index 3012e00..a7ccd3e 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,7 +268,9 @@ public class FcpClient { * {@inheritDoc} */ @Override + @SuppressWarnings("synthetic-access") public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello) { + FcpClient.this.nodeHello = nodeHello; completionLatch.countDown(); } }.execute();