mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-26 18:53:16 +08:00
GameServerPacketHandler need to be added a registration interface for plugin developers
This commit is contained in:
parent
677aa2d2c4
commit
dde5a609fb
@ -22,7 +22,11 @@ public class GameServerPacketHandler {
|
|||||||
|
|
||||||
this.registerHandlers(handlerClass);
|
this.registerHandlers(handlerClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerPacketHandler(int opcode, PacketHandler handler) {
|
||||||
|
this.handlers.put(opcode, handler);
|
||||||
|
}
|
||||||
|
|
||||||
public void registerHandlers(Class<? extends PacketHandler> handlerClass) {
|
public void registerHandlers(Class<? extends PacketHandler> handlerClass) {
|
||||||
Reflections reflections = new Reflections("emu.grasscutter.server.packet");
|
Reflections reflections = new Reflections("emu.grasscutter.server.packet");
|
||||||
Set<?> handlerClasses = reflections.getSubTypesOf(handlerClass);
|
Set<?> handlerClasses = reflections.getSubTypesOf(handlerClass);
|
||||||
|
Loading…
Reference in New Issue
Block a user