Class ConnectionOrigin

java.lang.Object
com.hypixel.hytale.protocol.io.ConnectionOrigin

public final class ConnectionOrigin extends Object
Remote address comparison shared by every ChannelConnection.isFromSameOrigin(ChannelConnection) implementation.
  • Method Details

    • isFromSameOrigin

      public static boolean isFromSameOrigin(@Nullable SocketAddress address1, @Nullable SocketAddress address2)
      Tests if two remote addresses are from the same origin. They are the same origin if the addresses are equal, or if both are an InetSocketAddress with the same InetAddress. Two loopback addresses are always the same origin.
      Parameters:
      address1 - the first remote address, or null if it is unknown
      address2 - the second remote address, or null if it is unknown
      Returns:
      true if the two addresses are from the same origin