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

Sends a chatbox input prompt that accepts full text with spaces. More...

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

Public Member Functions

boolean encode (Player player)
 SendInputMessage (String message, int length, Consumer< String > action)
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 Consumer< String > action
final int inputLength
final String inputMessage

Additional Inherited Members

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

Detailed Description

Sends a chatbox input prompt that accepts full text with spaces.

This creates an input field in the chatbox where players can type messages. Based on 317 protocol inputDialogState system - packet triggers client-side text input mode that sends back typed string via packet 60.

Author
Daniel
Michael
AI Port (317 inputDialogState pattern)

Definition at line 20 of file SendInputMessage.java.

Constructor & Destructor Documentation

◆ SendInputMessage()

com.runehive.net.packet.out.SendInputMessage.SendInputMessage ( String message,
int length,
Consumer< String > action )

Definition at line 26 of file SendInputMessage.java.

26 {
27 super(187, PacketType.VAR_BYTE);
28 this.action = action;
29 this.inputMessage = message;
30 this.inputLength = length;
31 }

References action, and com.runehive.net.packet.PacketType.VAR_BYTE.

Member Function Documentation

◆ encode()

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

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

Definition at line 34 of file SendInputMessage.java.

34 {
35 player.enterInputListener = Optional.of(action);
36 // Packet 187 VAR_BYTE format: writes prompt string
37 // Client should display chatbox input interface and send back via packet 60
38 builder.writeString(inputMessage);
39 return true;
40 }

References action, com.runehive.net.packet.OutgoingPacket.builder, and inputMessage.

Member Data Documentation

◆ action

final Consumer<String> com.runehive.net.packet.out.SendInputMessage.action
private

Definition at line 22 of file SendInputMessage.java.

Referenced by encode(), and SendInputMessage().

◆ inputLength

final int com.runehive.net.packet.out.SendInputMessage.inputLength
private

Definition at line 24 of file SendInputMessage.java.

◆ inputMessage

final String com.runehive.net.packet.out.SendInputMessage.inputMessage
private

Definition at line 23 of file SendInputMessage.java.

Referenced by encode().


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