RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.net.packet.out.SendConfig Class Reference

The OutgoingPacket responsible for changing settings on a client. More...

Inheritance diagram for com.runehive.net.packet.out.SendConfig:
Collaboration diagram for com.runehive.net.packet.out.SendConfig:

Public Member Functions

boolean encode (Player player)
 SendConfig (int id, int value)
 SendConfig (int id, int value, boolean intValue)
Public Member Functions inherited from com.runehive.net.packet.OutgoingPacket
void execute (Player player)
 OutgoingPacket (int opcode, int capacity)
 OutgoingPacket (int opcode, PacketType type)
 OutgoingPacket (int opcode, PacketType type, int size)

Private Attributes

final int id
final boolean intValue
final int value

Additional Inherited Members

Protected Attributes inherited from com.runehive.net.packet.OutgoingPacket
final PacketBuilder builder

Detailed Description

The OutgoingPacket responsible for changing settings on a client.

Author
Daniel | Obey

Definition at line 12 of file SendConfig.java.

Constructor & Destructor Documentation

◆ SendConfig() [1/2]

com.runehive.net.packet.out.SendConfig.SendConfig ( int id,
int value,
boolean intValue )

Definition at line 18 of file SendConfig.java.

18 {
19 super(intValue ? 87 : 36, intValue ? 6 : 3);
20 this.id = id;
21 this.value = value;
22 this.intValue = intValue;
23 }

References id, intValue, and value.

◆ SendConfig() [2/2]

com.runehive.net.packet.out.SendConfig.SendConfig ( int id,
int value )

Definition at line 25 of file SendConfig.java.

25 {
26 this(id, value, value < Byte.MIN_VALUE || value > Byte.MAX_VALUE);
27 }

References id, and value.

Member Function Documentation

◆ encode()

boolean com.runehive.net.packet.out.SendConfig.encode ( Player player)

Reimplemented from com.runehive.net.packet.OutgoingPacket.

Definition at line 30 of file SendConfig.java.

30 {
31 if (value == -1) {
32 return false;
33 }
34 if(intValue) {
35 builder.writeShort(id, ByteOrder.LE).writeInt(value, ByteOrder.ME);
36 } else {
37 builder.writeShort(id, ByteOrder.LE).writeByte(value);
38 }
39
40 return true;
41 }

References com.runehive.net.packet.OutgoingPacket.builder, intValue, com.runehive.net.codec.ByteOrder.LE, com.runehive.net.codec.ByteOrder.ME, and value.

Member Data Documentation

◆ id

final int com.runehive.net.packet.out.SendConfig.id
private

Definition at line 14 of file SendConfig.java.

Referenced by SendConfig(), and SendConfig().

◆ intValue

final boolean com.runehive.net.packet.out.SendConfig.intValue
private

Definition at line 16 of file SendConfig.java.

Referenced by encode(), and SendConfig().

◆ value

final int com.runehive.net.packet.out.SendConfig.value
private

Definition at line 15 of file SendConfig.java.

Referenced by encode(), SendConfig(), and SendConfig().


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