|
RuneHive-Game
|
The repository that stores packets sizes and listeners for how to execute the packets. More...
Static Public Member Functions | |
| static PacketListener | lookupListener (final int opcode) |
| Looks up the listener for this packet. | |
| static int | lookupSize (int opcode) |
| Looks up the reference size of a packet. | |
| static PacketType | lookupType (int opcode) |
| The method that looks up the packets type. | |
| static void | registerListener (int opcode, PacketListener listener) |
| Registers a listener to listen for client -> server packet events. | |
| static void | registerType (int opcode, int type) |
| Registers a type for a packet. | |
| static void | sendToListener (Player player, GamePacket packet) |
Static Private Attributes | |
| static final Logger | logger = LogManager.getLogger(PacketRepository.class) |
| static final int | MAX_CLIENT_PACKETS = 257 |
| The number of client packets known. | |
| static final PacketListener[] | packetListeners = new PacketListener[MAX_CLIENT_PACKETS] |
| The client -> server packet listeners. | |
| static final int[] | packetTypes = new int[MAX_CLIENT_PACKETS] |
| The array that holds packet types. | |
The repository that stores packets sizes and listeners for how to execute the packets.
Definition at line 15 of file PacketRepository.java.
|
static |
Looks up the listener for this packet.
| opcode | The opcode of the packet |
Definition at line 62 of file PacketRepository.java.
References packetListeners.
Referenced by com.runehive.net.codec.game.GamePacketDecoder.decodePayload().
|
static |
Looks up the reference size of a packet.
| opcode | The packet to lookup |
Definition at line 100 of file PacketRepository.java.
References packetTypes.
Referenced by com.runehive.net.codec.game.GamePacketDecoder.decodeOpcode().
|
static |
The method that looks up the packets type.
| opcode | The opcode to lookup |
Definition at line 76 of file PacketRepository.java.
References com.runehive.net.packet.PacketType.EMPTY, com.runehive.net.packet.PacketType.FIXED, packetTypes, com.runehive.net.packet.PacketType.VAR_BYTE, and com.runehive.net.packet.PacketType.VAR_SHORT.
Referenced by com.runehive.net.codec.game.GamePacketDecoder.decodeOpcode().
|
static |
Registers a listener to listen for client -> server packet events.
| opcode | The packet to intercept. |
| listener | The listener that will execute this packet. |
Definition at line 50 of file PacketRepository.java.
References packetListeners.
Referenced by com.runehive.io.PacketListenerLoader.run().
|
static |
Registers a type for a packet.
The following types are...
-2 var_short -1 var_byte 0 empty
0 fixed
| opcode | The packet to register this type for |
| type | The type for this packet. |
Definition at line 120 of file PacketRepository.java.
References packetListeners, and packetTypes.
Referenced by com.runehive.util.parser.impl.PacketSizeParser.parse().
|
static |
Definition at line 34 of file PacketRepository.java.
References com.runehive.net.packet.PacketListener.handlePacket(), and packetListeners.
Referenced by com.runehive.net.session.GameSession.processClientPackets().
|
staticprivate |
Definition at line 17 of file PacketRepository.java.
|
staticprivate |
The number of client packets known.
Definition at line 22 of file PacketRepository.java.
|
staticprivate |
The client -> server packet listeners.
Definition at line 27 of file PacketRepository.java.
Referenced by lookupListener(), registerListener(), registerType(), and sendToListener().
|
staticprivate |
The array that holds packet types.
Definition at line 32 of file PacketRepository.java.
Referenced by lookupSize(), lookupType(), and registerType().