X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Futil%2Ffcp%2FPeer.java;h=40ed6f7cdb00bff4d4fea4bda53de3ad3060851c;hb=966d4ac902c693077f10ef4b1b7bc562559ca49e;hp=c3dac0dd24e48c88ea517efe5f078d33fcf81d33;hpb=474a0f39c87d520b0ce8c23ea8e8046441e13ea7;p=jSite2.git diff --git a/src/net/pterodactylus/util/fcp/Peer.java b/src/net/pterodactylus/util/fcp/Peer.java index c3dac0d..40ed6f7 100644 --- a/src/net/pterodactylus/util/fcp/Peer.java +++ b/src/net/pterodactylus/util/fcp/Peer.java @@ -3,8 +3,6 @@ */ package net.pterodactylus.util.fcp; - - /** * The “Peer” reply by the node contains information about a peer. * @@ -24,6 +22,27 @@ public class Peer extends BaseMessage { } /** + * Returns a collection of fields as a node reference. + * + * @return The node reference contained within this message + */ + public NodeRef getNodeRef() { + NodeRef nodeRef = new NodeRef(); + nodeRef.setARK(getARK()); + nodeRef.setDSAGroup(getDSAGroup()); + nodeRef.setDSAPublicKey(getDSAPublicKey()); + nodeRef.setIdentity(getIdentity()); + nodeRef.setLastGoodVersion(getLastGoodVersion()); + nodeRef.setLocation(getLocation()); + nodeRef.setName(getMyName()); + nodeRef.setNegotiationTypes(getNegotiationTypes()); + nodeRef.setOpennet(isOpennet()); + nodeRef.setPhysicalUDP(getPhysicalUDP()); + nodeRef.setVersion(getVersion()); + return nodeRef; + } + + /** * Returns the “physical.udp” line from the message. It contains all IP * addresses and port numbers of the peer. * @@ -136,7 +155,7 @@ public class Peer extends BaseMessage { * @return The supported negotiation types */ public int[] getNegotiationTypes() { - return FcpUtils.parseMultiIntegerField(getField("auth.negTypes")); + return FcpUtils.decodeMultiIntegerField(getField("auth.negTypes")); } }