RuneHive-Game
Loading...
Searching...
No Matches
SendFadeScreen.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.net.packet.OutgoingPacket;
4import com.runehive.net.packet.PacketType;
5import com.runehive.game.world.entity.mob.player.Player;
6
7/**
8 * Handles sending the fade screen packet.
9 *
10 * @author Daniel
11 */
12public class SendFadeScreen extends OutgoingPacket {
13
14 private final String message;
15 private final int state;
16 private final int seconds;
17
18 public SendFadeScreen(String message, int state, int seconds) {
19 super(189, PacketType.VAR_SHORT);
20 this.message = message;
21 this.state = state;
22 this.seconds = seconds;
23 }
24
25 @Override
26 public boolean encode(Player player) {
27 player.interfaceManager.close();
28 builder.writeString(message)
29 .writeByte(state)
30 .writeByte(seconds);
31 return true;
32 }
33
34}
This class represents a character controlled by a player.
Definition Player.java:125
OutgoingPacket(int opcode, int capacity)
SendFadeScreen(String message, int state, int seconds)
Represents a type of packet.
VAR_SHORT
A variable packet where the size is indicated by a short.