From 59d5f4feec2242eb68d768b1cf9f27aa3fd3b1e9 Mon Sep 17 00:00:00 2001 From: coooookies <1164557342@qq.com> Date: Sun, 1 May 2022 18:41:51 +0800 Subject: [PATCH] GameServerPacketHandler need to be added a registration interface for plugin developers --- .../grasscutter/server/game/GameServerPacketHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java b/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java index 89fa71481..dbead5240 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java +++ b/src/main/java/emu/grasscutter/server/game/GameServerPacketHandler.java @@ -22,7 +22,11 @@ public class GameServerPacketHandler { this.registerHandlers(handlerClass); } - + + public void registerPacketHandler(int opcode, PacketHandler handler) { + this.handlers.put(opcode, handler); + } + public void registerHandlers(Class handlerClass) { Reflections reflections = new Reflections("emu.grasscutter.server.packet"); Set handlerClasses = reflections.getSubTypesOf(handlerClass);