Add JS5 client timeout

Signed-off-by: Graham <gpe@openrs2.org>
Graham 4 years ago
parent e3e0094b43
commit 59d75721d1
  1. 2
      archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelInitializer.kt

@ -2,6 +2,7 @@ package org.openrs2.archive.cache
import io.netty.channel.Channel import io.netty.channel.Channel
import io.netty.channel.ChannelInitializer import io.netty.channel.ChannelInitializer
import io.netty.handler.timeout.ReadTimeoutHandler
import org.openrs2.protocol.Protocol import org.openrs2.protocol.Protocol
import org.openrs2.protocol.Rs2Decoder import org.openrs2.protocol.Rs2Decoder
import org.openrs2.protocol.Rs2Encoder import org.openrs2.protocol.Rs2Encoder
@ -14,6 +15,7 @@ import org.openrs2.protocol.login.ServerFullCodec
public class Js5ChannelInitializer(private val handler: Js5ChannelHandler) : ChannelInitializer<Channel>() { public class Js5ChannelInitializer(private val handler: Js5ChannelHandler) : ChannelInitializer<Channel>() {
override fun initChannel(ch: Channel) { override fun initChannel(ch: Channel) {
ch.pipeline().addLast( ch.pipeline().addLast(
ReadTimeoutHandler(30),
Rs2Encoder(Protocol(InitJs5RemoteConnectionCodec)), Rs2Encoder(Protocol(InitJs5RemoteConnectionCodec)),
Rs2Decoder(Protocol(Js5OkCodec, ClientOutOfDateCodec, IpLimitCodec, ServerFullCodec)), Rs2Decoder(Protocol(Js5OkCodec, ClientOutOfDateCodec, IpLimitCodec, ServerFullCodec)),
handler handler

Loading…
Cancel
Save