Archived
1
0
Fork 0

Move packets to their own project

This commit is contained in:
Moritz Ruth 2020-09-09 23:09:44 +02:00
parent b021a4b753
commit 0689944d77
23 changed files with 27 additions and 6 deletions

View file

@ -1,5 +1,4 @@
# Blokk # Blokk
## To Do ## To Do
- Move packets to their own project
- Stop Using Spek - Stop Using Spek
- Support packet compression - Support packet compression

View file

@ -12,7 +12,7 @@ repositories {
val nettyVersion = properties["version.netty"].toString() val nettyVersion = properties["version.netty"].toString()
dependencies { dependencies {
api(project(":blokk-api")) api(project(":blokk-packets"))
// Netty // Netty
api("io.netty:netty-buffer:${nettyVersion}") api("io.netty:netty-buffer:${nettyVersion}")

View file

@ -0,0 +1,20 @@
plugins {
kotlin("jvm")
}
group = rootProject.group
version = rootProject.version
repositories {
mavenCentral()
}
dependencies {
api(project(":blokk-api"))
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}

View file

@ -4,15 +4,13 @@ import space.blokk.net.packets.IncomingPacket
/** /**
* This is the first packet a client should send. Per default, the server immediately switches * This is the first packet a client should send. Per default, the server immediately switches
* the [session's currentProtocol][space.blokk.net.Session.currentProtocol] to * the [session's currentProtocol][space.blokk.net.Session.currentProtocol] to `STATUS` or `LOGIN`,
* `STATUS` or `LOGIN`,
* depending on the value of [loginAttempt]. * depending on the value of [loginAttempt].
* *
* @param protocolVersion The number of the [protocol version](https://wiki.vg/Protocol_version_numbers) used by the client. * @param protocolVersion The number of the [protocol version](https://wiki.vg/Protocol_version_numbers) used by the client.
* @param serverAddress Hostname or IP address that was used to connect. * @param serverAddress Hostname or IP address that was used to connect.
* @param serverPort Port that was used to connect. * @param serverPort Port that was used to connect.
* @param loginAttempt Whether the server should use the `STATUS` or * @param loginAttempt Whether the server should use the `STATUS` or the `LOGIN` protocol from now on.
* the `LOGIN` protocol from now on.
*/ */
data class HandshakePacket( data class HandshakePacket(
val protocolVersion: Int, val protocolVersion: Int,

View file

@ -1,5 +1,6 @@
plugins { plugins {
kotlin("jvm") kotlin("jvm")
kotlin("kapt")
id("com.github.johnrengelman.shadow") version "6.0.0" id("com.github.johnrengelman.shadow") version "6.0.0"
} }
@ -23,6 +24,7 @@ dependencies {
// Blokk // Blokk
implementation(project(":blokk-api")) implementation(project(":blokk-api"))
implementation(project(":blokk-packets"))
implementation(project(":blokk-packet-codecs")) implementation(project(":blokk-packet-codecs"))
// Logging // Logging
@ -42,6 +44,7 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp:4.8.1") implementation("com.squareup.okhttp3:okhttp:4.8.1")
implementation("com.sksamuel.hoplite:hoplite-core:1.3.3") implementation("com.sksamuel.hoplite:hoplite-core:1.3.3")
implementation("com.sksamuel.hoplite:hoplite-yaml:1.3.3") implementation("com.sksamuel.hoplite:hoplite-yaml:1.3.3")
kapt("com.squareup.moshi:moshi-kotlin-codegen:${moshiVersion}")
} }
tasks { tasks {

View file

@ -9,4 +9,5 @@ rootProject.name = "blokk"
include(":blokk-api") include(":blokk-api")
include(":blokk-server") include(":blokk-server")
include(":blokk-packets")
include(":blokk-packet-codecs") include(":blokk-packet-codecs")