RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
com.osroyale.net.packet.GamePacket Class Reference

Public Member Functions

 GamePacket (final int opcode, final PacketType header, final ByteBuf payload)
int getSize ()
int getOpcode ()
PacketType getHeader ()
ByteBuf getPayload ()
int readByte ()
int readByte (boolean signed)
int readByte (ByteModification mod)
int readByte (boolean signed, ByteModification mod)
int readShort ()
int readShort (boolean signed)
int readShort (ByteOrder order)
int readShort (boolean signed, ByteOrder order)
int readShort (ByteOrder order, ByteModification mod)
int readShort (ByteModification mod)
int readShort (boolean signed, ByteModification mod)
int readShort (boolean signed, ByteOrder order, ByteModification mod)
int readInt ()
int readInt (boolean signed)
int readInt (ByteModification mod)
int readInt (boolean signed, ByteModification mod)
int readInt (boolean signed, ByteOrder order)
int readInt (boolean signed, ByteOrder order, ByteModification mod)
long readLong ()
long readLong (boolean signed)
long readLong (ByteModification mod)
long readLong (boolean signed, ByteModification mod)
long readLong (boolean signed, ByteOrder order)
long readLong (boolean signed, ByteOrder order, ByteModification mod)
byte[] readBytes (int amount)
byte[] readBytes (int amount, ByteModification mod)
byte[] readBytesReverse (int amount)
byte[] readBytesReverse (int amount, ByteModification mod)
String getRS2String ()

Detailed Description

Represents a single game packet.

Author
nshusa

Definition at line 50 of file GamePacket.java.

Constructor & Destructor Documentation

◆ GamePacket()

com.osroyale.net.packet.GamePacket.GamePacket ( final int opcode,
final PacketType header,
final ByteBuf payload )
inline

Creates a GamePacket.

Parameters
opcodeThe opcode.
headerThe header.
payloadThe payload.

Definition at line 82 of file GamePacket.java.

Member Function Documentation

◆ getHeader()

PacketType com.osroyale.net.packet.GamePacket.getHeader ( )
inline

Gets the type.

Returns
The type.

Definition at line 114 of file GamePacket.java.

◆ getOpcode()

int com.osroyale.net.packet.GamePacket.getOpcode ( )
inline

Gets the opcode.

Returns
The opcode.

Definition at line 105 of file GamePacket.java.

◆ getPayload()

ByteBuf com.osroyale.net.packet.GamePacket.getPayload ( )
inline

Gets the payload.

Returns
The payload.

Definition at line 123 of file GamePacket.java.

◆ getRS2String()

String com.osroyale.net.packet.GamePacket.getRS2String ( )
inline

Reads a RuneScape string.

Returns
The string.

Definition at line 637 of file GamePacket.java.

◆ getSize()

int com.osroyale.net.packet.GamePacket.getSize ( )
inline

Gets the size of this payload.

Returns
The amount of readable bytes.

Definition at line 96 of file GamePacket.java.

◆ readByte() [1/4]

int com.osroyale.net.packet.GamePacket.readByte ( )
inline

Reads a STANDARD signed byte from the payload.

Returns
The byte.

Definition at line 132 of file GamePacket.java.

◆ readByte() [2/4]

int com.osroyale.net.packet.GamePacket.readByte ( boolean signed )
inline

Reads a STANDARD byte from the payload.

Parameters
signedThe flag that denotes this value is signed.
Returns
The byte.

Definition at line 144 of file GamePacket.java.

◆ readByte() [3/4]

int com.osroyale.net.packet.GamePacket.readByte ( boolean signed ,
ByteModification mod )
inline

Reads a single byte from the payload.

Parameters
signedThe flag that denotes this value is signed.
modThe modification performed on this value.
Returns
The byte.

Definition at line 171 of file GamePacket.java.

◆ readByte() [4/4]

int com.osroyale.net.packet.GamePacket.readByte ( ByteModification mod)
inline

Reads a signed byte from the payload.

Parameters
modThe modification performed on this value.
Returns
The signed byte.

Definition at line 156 of file GamePacket.java.

◆ readBytes() [1/2]

byte[] com.osroyale.net.packet.GamePacket.readBytes ( int amount)
inline

Reads the amount of bytes into the array, starting at the current position.

Parameters
amountthe amount to read.
Returns
a buffer filled with the data.

Definition at line 555 of file GamePacket.java.

◆ readBytes() [2/2]

byte[] com.osroyale.net.packet.GamePacket.readBytes ( int amount,
ByteModification mod )
inline

Reads a series of bytes from a buffer.

Parameters
amountThe amount of bytes to read.
modThe modifications performed on the bytes values.
Returns
The bytes that where read.

Definition at line 570 of file GamePacket.java.

◆ readBytesReverse() [1/2]

byte[] com.osroyale.net.packet.GamePacket.readBytesReverse ( int amount)
inline

Reads a series of bytes in reverse.

Parameters
amountThe amount of bytes to read.
Returns
The bytes in reverse.

Definition at line 586 of file GamePacket.java.

◆ readBytesReverse() [2/2]

byte[] com.osroyale.net.packet.GamePacket.readBytesReverse ( int amount,
ByteModification mod )
inline

Reads a series of bytes in reverse.

Parameters
amountThe amount of bytes to read.
modThe modification performed on these bytes.
Returns
The bytes in reverse.

Definition at line 601 of file GamePacket.java.

◆ readInt() [1/6]

int com.osroyale.net.packet.GamePacket.readInt ( )
inline

Reads a STANDARD signed integer value from the payload in BIG order.

Returns
The integer value.

Definition at line 327 of file GamePacket.java.

◆ readInt() [2/6]

int com.osroyale.net.packet.GamePacket.readInt ( boolean signed )
inline

Reads a STANDARD integer value from the payload in BIG order.

Parameters
signedThe flag that denotes this value is signed.
Returns
The integer value.

Definition at line 340 of file GamePacket.java.

◆ readInt() [3/6]

int com.osroyale.net.packet.GamePacket.readInt ( boolean signed ,
ByteModification mod )
inline

Reads an integer value from the payload in BIG order.

Parameters
signedThe flag that denotes this value is signed.
modThe modifications performed on this value.
Returns
The integer value.

Definition at line 368 of file GamePacket.java.

◆ readInt() [4/6]

int com.osroyale.net.packet.GamePacket.readInt ( boolean signed ,
ByteOrder order )
inline

Reads a STANDARD integer value from the payload.

Parameters
signedThe flag that denotes this value is signed.
orderThe order in which the value is written.
Returns
The integer value.

Definition at line 383 of file GamePacket.java.

◆ readInt() [5/6]

int com.osroyale.net.packet.GamePacket.readInt ( boolean signed ,
ByteOrder order,
ByteModification mod )
inline

Reads an integer value from the payload.

Parameters
signedThe flag that denotes this value is signed.
orderThe order in which the value is written.
modThe modifications performed on this value.
Returns
The integer value.

Definition at line 401 of file GamePacket.java.

◆ readInt() [6/6]

int com.osroyale.net.packet.GamePacket.readInt ( ByteModification mod)
inline

Reads a signed integer value from the payload in ByteOrder BIG order.

Parameters
modThe modifications performed on this value.
Returns
The integer value.

Definition at line 353 of file GamePacket.java.

◆ readLong() [1/6]

long com.osroyale.net.packet.GamePacket.readLong ( )
inline

Reads a STANDARD signed long value from the payload in BIG order.

Returns
The long value.

Definition at line 441 of file GamePacket.java.

◆ readLong() [2/6]

long com.osroyale.net.packet.GamePacket.readLong ( boolean signed )
inline

Reads a STANDARD long value from the payload in BIG order.

Parameters
signedThe flag that denotes this value is signed.
Returns
The long value.

Definition at line 454 of file GamePacket.java.

◆ readLong() [3/6]

long com.osroyale.net.packet.GamePacket.readLong ( boolean signed ,
ByteModification mod )
inline

Reads a long value from the payload in BIG order.

Parameters
signedThe flag that denotes this value is signed.
modThe modifications performed on this value.
Returns
The long value.

Definition at line 481 of file GamePacket.java.

◆ readLong() [4/6]

long com.osroyale.net.packet.GamePacket.readLong ( boolean signed ,
ByteOrder order )
inline

Reads a STANDARD long value from the payload.

Parameters
signedThe flag that denotes this value is signed.
orderThe order in which the value is written.
Returns
The long value.

Definition at line 496 of file GamePacket.java.

◆ readLong() [5/6]

long com.osroyale.net.packet.GamePacket.readLong ( boolean signed ,
ByteOrder order,
ByteModification mod )
inline

Reads a long value from the payload.

Parameters
signedThe flag that denotes this value is signed.
orderThe order in which the value is written.
modThe modifications performed on this value.
Returns
The long value.

Definition at line 514 of file GamePacket.java.

◆ readLong() [6/6]

long com.osroyale.net.packet.GamePacket.readLong ( ByteModification mod)
inline

Reads a signed long value from the payload in BIG order.

Parameters
modThe modifications performed on this value.
Returns
The long value.

Definition at line 466 of file GamePacket.java.

◆ readShort() [1/8]

int com.osroyale.net.packet.GamePacket.readShort ( )
inline

Reads a STANDARD signed short value from the payload in BIG order.

Returns
The standard signed short value.

Definition at line 199 of file GamePacket.java.

◆ readShort() [2/8]

int com.osroyale.net.packet.GamePacket.readShort ( boolean signed )
inline

Reads a STANDARD short value from the payload in BIG order.

Parameters
signedThe flag that denotes this value is signed.
Returns
The standard short value.

Definition at line 212 of file GamePacket.java.

◆ readShort() [3/8]

int com.osroyale.net.packet.GamePacket.readShort ( boolean signed ,
ByteModification mod )
inline

Reads a short value from the payload in BIG order.

Parameters
signedThe flag that denotes this value is signed.
modThe modifications performed on this value.
Returns
The short value.

Definition at line 281 of file GamePacket.java.

◆ readShort() [4/8]

int com.osroyale.net.packet.GamePacket.readShort ( boolean signed ,
ByteOrder order )
inline

Reads a STANDARD short value from the payload.

Parameters
signedThe flag that denotes this value is signed.
orderThe order in which this value is written.
Returns
The standard short value.

Definition at line 239 of file GamePacket.java.

◆ readShort() [5/8]

int com.osroyale.net.packet.GamePacket.readShort ( boolean signed ,
ByteOrder order,
ByteModification mod )
inline

Reads a short value from the payload.

Parameters
signedThe flag that denotes this value is signed.
orderThe order in which the value is written.
modThe modifications performed on this value.
Returns
The short value.

Definition at line 299 of file GamePacket.java.

◆ readShort() [6/8]

int com.osroyale.net.packet.GamePacket.readShort ( ByteModification mod)
inline

Reads a signed short value from the payload BIG order.

Parameters
modThe modifications performed on this value.
Returns
The short value.

Definition at line 266 of file GamePacket.java.

◆ readShort() [7/8]

int com.osroyale.net.packet.GamePacket.readShort ( ByteOrder order)
inline

Reads a STANDARD signed short value from the payload.

Parameters
orderThe order in which this value is written.
Returns
The signed standard short value.

Definition at line 224 of file GamePacket.java.

◆ readShort() [8/8]

int com.osroyale.net.packet.GamePacket.readShort ( ByteOrder order,
ByteModification mod )
inline

Reads a signed short value from the payload.

Parameters
orderThe order in which this value is written.
modThe modifications performed on this value.
Returns
The short value.

Definition at line 254 of file GamePacket.java.


The documentation for this class was generated from the following file: