Rename LOGIN_DOWNSTREAM_JS5REMOTE to JS5REMOTE_DOWNSTREAM

I've also removed the comment - I'm going to have to do something
similar for CREATE_DOWNSTREAM, and I think it's a bit more obvious with
the more distinctive name.
Graham 2 years ago
parent 92c41d4a19
commit c43d48f71b
  1. 2
      archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelInitializer.kt
  2. 2
      game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt
  3. 9
      protocol/src/main/kotlin/org/openrs2/protocol/Protocol.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)
}

@ -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)

@ -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,

Loading…
Cancel
Save