|
RuneHive-Game
|
The class that reads packets from the client into GamePacket's.
More...
Classes | |
| enum | State |
| Represents the current state of this class. More... | |
Public Member Functions | |
| GamePacketDecoder (IsaacCipher decryptor) | |
Protected Member Functions | |
| void | decode (ChannelHandlerContext ctx, ByteBuf in, List< Object > out) throws Exception |
Private Member Functions | |
| void | decodeOpcode (ByteBuf in, List< Object > out) |
| Decodes the packet identifier. | |
| void | decodePayload (ByteBuf in, List< Object > out) |
| Decodes the packets payload. | |
| void | decodeSize (ByteBuf in) |
| Decodes the packets size. | |
Private Attributes | |
| final IsaacCipher | decryptor |
| The isaac random used to decrypt a packets opcode. | |
| int | opcode |
| The current packet opcode. | |
| int | size |
| The current packet size. | |
| State | state = State.OPCODE |
| The current state of this class. | |
| PacketType | type = PacketType.EMPTY |
| The current packet type. | |
Static Private Attributes | |
| static final Logger | logger = LogManager.getLogger(GamePacketDecoder.class) |
| The single logger for this class. | |
The class that reads packets from the client into GamePacket's.
Definition at line 22 of file GamePacketDecoder.java.
| com.runehive.net.codec.game.GamePacketDecoder.GamePacketDecoder | ( | IsaacCipher | decryptor | ) |
Definition at line 54 of file GamePacketDecoder.java.
References decryptor.
|
protected |
Definition at line 59 of file GamePacketDecoder.java.
References decodeOpcode(), decodePayload(), decodeSize(), com.runehive.net.codec.game.GamePacketDecoder.State.OPCODE, com.runehive.net.codec.game.GamePacketDecoder.State.SIZE, and state.
|
private |
Decodes the packet identifier.
| in | The payload from the client. |
| out | The collection of upstream messages. |
Definition at line 75 of file GamePacketDecoder.java.
References decryptor, com.runehive.net.packet.PacketType.EMPTY, com.runehive.net.packet.PacketType.FIXED, com.runehive.net.packet.PacketRepository.lookupSize(), com.runehive.net.packet.PacketRepository.lookupType(), com.runehive.net.codec.game.GamePacketDecoder.State.OPCODE, opcode, com.runehive.net.codec.game.GamePacketDecoder.State.PAYLOAD, com.runehive.net.codec.game.GamePacketDecoder.State.SIZE, size, state, type, com.runehive.net.packet.PacketType.VAR_BYTE, and com.runehive.net.packet.PacketType.VAR_SHORT.
Referenced by decode().
|
private |
Decodes the packets payload.
| in | The payload from the client. |
| out | The collection of upstream messages. |
Definition at line 113 of file GamePacketDecoder.java.
References logger, com.runehive.net.packet.PacketRepository.lookupListener(), com.runehive.net.codec.game.GamePacketDecoder.State.OPCODE, opcode, size, state, and type.
Referenced by decode().
|
private |
Decodes the packets size.
| in | The payload from the client. |
Definition at line 98 of file GamePacketDecoder.java.
References com.runehive.net.codec.game.GamePacketDecoder.State.PAYLOAD, size, and state.
Referenced by decode().
|
private |
The isaac random used to decrypt a packets opcode.
Definition at line 32 of file GamePacketDecoder.java.
Referenced by decodeOpcode(), and GamePacketDecoder().
|
staticprivate |
The single logger for this class.
Definition at line 27 of file GamePacketDecoder.java.
Referenced by decodePayload().
|
private |
The current packet opcode.
Definition at line 37 of file GamePacketDecoder.java.
Referenced by decodeOpcode(), and decodePayload().
|
private |
The current packet size.
Definition at line 42 of file GamePacketDecoder.java.
Referenced by decodeOpcode(), decodePayload(), and decodeSize().
|
private |
The current state of this class.
Definition at line 52 of file GamePacketDecoder.java.
Referenced by decode(), decodeOpcode(), decodePayload(), and decodeSize().
|
private |
The current packet type.
Definition at line 47 of file GamePacketDecoder.java.
Referenced by decodeOpcode(), and decodePayload().