Skip to content

Commit

Permalink
refactor: move StreamDirection to a shared module
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-Kris committed Jul 31, 2024
1 parent 22ef0c1 commit 796905a
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import net.rsprox.proxy.plugin.PluginLoader
import net.rsprox.proxy.transcriber.LiveTranscriberSession
import net.rsprox.proxy.util.NopSessionMonitor
import net.rsprox.shared.SessionMonitor
import net.rsprox.shared.StreamDirection
import net.rsprox.transcriber.BaseMessageConsumerContainer
import net.rsprox.transcriber.MessageConsumer
import java.net.URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package net.rsprox.proxy.binary

import io.netty.buffer.ByteBuf
import net.rsprot.protocol.Prot
import net.rsprox.shared.StreamDirection

public data class BinaryPacket(
public val epochTimeMillis: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import net.rsprot.buffer.extensions.pdata
import net.rsprot.protocol.ClientProt
import net.rsprot.protocol.Prot
import net.rsprox.protocol.ProtProvider
import net.rsprox.shared.StreamDirection
import kotlin.math.max
import kotlin.math.min

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import com.github.ajalt.clikt.parameters.options.option
import net.rsprox.cache.Js5MasterIndex
import net.rsprox.cache.resolver.HistoricCacheResolver
import net.rsprox.proxy.binary.BinaryBlob
import net.rsprox.proxy.binary.StreamDirection
import net.rsprox.proxy.cache.StatefulCacheProvider
import net.rsprox.proxy.config.BINARY_PATH
import net.rsprox.proxy.huffman.HuffmanProvider
import net.rsprox.proxy.plugin.DecodingSession
import net.rsprox.proxy.plugin.PluginLoader
import net.rsprox.shared.StreamDirection
import java.nio.file.Path
import kotlin.io.path.bufferedWriter
import kotlin.io.path.exists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import com.github.michaelbull.logging.InlineLogger
import net.rsprox.cache.Js5MasterIndex
import net.rsprox.cache.resolver.HistoricCacheResolver
import net.rsprox.proxy.binary.BinaryBlob
import net.rsprox.proxy.binary.StreamDirection
import net.rsprox.proxy.cache.StatefulCacheProvider
import net.rsprox.proxy.config.BINARY_PATH
import net.rsprox.proxy.huffman.HuffmanProvider
import net.rsprox.proxy.plugin.DecodingSession
import net.rsprox.proxy.plugin.PluginLoader
import net.rsprox.proxy.util.NopSessionMonitor
import net.rsprox.shared.StreamDirection
import net.rsprox.shared.property.PropertyTreeFormatter
import net.rsprox.shared.property.RootProperty
import net.rsprox.transcriber.BaseMessageConsumerContainer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import net.rsprot.buffer.extensions.p4
import net.rsprot.buffer.extensions.toJagByteBuf
import net.rsprox.protocol.game.incoming.decoder.prot.GameClientProt
import net.rsprox.proxy.attributes.INCOMING_BANK_PIN
import net.rsprox.proxy.binary.StreamDirection
import net.rsprox.proxy.channel.getBinaryBlob
import net.rsprox.shared.StreamDirection

public class ClientGameHandler(
private val serverChannel: Channel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import net.rsprox.protocol.session.AttributeMap
import net.rsprox.protocol.session.Session
import net.rsprox.proxy.binary.BinaryBlob
import net.rsprox.proxy.binary.BinaryStream
import net.rsprox.proxy.binary.StreamDirection
import net.rsprox.shared.StreamDirection

public class DecodingSession(
private val blob: BinaryBlob,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package net.rsprox.proxy.plugin

import net.rsprot.protocol.Prot
import net.rsprot.protocol.message.IncomingMessage
import net.rsprox.proxy.binary.StreamDirection
import net.rsprox.shared.StreamDirection

public data class DirectionalPacket(
public val direction: StreamDirection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import net.rsprot.protocol.util.CombinedId
import net.rsprot.protocol.util.gCombinedId
import net.rsprox.protocol.game.outgoing.decoder.prot.GameServerProt
import net.rsprox.proxy.attributes.INCOMING_BANK_PIN
import net.rsprox.proxy.binary.StreamDirection
import net.rsprox.proxy.channel.getBinaryBlob
import net.rsprox.proxy.channel.getServerToClientStreamCipher
import net.rsprox.proxy.huffman.HuffmanProvider
import net.rsprox.proxy.worlds.WorldListProvider
import net.rsprox.shared.StreamDirection

public class ServerGameHandler(
private val clientChannel: Channel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import io.netty.buffer.ByteBuf
import net.rsprot.buffer.extensions.toByteArray
import net.rsprox.protocol.exceptions.DecodeError
import net.rsprox.protocol.session.Session
import net.rsprox.proxy.binary.StreamDirection
import net.rsprox.proxy.plugin.DecodingSession
import net.rsprox.shared.StreamDirection
import net.rsprox.transcriber.TranscriberRunner
import java.util.Queue
import java.util.concurrent.ConcurrentLinkedQueue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.rsprox.proxy.binary
package net.rsprox.shared

public enum class StreamDirection {
CLIENT_TO_SERVER,
Expand Down

0 comments on commit 796905a

Please sign in to comment.