Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,4 @@ class PacketHandler(
super.channelRead(context, message)
}

override fun channelInactive(ctx: ChannelHandlerContext) {
if (ctx.pipeline().get("hq_injector") != null) {
virtualHandlerRegistry.cleanup(uniqueId)
ctx.pipeline().remove("hq_injector")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import kr.hqservice.framework.nms.handler.PacketHandler
import kr.hqservice.framework.nms.util.NmsNettyInjectService
import kr.hqservice.framework.nms.v20_6.wrapper.reflect.NmsReflectionWrapperImpl
import kr.hqservice.framework.nms.virtual.registry.VirtualHandlerRegistry
import net.minecraft.network.HandlerNames
import org.bukkit.Server
import org.bukkit.entity.Player
import org.bukkit.plugin.Plugin
Expand Down Expand Up @@ -43,7 +44,7 @@ class NmsNettyInjectServiceImpl(

if (pipeline.get("hq_packet_handler") == null) {
pipeline.addBefore(
"packet_handler",
HandlerNames.PACKET_HANDLER,
"hq_packet_handler",
PacketHandler(player, plugin, virtualHandlerRegistry)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import kr.hqservice.framework.nms.handler.PacketHandler
import kr.hqservice.framework.nms.util.NmsNettyInjectService
import kr.hqservice.framework.nms.v21.wrapper.reflect.NmsReflectionWrapperImpl
import kr.hqservice.framework.nms.virtual.registry.VirtualHandlerRegistry
import net.minecraft.network.HandlerNames
import org.bukkit.Server
import org.bukkit.entity.Player
import org.bukkit.plugin.Plugin
Expand Down Expand Up @@ -43,7 +44,7 @@ class NmsNettyInjectServiceImpl(

if (pipeline.get("hq_packet_handler") == null) {
pipeline.addBefore(
"packet_handler",
HandlerNames.PACKET_HANDLER,
"hq_packet_handler",
PacketHandler(player, plugin, virtualHandlerRegistry)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class LegacyNmsNettyInjectService(

if (pipeline.get("hq_packet_handler") == null) {
pipeline.addBefore(
"packet_handler",
"packet_handler", // TODO: Change the hardcoded value to a constant
"hq_packet_handler",
PacketHandler(player, plugin, virtualHandlerRegistry)
)
Expand Down