Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45e3ced
commit 35f314b
Showing
7 changed files
with
115 additions
and
120 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
plugins { | ||
application | ||
java | ||
kotlin("jvm") version "1.9.20" | ||
} | ||
|
||
group = "gg.beemo.vanilla" | ||
version = "1.0.0" | ||
|
||
dependencies { | ||
// Kotlin | ||
val kotlinCoroutinesVersion = "1.7.3" | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion") | ||
|
||
// Beemo shared code | ||
implementation("gg.beemo.latte:latte") | ||
|
||
// Logging | ||
val log4jVersion = "2.22.0" | ||
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion") | ||
implementation("org.apache.logging.log4j:log4j-core:$log4jVersion") | ||
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:$log4jVersion") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(17) | ||
} | ||
|
||
application { | ||
mainClass.set("gg.beemo.vanilla.Vanilla") | ||
applicationDefaultJvmArgs = listOf( | ||
"-XX:+AlwaysPreTouch", | ||
"-XX:+PerfDisableSharedMem", | ||
"-XX:+UseG1GC", | ||
"-XX:-OmitStackTraceInFastThrow", | ||
"-XX:MaxRAMPercentage=80", | ||
"-XX:MinRAMPercentage=80", | ||
) | ||
} | ||
|
||
// Like `installDist`, but with a stable main jar file name for local development | ||
tasks.register("installDev") { | ||
tasks.jar.get().apply { | ||
archiveFileName.set("vanilla.jar") | ||
manifest { | ||
attributes["Main-Class"] = application.mainClass.get() | ||
attributes["Class-Path"] = configurations.runtimeClasspath.get().files.joinToString(" ") { it.name } | ||
} | ||
} | ||
dependsOn("installDist") | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
includeBuild("../latte") | ||
|
||
rootProject.name = "vanilla" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package gg.beemo.vanilla | ||
|
||
import gg.beemo.latte.CommonConfig | ||
import gg.beemo.latte.broker.kafka.KafkaConnection | ||
import gg.beemo.latte.config.Configurator | ||
import gg.beemo.latte.logging.Log | ||
import kotlinx.coroutines.runBlocking | ||
|
||
object Vanilla { | ||
|
||
private val log by Log | ||
|
||
@JvmStatic | ||
fun main(args: Array<String>) = runBlocking { | ||
log.debug("Loading configuration") | ||
Configurator.create().mirror(Config::class.java) | ||
|
||
log.debug("Initializing Kafka connection") | ||
val brokerConnection = KafkaConnection( | ||
Config.KAFKA_HOST, | ||
CommonConfig.BrokerServices.VANILLA, | ||
"0", | ||
Config.KAFKA_USE_TLS, | ||
) | ||
|
||
log.debug("Initializing Kafka Ratelimit client") | ||
RatelimitClient(brokerConnection) | ||
|
||
log.debug("Starting Kafka connection") | ||
brokerConnection.start() | ||
|
||
log.info("Initialization done! Listening for ratelimit requests.") | ||
} | ||
|
||
} |