RuneHive-Game
Loading...
Searching...
No Matches
LoginResponsePacket.java
Go to the documentation of this file.
1package com.runehive.net.codec.login;
2
3import com.runehive.game.world.entity.mob.player.PlayerRight;
4
5/**
6 * An immutable message that is written through a channel and forwarded to the
7 * {@code LoginResponseEncoder} where it is encoded and sent to the client.
8 *
9 * @author lare96 <http://github.org/lare96>
10 */
11public final class LoginResponsePacket {
12
13 /**
14 * The actual login response.
15 */
16 private final LoginResponse response;
17
18 /**
19 * The {@code Player}s authority level.
20 */
21 private final PlayerRight rights;
22
23 /**
24 * If the {@code Player} is flagged.
25 */
26 private final boolean flagged;
27
28 /**
29 * Creates a new {@code LoginResponsePacket}.
30 *
31 * @param response
32 * The actual login response.
33 * @param rights
34 * The {@code Player}s authority level.
35 * @param flagged
36 * If the {@code Player} is flagged.
37 */
39 this.response = response;
40 this.rights = rights;
41 this.flagged = flagged;
42 }
43
44 /**
45 * Creates a new {@code LoginResponsePacket} with an authority level of
46 * {@code PLAYER} and a {@code flagged} value of {@code false}.
47 *
48 * @param response
49 * The actual login response.
50 */
54
55 /**
56 * @return The actual login response.
57 */
59 return response;
60 }
61
62 /**
63 * @return The {@code Player}s authority level.
64 */
66 return rights;
67 }
68
69 /**
70 * @return {@code true} if flagged
71 */
72 public boolean isFlagged() {
73 return flagged;
74 }
75}
LoginResponsePacket(LoginResponse response)
Creates a new LoginResponsePacket with an authority level of PLAYER and a flagged value of false.
final LoginResponse response
The actual login response.
LoginResponsePacket(LoginResponse response, PlayerRight rights, boolean flagged)
Creates a new LoginResponsePacket.
final boolean flagged
If the Player is flagged.
final PlayerRight rights
The Players authority level.
Represents the enumerated login response codes.