Split protocol packages into upstream/downstream packages

master
Graham 2 years ago
parent 73defefef4
commit 4c309a0f50
  1. 2
      archive/src/main/kotlin/org/openrs2/archive/cache/NxtJs5ChannelHandler.kt
  2. 14
      archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelHandler.kt
  3. 6
      archive/src/main/kotlin/org/openrs2/archive/cache/OsrsJs5ChannelInitializer.kt
  4. 2
      game/src/main/kotlin/org/openrs2/game/cluster/Cluster.kt
  5. 2
      game/src/main/kotlin/org/openrs2/game/cluster/CountryList.kt
  6. 2
      game/src/main/kotlin/org/openrs2/game/cluster/SingleWorldCluster.kt
  7. 4
      game/src/main/kotlin/org/openrs2/game/net/Rs2ChannelInitializer.kt
  8. 2
      game/src/main/kotlin/org/openrs2/game/net/jaggrab/JaggrabChannelHandler.kt
  9. 4
      game/src/main/kotlin/org/openrs2/game/net/js5/Js5ChannelHandler.kt
  10. 2
      game/src/main/kotlin/org/openrs2/game/net/js5/Js5Client.kt
  11. 4
      game/src/main/kotlin/org/openrs2/game/net/js5/Js5Service.kt
  12. 18
      game/src/main/kotlin/org/openrs2/game/net/login/LoginChannelHandler.kt
  13. 28
      protocol/src/main/kotlin/org/openrs2/protocol/ProtocolModule.kt
  14. 2
      protocol/src/main/kotlin/org/openrs2/protocol/jaggrab/upstream/JaggrabRequest.kt
  15. 2
      protocol/src/main/kotlin/org/openrs2/protocol/jaggrab/upstream/JaggrabRequestDecoder.kt
  16. 2
      protocol/src/main/kotlin/org/openrs2/protocol/jaggrab/upstream/JaggrabRequestEncoder.kt
  17. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/downstream/Js5RemoteDownstream.kt
  18. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/downstream/Js5Response.kt
  19. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/downstream/Js5ResponseDecoder.kt
  20. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/downstream/Js5ResponseEncoder.kt
  21. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/downstream/XorDecoder.kt
  22. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/downstream/XorEncoder.kt
  23. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/downstream/XorExtensions.kt
  24. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/upstream/Js5Request.kt
  25. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/upstream/Js5RequestDecoder.kt
  26. 2
      protocol/src/main/kotlin/org/openrs2/protocol/js5/upstream/Js5RequestEncoder.kt
  27. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/downstream/ClientOutOfDateCodec.kt
  28. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/downstream/IpLimitCodec.kt
  29. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/downstream/Js5OkCodec.kt
  30. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/downstream/LoginDownstream.kt
  31. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/downstream/LoginResponse.kt
  32. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/downstream/ServerFullCodec.kt
  33. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/upstream/InitCrossDomainConnectionCodec.kt
  34. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/upstream/InitGameConnectionCodec.kt
  35. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/upstream/InitJaggrabConnectionCodec.kt
  36. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/upstream/InitJs5RemoteConnectionCodec.kt
  37. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/upstream/LoginRequest.kt
  38. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/upstream/LoginUpstream.kt
  39. 2
      protocol/src/main/kotlin/org/openrs2/protocol/login/upstream/RequestWorldListCodec.kt
  40. 2
      protocol/src/main/kotlin/org/openrs2/protocol/world/downstream/WorldListDownstream.kt
  41. 2
      protocol/src/main/kotlin/org/openrs2/protocol/world/downstream/WorldListResponse.kt
  42. 2
      protocol/src/main/kotlin/org/openrs2/protocol/world/downstream/WorldListResponseCodec.kt
  43. 2
      protocol/src/test/kotlin/org/openrs2/protocol/jaggrab/JaggrabRequestDecoderTest.kt
  44. 2
      protocol/src/test/kotlin/org/openrs2/protocol/jaggrab/JaggrabRequestEncoderTest.kt
  45. 2
      protocol/src/test/kotlin/org/openrs2/protocol/js5/Js5RequestDecoderTest.kt
  46. 2
      protocol/src/test/kotlin/org/openrs2/protocol/js5/Js5RequestEncoderTest.kt
  47. 2
      protocol/src/test/kotlin/org/openrs2/protocol/js5/Js5ResponseDecoderTest.kt
  48. 2
      protocol/src/test/kotlin/org/openrs2/protocol/js5/Js5ResponseEncoderTest.kt
  49. 1
      protocol/src/test/kotlin/org/openrs2/protocol/js5/XorDecoderTest.kt
  50. 1
      protocol/src/test/kotlin/org/openrs2/protocol/js5/XorEncoderTest.kt

@ -19,7 +19,7 @@ import org.openrs2.buffer.use
import org.openrs2.cache.MasterIndexFormat
import org.openrs2.protocol.Rs2Decoder
import org.openrs2.protocol.Rs2Encoder
import org.openrs2.protocol.js5.XorDecoder
import org.openrs2.protocol.js5.downstream.XorDecoder
import kotlin.coroutines.Continuation
public class NxtJs5ChannelHandler(

@ -6,13 +6,13 @@ import io.netty.channel.ChannelPipeline
import org.openrs2.cache.MasterIndexFormat
import org.openrs2.protocol.Rs2Decoder
import org.openrs2.protocol.Rs2Encoder
import org.openrs2.protocol.js5.Js5Request
import org.openrs2.protocol.js5.Js5RequestEncoder
import org.openrs2.protocol.js5.Js5Response
import org.openrs2.protocol.js5.Js5ResponseDecoder
import org.openrs2.protocol.js5.XorDecoder
import org.openrs2.protocol.login.LoginRequest
import org.openrs2.protocol.login.LoginResponse
import org.openrs2.protocol.js5.downstream.Js5Response
import org.openrs2.protocol.js5.downstream.Js5ResponseDecoder
import org.openrs2.protocol.js5.downstream.XorDecoder
import org.openrs2.protocol.js5.upstream.Js5Request
import org.openrs2.protocol.js5.upstream.Js5RequestEncoder
import org.openrs2.protocol.login.downstream.LoginResponse
import org.openrs2.protocol.login.upstream.LoginRequest
import kotlin.coroutines.Continuation
public class OsrsJs5ChannelHandler(

@ -6,9 +6,9 @@ import io.netty.handler.timeout.ReadTimeoutHandler
import org.openrs2.protocol.Protocol
import org.openrs2.protocol.Rs2Decoder
import org.openrs2.protocol.Rs2Encoder
import org.openrs2.protocol.login.ClientOutOfDateCodec
import org.openrs2.protocol.login.InitJs5RemoteConnectionCodec
import org.openrs2.protocol.login.Js5OkCodec
import org.openrs2.protocol.login.downstream.ClientOutOfDateCodec
import org.openrs2.protocol.login.downstream.Js5OkCodec
import org.openrs2.protocol.login.upstream.InitJs5RemoteConnectionCodec
public class OsrsJs5ChannelInitializer(private val handler: OsrsJs5ChannelHandler) : ChannelInitializer<Channel>() {
override fun initChannel(ch: Channel) {

@ -1,6 +1,6 @@
package org.openrs2.game.cluster
import org.openrs2.protocol.world.WorldListResponse
import org.openrs2.protocol.world.downstream.WorldListResponse
import java.util.SortedMap
public interface Cluster {

@ -2,7 +2,7 @@ package org.openrs2.game.cluster
import org.openrs2.cache.config.enum.EnumTypeList
import org.openrs2.conf.CountryCode
import org.openrs2.protocol.world.WorldListResponse
import org.openrs2.protocol.world.downstream.WorldListResponse
import javax.inject.Inject
import javax.inject.Singleton

@ -1,7 +1,7 @@
package org.openrs2.game.cluster
import org.openrs2.conf.Config
import org.openrs2.protocol.world.WorldListResponse
import org.openrs2.protocol.world.downstream.WorldListResponse
import java.util.SortedMap
import javax.inject.Inject
import javax.inject.Singleton

@ -7,8 +7,8 @@ import org.openrs2.game.net.login.LoginChannelHandler
import org.openrs2.protocol.Protocol
import org.openrs2.protocol.Rs2Decoder
import org.openrs2.protocol.Rs2Encoder
import org.openrs2.protocol.login.LoginDownstream
import org.openrs2.protocol.login.LoginUpstream
import org.openrs2.protocol.login.downstream.LoginDownstream
import org.openrs2.protocol.login.upstream.LoginUpstream
import java.util.concurrent.TimeUnit
import javax.inject.Inject
import javax.inject.Provider

@ -7,7 +7,7 @@ import io.netty.channel.SimpleChannelInboundHandler
import io.netty.handler.timeout.IdleStateEvent
import org.openrs2.buffer.use
import org.openrs2.game.net.FileProvider
import org.openrs2.protocol.jaggrab.JaggrabRequest
import org.openrs2.protocol.jaggrab.upstream.JaggrabRequest
import javax.inject.Inject
import javax.inject.Singleton

@ -3,8 +3,8 @@ package org.openrs2.game.net.js5
import io.netty.channel.ChannelHandlerContext
import io.netty.channel.SimpleChannelInboundHandler
import io.netty.handler.timeout.IdleStateEvent
import org.openrs2.protocol.js5.Js5Request
import org.openrs2.protocol.js5.XorEncoder
import org.openrs2.protocol.js5.downstream.XorEncoder
import org.openrs2.protocol.js5.upstream.Js5Request
import javax.inject.Inject
public class Js5ChannelHandler @Inject constructor(

@ -1,7 +1,7 @@
package org.openrs2.game.net.js5
import io.netty.channel.ChannelHandlerContext
import org.openrs2.protocol.js5.Js5Request
import org.openrs2.protocol.js5.upstream.Js5Request
public class Js5Client(
public val ctx: ChannelHandlerContext

@ -9,8 +9,8 @@ import org.openrs2.cache.Js5CompressionType
import org.openrs2.cache.Js5MasterIndex
import org.openrs2.cache.Store
import org.openrs2.cache.VersionTrailer
import org.openrs2.protocol.js5.Js5Request
import org.openrs2.protocol.js5.Js5Response
import org.openrs2.protocol.js5.downstream.Js5Response
import org.openrs2.protocol.js5.upstream.Js5Request
import org.openrs2.util.collect.UniqueQueue
import java.io.FileNotFoundException
import javax.inject.Inject

@ -19,15 +19,15 @@ import org.openrs2.game.net.js5.Js5ChannelHandler
import org.openrs2.protocol.Protocol
import org.openrs2.protocol.Rs2Decoder
import org.openrs2.protocol.Rs2Encoder
import org.openrs2.protocol.jaggrab.JaggrabRequestDecoder
import org.openrs2.protocol.js5.Js5RemoteDownstream
import org.openrs2.protocol.js5.Js5RequestDecoder
import org.openrs2.protocol.js5.Js5ResponseEncoder
import org.openrs2.protocol.js5.XorDecoder
import org.openrs2.protocol.login.LoginRequest
import org.openrs2.protocol.login.LoginResponse
import org.openrs2.protocol.world.WorldListDownstream
import org.openrs2.protocol.world.WorldListResponse
import org.openrs2.protocol.jaggrab.upstream.JaggrabRequestDecoder
import org.openrs2.protocol.js5.downstream.Js5RemoteDownstream
import org.openrs2.protocol.js5.downstream.Js5ResponseEncoder
import org.openrs2.protocol.js5.downstream.XorDecoder
import org.openrs2.protocol.js5.upstream.Js5RequestDecoder
import org.openrs2.protocol.login.downstream.LoginResponse
import org.openrs2.protocol.login.upstream.LoginRequest
import org.openrs2.protocol.world.downstream.WorldListDownstream
import org.openrs2.protocol.world.downstream.WorldListResponse
import javax.inject.Inject
import javax.inject.Provider

@ -6,20 +6,20 @@ import com.google.inject.TypeLiteral
import com.google.inject.multibindings.Multibinder
import org.openrs2.buffer.BufferModule
import org.openrs2.crypto.CryptoModule
import org.openrs2.protocol.js5.Js5RemoteDownstream
import org.openrs2.protocol.login.ClientOutOfDateCodec
import org.openrs2.protocol.login.InitCrossDomainConnectionCodec
import org.openrs2.protocol.login.InitGameConnectionCodec
import org.openrs2.protocol.login.InitJaggrabConnectionCodec
import org.openrs2.protocol.login.InitJs5RemoteConnectionCodec
import org.openrs2.protocol.login.IpLimitCodec
import org.openrs2.protocol.login.Js5OkCodec
import org.openrs2.protocol.login.LoginDownstream
import org.openrs2.protocol.login.LoginUpstream
import org.openrs2.protocol.login.RequestWorldListCodec
import org.openrs2.protocol.login.ServerFullCodec
import org.openrs2.protocol.world.WorldListDownstream
import org.openrs2.protocol.world.WorldListResponseCodec
import org.openrs2.protocol.js5.downstream.Js5RemoteDownstream
import org.openrs2.protocol.login.downstream.ClientOutOfDateCodec
import org.openrs2.protocol.login.downstream.IpLimitCodec
import org.openrs2.protocol.login.downstream.Js5OkCodec
import org.openrs2.protocol.login.downstream.LoginDownstream
import org.openrs2.protocol.login.downstream.ServerFullCodec
import org.openrs2.protocol.login.upstream.InitCrossDomainConnectionCodec
import org.openrs2.protocol.login.upstream.InitGameConnectionCodec
import org.openrs2.protocol.login.upstream.InitJaggrabConnectionCodec
import org.openrs2.protocol.login.upstream.InitJs5RemoteConnectionCodec
import org.openrs2.protocol.login.upstream.LoginUpstream
import org.openrs2.protocol.login.upstream.RequestWorldListCodec
import org.openrs2.protocol.world.downstream.WorldListDownstream
import org.openrs2.protocol.world.downstream.WorldListResponseCodec
public object ProtocolModule : AbstractModule() {
public override fun configure() {

@ -1,3 +1,3 @@
package org.openrs2.protocol.jaggrab
package org.openrs2.protocol.jaggrab.upstream
public data class JaggrabRequest(public val path: String)

@ -1,4 +1,4 @@
package org.openrs2.protocol.jaggrab
package org.openrs2.protocol.jaggrab.upstream
import io.netty.channel.ChannelHandler
import io.netty.channel.ChannelHandlerContext

@ -1,4 +1,4 @@
package org.openrs2.protocol.jaggrab
package org.openrs2.protocol.jaggrab.upstream
import io.netty.channel.ChannelHandler
import io.netty.channel.ChannelHandlerContext

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.downstream
import javax.inject.Qualifier

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.downstream
import io.netty.buffer.ByteBuf
import io.netty.buffer.DefaultByteBufHolder

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.downstream
import io.netty.buffer.ByteBuf
import io.netty.buffer.Unpooled

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.downstream
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandler

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.downstream
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.downstream
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.downstream
import io.netty.buffer.ByteBuf

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.upstream
public sealed class Js5Request {
public data class Group(

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.upstream
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext

@ -1,4 +1,4 @@
package org.openrs2.protocol.js5
package org.openrs2.protocol.js5.upstream
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandler

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.downstream
import org.openrs2.protocol.EmptyPacketCodec
import javax.inject.Singleton

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.downstream
import org.openrs2.protocol.EmptyPacketCodec
import javax.inject.Singleton

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.downstream
import org.openrs2.protocol.EmptyPacketCodec
import javax.inject.Singleton

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.downstream
import javax.inject.Qualifier

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.downstream
import org.openrs2.protocol.Packet

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.downstream
import org.openrs2.protocol.EmptyPacketCodec
import javax.inject.Singleton

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.upstream
import org.openrs2.protocol.EmptyPacketCodec
import javax.inject.Singleton

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.upstream
import io.netty.buffer.ByteBuf
import org.openrs2.crypto.StreamCipher

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.upstream
import org.openrs2.protocol.EmptyPacketCodec
import javax.inject.Singleton

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.upstream
import io.netty.buffer.ByteBuf
import org.openrs2.crypto.StreamCipher

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.upstream
import org.openrs2.protocol.Packet

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.upstream
import javax.inject.Qualifier

@ -1,4 +1,4 @@
package org.openrs2.protocol.login
package org.openrs2.protocol.login.upstream
import io.netty.buffer.ByteBuf
import org.openrs2.crypto.StreamCipher

@ -1,4 +1,4 @@
package org.openrs2.protocol.world
package org.openrs2.protocol.world.downstream
import javax.inject.Qualifier

@ -1,4 +1,4 @@
package org.openrs2.protocol.world
package org.openrs2.protocol.world.downstream
import org.openrs2.protocol.Packet
import java.util.SortedMap

@ -1,4 +1,4 @@
package org.openrs2.protocol.world
package org.openrs2.protocol.world.downstream
import io.netty.buffer.ByteBuf
import org.openrs2.buffer.readUnsignedShortSmart

@ -2,6 +2,8 @@ package org.openrs2.protocol.jaggrab
import io.netty.channel.embedded.EmbeddedChannel
import io.netty.handler.codec.DecoderException
import org.openrs2.protocol.jaggrab.upstream.JaggrabRequest
import org.openrs2.protocol.jaggrab.upstream.JaggrabRequestDecoder
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

@ -1,6 +1,8 @@
package org.openrs2.protocol.jaggrab
import io.netty.channel.embedded.EmbeddedChannel
import org.openrs2.protocol.jaggrab.upstream.JaggrabRequest
import org.openrs2.protocol.jaggrab.upstream.JaggrabRequestEncoder
import kotlin.test.Test
import kotlin.test.assertEquals

@ -4,6 +4,8 @@ import io.netty.buffer.Unpooled
import io.netty.channel.embedded.EmbeddedChannel
import io.netty.handler.codec.DecoderException
import org.openrs2.buffer.wrappedBuffer
import org.openrs2.protocol.js5.upstream.Js5Request
import org.openrs2.protocol.js5.upstream.Js5RequestDecoder
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

@ -4,6 +4,8 @@ import io.netty.buffer.ByteBuf
import io.netty.buffer.Unpooled
import io.netty.channel.embedded.EmbeddedChannel
import org.openrs2.buffer.use
import org.openrs2.protocol.js5.upstream.Js5Request
import org.openrs2.protocol.js5.upstream.Js5RequestEncoder
import kotlin.test.Test
import kotlin.test.assertEquals

@ -7,6 +7,8 @@ import io.netty.channel.embedded.EmbeddedChannel
import io.netty.handler.codec.DecoderException
import org.openrs2.buffer.use
import org.openrs2.buffer.wrappedBuffer
import org.openrs2.protocol.js5.downstream.Js5Response
import org.openrs2.protocol.js5.downstream.Js5ResponseDecoder
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

@ -6,6 +6,8 @@ import io.netty.buffer.Unpooled
import io.netty.channel.embedded.EmbeddedChannel
import io.netty.handler.codec.EncoderException
import org.openrs2.buffer.use
import org.openrs2.protocol.js5.downstream.Js5Response
import org.openrs2.protocol.js5.downstream.Js5ResponseEncoder
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

@ -5,6 +5,7 @@ import io.netty.buffer.PooledByteBufAllocator
import io.netty.channel.embedded.EmbeddedChannel
import org.openrs2.buffer.copiedBuffer
import org.openrs2.buffer.use
import org.openrs2.protocol.js5.downstream.XorDecoder
import kotlin.test.Test
import kotlin.test.assertEquals

@ -5,6 +5,7 @@ import io.netty.buffer.PooledByteBufAllocator
import io.netty.channel.embedded.EmbeddedChannel
import org.openrs2.buffer.copiedBuffer
import org.openrs2.buffer.use
import org.openrs2.protocol.js5.downstream.XorEncoder
import kotlin.test.Test
import kotlin.test.assertEquals

Loading…
Cancel
Save