GameServerPacketHandler need to be added a registration interface for plugin developers

This commit is contained in:
coooookies 2022-05-01 18:41:51 +08:00 committed by Melledy
parent d4e1b265e3
commit 59d5f4feec

View File

@ -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<? extends PacketHandler> handlerClass) {
Reflections reflections = new Reflections("emu.grasscutter.server.packet");
Set<?> handlerClasses = reflections.getSubTypesOf(handlerClass);