diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelInitializer.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelInitializer.kt index 53845962..9ddb8d8c 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelInitializer.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelInitializer.kt @@ -12,7 +12,7 @@ public class OsrsJs5ChannelInitializer(private val handler: OsrsJs5ChannelHandle ch.pipeline().addLast( ReadTimeoutHandler(30), Rs2Encoder(Protocol.LOGIN_UPSTREAM), - Rs2Decoder(Protocol.LOGIN_DOWNSTREAM_JS5REMOTE) + Rs2Decoder(Protocol.JS5REMOTE_DOWNSTREAM) ) ch.pipeline().addLast("handler", handler) } diff --git a/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt b/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt index f52b986d..469edb2a 100644 --- a/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt +++ b/game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt @@ -50,7 +50,7 @@ public class LoginChannelHandler @Inject constructor( private fun handleInitJs5RemoteConnection(ctx: ChannelHandlerContext, msg: LoginRequest.InitJs5RemoteConnection) { val encoder = ctx.pipeline().get(Rs2Encoder::class.java) - encoder.protocol = Protocol.LOGIN_DOWNSTREAM_JS5REMOTE + encoder.protocol = Protocol.JS5REMOTE_DOWNSTREAM if (msg.build != BUILD) { ctx.write(LoginResponse.ClientOutOfDate).addListener(ChannelFutureListener.CLOSE) diff --git a/protocol/src/main/kotlin/org/openrs2/protocol/Protocol.kt b/protocol/src/main/kotlin/org/openrs2/protocol/Protocol.kt index 9de48685..6e843fe4 100644 --- a/protocol/src/main/kotlin/org/openrs2/protocol/Protocol.kt +++ b/protocol/src/main/kotlin/org/openrs2/protocol/Protocol.kt @@ -46,14 +46,7 @@ public class Protocol(vararg codecs: PacketCodec<*>) { IpLimitCodec ) - /** - * Unfortunately the Js5Ok packet's opcode overlaps with the exchange - * session keys opcode - the only case where this happens. We therefore - * have two LOGIN_DOWNSTREAM protocols to avoid ambiguity: one for - * responses to the InitJs5RemoteConnection packet, and one for - * responses to all other login packets. - */ - public val LOGIN_DOWNSTREAM_JS5REMOTE: Protocol = Protocol( + public val JS5REMOTE_DOWNSTREAM: Protocol = Protocol( Js5OkCodec, ClientOutOfDateCodec, ServerFullCodec,