Class InternalMsgUtil

java.lang.Object
alexiil.mc.lib.net.InternalMsgUtil

public class InternalMsgUtil extends Object
  • Field Details

    • ID_INTERNAL_ALLOCATE_STATIC

      public static final int ID_INTERNAL_ALLOCATE_STATIC
      The ID to allocate a new packet.
      See Also:
    • ID_INTERNAL_NEW_BANDWIDTH

      public static final int ID_INTERNAL_NEW_BANDWIDTH
      The ID to inform the other side of a connection about the bandwidth we want to send/receive.
      See Also:
    • ID_INTERNAL_ALLOCATE_STACKTRACE_ELEMENT

      public static final int ID_INTERNAL_ALLOCATE_STACKTRACE_ELEMENT
      See Also:
    • ID_INTERNAL_DEBUG_TYPES

      public static final int ID_INTERNAL_DEBUG_TYPES
      Debug data with type information for the next packet.
      See Also:
    • ID_INTERNAL_DEBUG_STACKTRACE

      public static final int ID_INTERNAL_DEBUG_STACKTRACE
      Debug data with the stacktrace for the writer.
      See Also:
    • ID_INTERNAL_REQUEST_DEBUG_TYPES

      public static final int ID_INTERNAL_REQUEST_DEBUG_TYPES
      Sent by a receiver who wishes to receive ID_INTERNAL_DEBUG_TYPES.
      See Also:
    • ID_INTERNAL_REQUEST_STACKTRACES

      public static final int ID_INTERNAL_REQUEST_STACKTRACES
      Sent by a receiver who wishes to receive ID_INTERNAL_DEBUG_STACKTRACE.
      See Also:
    • COUNT_HARDCODED_IDS

      public static final int COUNT_HARDCODED_IDS
      See Also:
  • Constructor Details

    • InternalMsgUtil

      public InternalMsgUtil()
  • Method Details

    • onReceive

      public static void onReceive(ActiveConnection connection, NetByteBuf buffer) throws InvalidInputDataException
      Parameters:
      buffer - All of the data for a single packet. It must be complete!
      Throws:
      InvalidInputDataException
    • send

      public static void send(ActiveConnection connection, NetIdBase netId, alexiil.mc.lib.net.NetIdPath path, NetByteBuf payload)
      Sends a packet with it's priority set to it's default priority.
      Parameters:
      connection - The connection to send it to.
      netId - The ID to write.
      path - The Path to the ID.
      payload - The data to write.
    • send

      public static void send(ActiveConnection connection, NetIdBase netId, alexiil.mc.lib.net.NetIdPath path, NetByteBuf payload, int priority)
      Sends a packet.
      Parameters:
      connection - The connection to send it to.
      netId - The ID to write.
      path - The Path to the ID.
      payload - The data to write.
      priority - The priority level to use. 0 is the maximum.