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

The OutgoingPacket responsible for sending game messages. More...

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

Public Member Functions

boolean encode (Player player)
 SendGameMessage (int id, int time, Object context)
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 Object context
final int id
final int time

Additional Inherited Members

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

Detailed Description

The OutgoingPacket responsible for sending game messages.

Author
Daniel

Definition at line 12 of file SendGameMessage.java.

Constructor & Destructor Documentation

◆ SendGameMessage()

com.runehive.net.packet.out.SendGameMessage.SendGameMessage ( int id,
int time,
Object context )

Definition at line 18 of file SendGameMessage.java.

18 {
19 super(114, PacketType.VAR_BYTE);
20 this.id = id;
21 this.time = time;
22 this.context = context;
23 }

References context, id, time, and com.runehive.net.packet.PacketType.VAR_BYTE.

Member Function Documentation

◆ encode()

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

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

Definition at line 26 of file SendGameMessage.java.

26 {
27 builder.writeShort(id).writeShort(time * 3000)
28 .writeString(String.valueOf(context));
29 return true;
30 }

References com.runehive.net.packet.OutgoingPacket.builder, context, and time.

Member Data Documentation

◆ context

final Object com.runehive.net.packet.out.SendGameMessage.context
private

Definition at line 16 of file SendGameMessage.java.

Referenced by encode(), and SendGameMessage().

◆ id

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

Definition at line 14 of file SendGameMessage.java.

Referenced by SendGameMessage().

◆ time

final int com.runehive.net.packet.out.SendGameMessage.time
private

Definition at line 15 of file SendGameMessage.java.

Referenced by encode(), and SendGameMessage().


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