Package alexiil.mc.lib.net
Class InternalMsgUtil
java.lang.Object
alexiil.mc.lib.net.InternalMsgUtil
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
Sent as part ofID_INTERNAL_DEBUG_STACKTRACE
.static final int
The ID to allocate a new packet.static final int
Debug data with the stacktrace for the writer.static final int
Debug data with type information for the next packet.static final int
The ID to inform the other side of a connection about the bandwidth we want to send/receive.static final int
Sent by a receiver who wishes to receiveID_INTERNAL_DEBUG_TYPES
.static final int
Sent by a receiver who wishes to receiveID_INTERNAL_DEBUG_STACKTRACE
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
onReceive
(ActiveConnection connection, NetByteBuf buffer) 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.static void
send
(ActiveConnection connection, NetIdBase netId, alexiil.mc.lib.net.NetIdPath path, NetByteBuf payload, int priority) Sends a packet.
-
Field Details
-
ID_INTERNAL_ALLOCATE_STATIC
public static final int ID_INTERNAL_ALLOCATE_STATICThe ID to allocate a new packet.- See Also:
-
ID_INTERNAL_NEW_BANDWIDTH
public static final int ID_INTERNAL_NEW_BANDWIDTHThe 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_ELEMENTSent as part ofID_INTERNAL_DEBUG_STACKTRACE
.- See Also:
-
ID_INTERNAL_DEBUG_TYPES
public static final int ID_INTERNAL_DEBUG_TYPESDebug data with type information for the next packet.- See Also:
-
ID_INTERNAL_DEBUG_STACKTRACE
public static final int ID_INTERNAL_DEBUG_STACKTRACEDebug data with the stacktrace for the writer.- See Also:
-
ID_INTERNAL_REQUEST_DEBUG_TYPES
public static final int ID_INTERNAL_REQUEST_DEBUG_TYPESSent by a receiver who wishes to receiveID_INTERNAL_DEBUG_TYPES
.- See Also:
-
ID_INTERNAL_REQUEST_STACKTRACES
public static final int ID_INTERNAL_REQUEST_STACKTRACESSent by a receiver who wishes to receiveID_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.
-