Initial Commit
This commit is contained in:
2
src/main/kotlin/de/chaoscaot/replay/Main.kt
Normal file
2
src/main/kotlin/de/chaoscaot/replay/Main.kt
Normal file
@ -0,0 +1,2 @@
|
||||
package de.chaoscaot.replay
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package de.chaoscaot.replay.commands
|
||||
|
||||
object ExtractSchematics {
|
||||
}
|
||||
4
src/main/kotlin/de/chaoscaot/replay/commands/Info.kt
Normal file
4
src/main/kotlin/de/chaoscaot/replay/commands/Info.kt
Normal file
@ -0,0 +1,4 @@
|
||||
package de.chaoscaot.replay.commands
|
||||
|
||||
object Info {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package de.chaoscaot.replay.commands
|
||||
|
||||
class ListPackets {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package de.chaoscaot.replay.parser
|
||||
|
||||
class EmbeddedSchematic {
|
||||
}
|
||||
3
src/main/kotlin/de/chaoscaot/replay/parser/Message.kt
Normal file
3
src/main/kotlin/de/chaoscaot/replay/parser/Message.kt
Normal file
@ -0,0 +1,3 @@
|
||||
package de.chaoscaot.replay.parser
|
||||
|
||||
data class Message()
|
||||
18
src/main/kotlin/de/chaoscaot/replay/parser/PacketReader.kt
Normal file
18
src/main/kotlin/de/chaoscaot/replay/parser/PacketReader.kt
Normal file
@ -0,0 +1,18 @@
|
||||
package de.chaoscaot.replay.parser.packets
|
||||
|
||||
import java.io.DataInputStream
|
||||
|
||||
abstract class Packet(val type: PacketType)
|
||||
|
||||
interface PacketReader<T> {
|
||||
fun readPacket(stream: DataInputStream): T
|
||||
|
||||
companion object {
|
||||
fun readPacket(type: Byte, stream: DataInputStream): Packet =
|
||||
PacketType.entries.find { it.id == type }?.reader?.readPacket(stream) ?: throw IllegalArgumentException("Unknown Packet")
|
||||
}
|
||||
}
|
||||
|
||||
enum class PacketType(val id: Byte, val reader: PacketReader<out Packet>) {
|
||||
PLAYER_JOIN_PACKET(0x00, UserJoinPacketReader),
|
||||
}
|
||||
2
src/main/kotlin/de/chaoscaot/replay/parser/Packets.kt
Normal file
2
src/main/kotlin/de/chaoscaot/replay/parser/Packets.kt
Normal file
@ -0,0 +1,2 @@
|
||||
package de.chaoscaot.replay.parser
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package de.chaoscaot.replay.parser
|
||||
|
||||
object ReplayParser {
|
||||
}
|
||||
Reference in New Issue
Block a user