X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet%2Fpterodactylus%2Futil%2Ffcp%2FFcpConnection.java;h=dabb542618ad3a3c3a2b465ecedbe5d6217e7f91;hb=59ca7b4d7186dd08109ca405c897cb2a980b9935;hp=818025c5f934b3b5e7ba496a5e37effe9fb86856;hpb=4f69b0b7f7dd68527ac69d75c404f85edb116975;p=jSite2.git diff --git a/src/net/pterodactylus/util/fcp/FcpConnection.java b/src/net/pterodactylus/util/fcp/FcpConnection.java index 818025c..dabb542 100644 --- a/src/net/pterodactylus/util/fcp/FcpConnection.java +++ b/src/net/pterodactylus/util/fcp/FcpConnection.java @@ -209,12 +209,12 @@ public class FcpConnection { /** * Notifies all listeners that a “PeerNote” message was received. * - * @see FcpListener#receviedPeerNote(FcpConnection, PeerNote) + * @see FcpListener#receivedPeerNote(FcpConnection, PeerNote) * @param peerNote */ private void fireReceivedPeerNote(PeerNote peerNote) { for (FcpListener fcpListener: fcpListeners) { - fcpListener.receviedPeerNote(this, peerNote); + fcpListener.receivedPeerNote(this, peerNote); } } @@ -235,13 +235,13 @@ public class FcpConnection { /** * Notifies all listeners that a “PeerRemoved” message was received. * - * @see FcpListener#receviedPeerRemoved(FcpConnection, PeerRemoved) + * @see FcpListener#receivedPeerRemoved(FcpConnection, PeerRemoved) * @param peerRemoved * The “PeerRemoved” message */ private void fireReceivedPeerRemoved(PeerRemoved peerRemoved) { for (FcpListener fcpListener: fcpListeners) { - fcpListener.receviedPeerRemoved(this, peerRemoved); + fcpListener.receivedPeerRemoved(this, peerRemoved); } } @@ -259,6 +259,42 @@ public class FcpConnection { } /** + * Notifies all listeners that a “TestDDAReply” message was received. + * + * @param testDDAReply + * The “TestDDAReply” message + */ + private void fireReceivedTestDDAReply(TestDDAReply testDDAReply) { + for (FcpListener fcpListener: fcpListeners) { + fcpListener.receivedTestDDAReply(this, testDDAReply); + } + } + + /** + * Notifies all listeners that a “TestDDAComplete” message was received. + * + * @param testDDAComplete + * The “TestDDAComplete” message + */ + private void fireReceivedTestDDAComplete(TestDDAComplete testDDAComplete) { + for (FcpListener fcpListener: fcpListeners) { + fcpListener.receivedTestDDAComplete(this, testDDAComplete); + } + } + + /** + * Notifies all listeners that a “ProtocolError” message was received. + * + * @param protocolError + * The “ProtocolError” message + */ + private void fireReceivedProtocolError(ProtocolError protocolError) { + for (FcpListener fcpListener: fcpListeners) { + fcpListener.receivedProtocolError(this, protocolError); + } + } + + /** * Notifies all registered listeners that a message has been received. * * @see FcpListener#receivedMessage(FcpConnection, FcpMessage) @@ -332,7 +368,9 @@ public class FcpConnection { */ void handleMessage(FcpMessage fcpMessage) { String messageName = fcpMessage.getName(); - if ("Peer".equals(messageName)) { + if ("ProtocolError".equals(messageName)) { + fireReceivedProtocolError(new ProtocolError(fcpMessage)); + } else if ("Peer".equals(messageName)) { fireReceivedPeer(new Peer(fcpMessage)); } else if ("PeerNote".equals(messageName)) { fireReceivedPeerNote(new PeerNote(fcpMessage)); @@ -346,6 +384,10 @@ public class FcpConnection { fireReceivedPeerRemoved(new PeerRemoved(fcpMessage)); } else if ("NodeData".equals(messageName)) { fireReceivedNodeData(new NodeData(fcpMessage)); + } else if ("TestDDAReply".equals(messageName)) { + fireReceivedTestDDAReply(new TestDDAReply(fcpMessage)); + } else if ("TestDDAComplete".equals(messageName)) { + fireReceivedTestDDAComplete(new TestDDAComplete(fcpMessage)); } else if ("NodeHello".equals(messageName)) { fireReceivedNodeHello(new NodeHello(fcpMessage)); } else if ("CloseConnectionDuplicateClientName".equals(messageName)) {