@ -49,6 +49,9 @@ public class LoginChannelHandler @Inject constructor(
}
}
private fun handleInitJs5RemoteConnection ( ctx : ChannelHandlerContext , msg : LoginRequest . InitJs5RemoteConnection ) {
private fun handleInitJs5RemoteConnection ( ctx : ChannelHandlerContext , msg : LoginRequest . InitJs5RemoteConnection ) {
val encoder = ctx . pipeline ( ) . get ( Rs2Encoder :: class . java )
encoder . protocol = Protocol . LOGIN _DOWNSTREAM _JS5REMOTE
if ( msg . build != BUILD ) {
if ( msg . build != BUILD ) {
ctx . write ( LoginResponse . ClientOutOfDate ) . addListener ( ChannelFutureListener . CLOSE )
ctx . write ( LoginResponse . ClientOutOfDate ) . addListener ( ChannelFutureListener . CLOSE )
return
return
@ -64,7 +67,7 @@ public class LoginChannelHandler @Inject constructor(
ctx . write ( LoginResponse . Js5Ok ) . addListener { future ->
ctx . write ( LoginResponse . Js5Ok ) . addListener { future ->
if ( future . isSuccess ) {
if ( future . isSuccess ) {
ctx . pipeline ( ) . remove ( Rs2Encoder :: class . java )
ctx . pipeline ( ) . remove ( encoder )
ctx . pipeline ( ) . remove ( this )
ctx . pipeline ( ) . remove ( this )
}
}
}
}