Package alexiil.mc.lib.net
Class InternalMsgUtil
java.lang.Object
alexiil.mc.lib.net.InternalMsgUtil
public class InternalMsgUtil
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static int
COUNT_HARDCODED_IDS
static int
ID_INTERNAL_ALLOCATE_STACKTRACE_ELEMENT
Sent as part ofID_INTERNAL_DEBUG_STACKTRACE
.static int
ID_INTERNAL_ALLOCATE_STATIC
The ID to allocate a new packet.static int
ID_INTERNAL_DEBUG_STACKTRACE
Debug data with the stacktrace for the writer.static int
ID_INTERNAL_DEBUG_TYPES
Debug data with type information for the next packet.static int
ID_INTERNAL_NEW_BANDWIDTH
The ID to inform the other side of a connection about the bandwidth we want to send/receive.static int
ID_INTERNAL_REQUEST_DEBUG_TYPES
Sent by a receiver who wishes to receiveID_INTERNAL_DEBUG_TYPES
.static int
ID_INTERNAL_REQUEST_STACKTRACES
Sent by a receiver who wishes to receiveID_INTERNAL_DEBUG_STACKTRACE
. -
Constructor Summary
Constructors Constructor Description InternalMsgUtil()
-
Method Summary
Modifier and Type Method Description static 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:
- Constant Field Values
-
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:
- Constant Field Values
-
ID_INTERNAL_ALLOCATE_STACKTRACE_ELEMENT
public static final int ID_INTERNAL_ALLOCATE_STACKTRACE_ELEMENTSent as part ofID_INTERNAL_DEBUG_STACKTRACE
.- See Also:
- Constant Field Values
-
ID_INTERNAL_DEBUG_TYPES
public static final int ID_INTERNAL_DEBUG_TYPESDebug data with type information for the next packet.- See Also:
- Constant Field Values
-
ID_INTERNAL_DEBUG_STACKTRACE
public static final int ID_INTERNAL_DEBUG_STACKTRACEDebug data with the stacktrace for the writer.- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
ID_INTERNAL_REQUEST_STACKTRACES
public static final int ID_INTERNAL_REQUEST_STACKTRACESSent by a receiver who wishes to receiveID_INTERNAL_DEBUG_STACKTRACE
.- See Also:
- Constant Field Values
-
COUNT_HARDCODED_IDS
public static final int COUNT_HARDCODED_IDS- See Also:
- Constant Field Values
-
-
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.
-