Optimise inbound message matcher creation

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 4 years ago
parent 29693a39cf
commit 89f7a192f9
  1. 2
      game/src/main/kotlin/org/openrs2/game/net/crossdomain/CrossDomainChannelHandler.kt
  2. 2
      game/src/main/kotlin/org/openrs2/game/net/http/HttpChannelHandler.kt
  3. 2
      game/src/main/kotlin/org/openrs2/game/net/jaggrab/JaggrabChannelHandler.kt
  4. 2
      game/src/main/kotlin/org/openrs2/game/net/js5/Js5ChannelHandler.kt
  5. 2
      game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt

@ -12,7 +12,7 @@ import org.openrs2.buffer.use
import org.openrs2.game.net.http.Http import org.openrs2.game.net.http.Http
@ChannelHandler.Sharable @ChannelHandler.Sharable
public object CrossDomainChannelHandler : SimpleChannelInboundHandler<HttpRequest>() { public object CrossDomainChannelHandler : SimpleChannelInboundHandler<HttpRequest>(HttpRequest::class.java) {
private const val ENDPOINT = "/crossdomain.xml" private const val ENDPOINT = "/crossdomain.xml"
private val POLICY = """ private val POLICY = """
<?xml version="1.0"?> <?xml version="1.0"?>

@ -16,7 +16,7 @@ import javax.inject.Singleton
@ChannelHandler.Sharable @ChannelHandler.Sharable
public class HttpChannelHandler @Inject constructor( public class HttpChannelHandler @Inject constructor(
private val fileProvider: FileProvider private val fileProvider: FileProvider
) : SimpleChannelInboundHandler<HttpRequest>() { ) : SimpleChannelInboundHandler<HttpRequest>(HttpRequest::class.java) {
override fun channelActive(ctx: ChannelHandlerContext) { override fun channelActive(ctx: ChannelHandlerContext) {
ctx.read() ctx.read()
} }

@ -15,7 +15,7 @@ import javax.inject.Singleton
@ChannelHandler.Sharable @ChannelHandler.Sharable
public class JaggrabChannelHandler @Inject constructor( public class JaggrabChannelHandler @Inject constructor(
private val fileProvider: FileProvider private val fileProvider: FileProvider
) : SimpleChannelInboundHandler<JaggrabRequest>() { ) : SimpleChannelInboundHandler<JaggrabRequest>(JaggrabRequest::class.java) {
override fun handlerAdded(ctx: ChannelHandlerContext) { override fun handlerAdded(ctx: ChannelHandlerContext) {
ctx.read() ctx.read()
} }

@ -9,7 +9,7 @@ import javax.inject.Inject
public class Js5ChannelHandler @Inject constructor( public class Js5ChannelHandler @Inject constructor(
private val service: Js5Service private val service: Js5Service
) : SimpleChannelInboundHandler<Js5Request>() { ) : SimpleChannelInboundHandler<Js5Request>(Js5Request::class.java) {
private lateinit var client: Js5Client private lateinit var client: Js5Client
override fun handlerAdded(ctx: ChannelHandlerContext) { override fun handlerAdded(ctx: ChannelHandlerContext) {

@ -29,7 +29,7 @@ import javax.inject.Provider
public class LoginChannelHandler @Inject constructor( public class LoginChannelHandler @Inject constructor(
private val js5HandlerProvider: Provider<Js5ChannelHandler>, private val js5HandlerProvider: Provider<Js5ChannelHandler>,
private val jaggrabHandler: JaggrabChannelHandler private val jaggrabHandler: JaggrabChannelHandler
) : SimpleChannelInboundHandler<LoginRequest>() { ) : SimpleChannelInboundHandler<LoginRequest>(LoginRequest::class.java) {
override fun channelActive(ctx: ChannelHandlerContext) { override fun channelActive(ctx: ChannelHandlerContext) {
ctx.read() ctx.read()
} }

Loading…
Cancel
Save