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

The OutgoingPacket that sends a message to a Players chatbox in the client. More...

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

Public Member Functions

boolean encode (Player player)
 SendMessage (Object message)
 SendMessage (Object message, boolean filtered)
 SendMessage (Object message, MessageColor color)
 SendMessage (Object message, MessageColor color, boolean filtered)
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 boolean filtered
final Object message

Additional Inherited Members

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

Detailed Description

The OutgoingPacket that sends a message to a Players chatbox in the client.

Author
Michael | Chex

Definition at line 14 of file SendMessage.java.

Constructor & Destructor Documentation

◆ SendMessage() [1/4]

com.runehive.net.packet.out.SendMessage.SendMessage ( Object message)

Definition at line 19 of file SendMessage.java.

19 {
20 this(message, MessageColor.BLACK);
21 }

References com.runehive.util.MessageColor.BLACK, and message.

◆ SendMessage() [2/4]

com.runehive.net.packet.out.SendMessage.SendMessage ( Object message,
boolean filtered )

Definition at line 23 of file SendMessage.java.

23 {
24 this(message, MessageColor.BLACK, filtered);
25 }

References com.runehive.util.MessageColor.BLACK, filtered, and message.

◆ SendMessage() [3/4]

com.runehive.net.packet.out.SendMessage.SendMessage ( Object message,
MessageColor color )

Definition at line 27 of file SendMessage.java.

27 {
28 this(message, color, false);
29 }

References message.

◆ SendMessage() [4/4]

com.runehive.net.packet.out.SendMessage.SendMessage ( Object message,
MessageColor color,
boolean filtered )

Definition at line 31 of file SendMessage.java.

31 {
32 super(253, PacketType.VAR_BYTE);
33 this.message = (color == MessageColor.BLACK ? "" : "<col=" + color.getColor() + ">") + message;
34 this.filtered = filtered;
35 }

References com.runehive.util.MessageColor.BLACK, filtered, com.runehive.util.MessageColor.getColor(), message, and com.runehive.net.packet.PacketType.VAR_BYTE.

Here is the call graph for this function:

Member Function Documentation

◆ encode()

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

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

Definition at line 38 of file SendMessage.java.

38 {
39 builder.writeString(String.valueOf(message));
40 builder.writeByte(filtered ? 1 : 0);
41 return true;
42 }

References com.runehive.net.packet.OutgoingPacket.builder, filtered, and message.

Member Data Documentation

◆ filtered

final boolean com.runehive.net.packet.out.SendMessage.filtered
private

Definition at line 17 of file SendMessage.java.

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

◆ message

final Object com.runehive.net.packet.out.SendMessage.message
private

Definition at line 16 of file SendMessage.java.

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


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