Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
075b5a1
feat(build): add multi-proxy support for load balancing and scalability
twisti-dev May 18, 2025
b35281a
refactor(config): remove unused JPA and Hibernate configurations for …
twisti-dev May 18, 2025
e5232fc
feat(sync): add network synchronizing phase and sync registry
twisti-dev Jun 8, 2025
a5b71ca
feat(sync): enhance synchronization process with connection protocol …
twisti-dev Jun 8, 2025
77a9da8
feat(spark): implement Spark command and related functionality for se…
twisti-dev Jun 9, 2025
4622569
feat(punishment): implement service for managing player punishments w…
twisti-dev Jun 11, 2025
845e1e8
refactor(aspect): remove redundant initialization logging from Corout…
twisti-dev Jun 11, 2025
5c26cfa
feat(sync): register BasicSyncValue in CommonSyncRegistry during init…
twisti-dev Jun 11, 2025
fdd73db
refactor(sync): replace objectListOf with mutableObjectListOf for unk…
twisti-dev Jun 11, 2025
0cc16b0
refactor(event): enhance GeneratedInvoker with owner field and access…
twisti-dev Jun 11, 2025
17ee47c
feat(event): add infrastructure role to CloudEventListenerBeanPostPro…
twisti-dev Jun 11, 2025
cd81c6f
feat(proxy): implement multi-proxy support for load balancing and sca…
twisti-dev Jun 16, 2025
f921fa0
feat(nbt): migrate from querz.nbt to kyori.adventure.nbt for binary t…
twisti-dev Jun 22, 2025
b88c0d9
feat(proxy): add support for dynamic velocity secret management
twisti-dev Jun 22, 2025
b3ad3e9
refactor(player): update PersistentPlayerDataContainerImpl usage and …
twisti-dev Jun 24, 2025
ad24158
feat(player): refactor PrePlayerJoinTask interface and implement auto…
twisti-dev Jun 24, 2025
55feb24
feat(config): add proxy.secret.manual-secret to the list of sensitive…
twisti-dev Jul 2, 2025
8f02d24
refactor(api): remove unnecessary newline in InternalApi annotation
twisti-dev Jul 2, 2025
da39cd1
feat(proxy): refactor PrePlayerJoinTaskManager to use object instead …
twisti-dev Jul 2, 2025
aa23462
feat(observer): implement ObservableField and related utilities for v…
twisti-dev Jul 4, 2025
5118aad
refactor(bukkit): rename classes and update configurations to align w…
twisti-dev Jul 19, 2025
70d4127
feat(netty): handle NotSslRecordException in exceptionCaught to close…
twisti-dev Jul 20, 2025
bec148d
refactor(api): replace CHORUS_FRUIT with CONSUMABLE_EFFECT in Telepor…
twisti-dev Jul 20, 2025
4736842
chore(dependencies): update Gradle wrapper, plugins, and dependencies…
twisti-dev Jul 20, 2025
e355b69
refactor(server): replace `address` with `playAddress` to improve nam…
twisti-dev Jul 20, 2025
29060b2
refactor(server): replace custom synchronization primitives with thre…
twisti-dev Jul 20, 2025
21640aa
refactor(netty): simplify Velocity secret handling and optimize Bukki…
twisti-dev Jul 22, 2025
7e21cc4
refactor(task-manager): replace OrderComparator with AnnotationAwareO…
twisti-dev Jul 22, 2025
5ff5fd9
refactor(message-manager): correct German translation for server avai…
twisti-dev Jul 22, 2025
e8bc3e9
refactor(velocity): replace println with structured logging for serve…
twisti-dev Jul 22, 2025
39c6f6d
refactor(sync-registry): synchronize lastChangeIds for thread safety
twisti-dev Jul 22, 2025
7bf7042
Merge remote-tracking branch 'origin/master' into 11-multi-proxy-supp…
twisti-dev Jul 22, 2025
82d3ed1
Fix incorrect usage of packet.id in SyncRegistryImpl.kt
twisti-dev Jul 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 17 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,39 @@ buildscript {
maven("https://repo.slne.dev/repository/maven-public/") { name = "maven-public" }
}
dependencies {
classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.4+")
classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.7+")
}
}

plugins {
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.17.0"
id("io.freefair.aspectj.post-compile-weaving") version "8.13.1"
// id("io.freefair.aspectj.post-compile-weaving") version "8.13.1"
java
}

allprojects {
apply(plugin = "java")
apply(plugin = "io.freefair.aspectj.post-compile-weaving")
group = "dev.slne.surf.cloud"
version = findProperty("version") as String

repositories {
slnePublic()
}

if (name == "surf-cloud-bom") {
return@allprojects
}

apply(plugin = "java")
// apply(plugin = "io.freefair.aspectj.post-compile-weaving")

dependencies {
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.4.4"))
implementation(platform("io.ktor:ktor-bom:3.0.3"))
implementation(platform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:2025.4.10"))
// implementation(platform("org.springframework.boot:spring-boot-dependencies:3.4.4"))
// implementation(platform("io.ktor:ktor-bom:3.0.3"))
// implementation(platform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:2025.4.10"))

implementation(platform(project(":surf-cloud-bom")))

compileOnly("org.springframework.boot:spring-boot-configuration-processor:3.4.3")
compileOnly("org.springframework.boot:spring-boot-configuration-processor:3.5.3")
// "kapt"("org.springframework.boot:spring-boot-configuration-processor:3.4.3")
}

Expand All @@ -47,8 +54,6 @@ allprojects {
options.tags("implNote:a:Implementation Note:")
}
}

setupPublishing()
}

apiValidation {
Expand All @@ -69,23 +74,14 @@ apiValidation {

private fun TaskContainerScope.configureShadowJar() = withType<ShadowJar> {
mergeServiceFiles {
setPath("META-INF")
path = "META-INF"
exclude("META-INF/MANIFEST.MF")
}

isZip64 = true
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

private fun TaskContainerScope.configureJar() = withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

private fun setupPublishing() = afterEvaluate {
if (plugins.hasPlugin(PublishingPlugin::class)) {
configure<PublishingExtension> {
repositories {
slnePublic()
}
}
}
}
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
// val kotlinVersion = "2.1.0"
// val dokkaVersion = "2.0.0-Beta"

implementation("org.springframework.boot:org.springframework.boot.gradle.plugin:3.4.4")
implementation("org.springframework.boot:org.springframework.boot.gradle.plugin:3.5.3")
// implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
// implementation("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion")
// implementation("org.jetbrains.kotlin:kotlin-lombok:$kotlinVersion")
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/core-convention.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ repositories {
}

dependencies {
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.4.3"))
implementation(platform("io.ktor:ktor-bom:3.0.3"))
implementation(platform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:2025.2.2"))
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.5.3"))
implementation(platform("io.ktor:ktor-bom:3.2.1"))
implementation(platform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:2025.7.8"))


compileOnly("org.springframework.boot:spring-boot-configuration-processor:3.4.3")
compileOnly("org.springframework.boot:spring-boot-configuration-processor:3.5.3")
// "kapt"("org.springframework.boot:spring-boot-configuration-processor:3.4.3")
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kotlin.stdlib.default.dependency=false
kotlin.code.style=official
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
version=1.21.1-1.0.0-SNAPSHOT
version=1.21.7-1.0.0-SNAPSHOT
16 changes: 4 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
[versions]
velocity-version = "3.4.0-SNAPSHOT"
aide-reflection = "1.3"
netty = "4.2.0.Final"
netty-tcnative = "2.0.70.Final"
nbt = "6.1"
netty = "4.2.2.Final"
netty-tcnative = "2.0.72.Final"
datafixerupper = "8.0.16"
#byte-buddy = "1.15.10"
exposed = "0.61.0"
maven-impl = "4.0.0-rc-2"
maven-resolver = "2.0.5"
jline = "3.29.0"
jline = "3.30.4"
brigadier = "1.3.10"
terminalconsoleappender = "1.3.0"
bson-kotlinx = "5.4.0"
aspectjweaver = "1.9.22.1"
zstd-jni = "1.5.7-2"
zstd-jni = "1.5.7-4"
luckperms-api = "5.4"
reactive-streams = "1.0.4"
ehcache = "3.10.8"
Expand All @@ -34,11 +33,8 @@ jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-
aide-reflection = { module = "tech.hiddenproject:aide-reflection", version.ref = "aide-reflection" }
netty-all = { module = "io.netty:netty-all", version.ref = "netty" }
netty-tcnative = { module = "io.netty:netty-tcnative", version.ref = "netty-tcnative" }
nbt = { module = "com.github.Querz:NBT", version.ref = "nbt" }
spring-data-jpa = { module = "org.springframework.data:spring-data-jpa" }
datafixerupper = { module = "com.mojang:datafixerupper", version.ref = "datafixerupper" }
byte-buddy = { module = "net.bytebuddy:byte-buddy" }
jakarta-persistence-api = { module = "jakarta.persistence:jakarta.persistence-api" }
exposed-spring-boot-starter = { module = "org.jetbrains.exposed:exposed-spring-boot-starter", version.ref = "exposed" }
exposed-java-time = { module = "org.jetbrains.exposed:exposed-java-time", version.ref = "exposed" }
exposed-migration = { module = "org.jetbrains.exposed:exposed-migration", version.ref = "exposed" }
Expand All @@ -63,11 +59,8 @@ zstd-jni = { module = "com.github.luben:zstd-jni", version.ref = "zstd-jni" }
luckperms-api = { module = "net.luckperms:api", version.ref = "luckperms-api" }
mariadb-java-client = { module = "org.mariadb.jdbc:mariadb-java-client" }
mysql-connector-j = { module = "com.mysql:mysql-connector-j" }
spring-boot-starter-data-jpa = { module = "org.springframework.boot:spring-boot-starter-data-jpa" }
spring-boot-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator" }
reactive-streams = { module = "org.reactivestreams:reactive-streams", version.ref = "reactive-streams" }
hibernate-jcache = { module = "org.hibernate.orm:hibernate-jcache" }
ehcache = { module = "org.ehcache:ehcache", version.ref = "ehcache" }
ktor-server-status-pages = { module = "io.ktor:ktor-server-status-pages" }
spring-boot-starter-log4j2 = { module = "org.springframework.boot:spring-boot-starter-log4j2" }
spring-aop = { module = "org.springframework:spring-aop" }
Expand All @@ -79,7 +72,6 @@ spring-instrument = { module = "org.springframework:spring-instrument" }
kotlin-byte-buf-serializer = { module = "dev.slne.surf:kotlin-byte-buf-serializer", version.ref = "kotlin-byte-buf-serializer" }
voicechat-api = { module = "de.maxhenkel.voicechat:voicechat-api", version.ref = "voicechat-api" }
discord-webhooks = { module = "com.github.BinaryWriter:discord-webhooks", version.ref = "discord-webhooks" }
konf = { module = "com.uchuhimo:konf", version.ref = "konf" }

[plugins]
spring-boot = { id = "org.springframework.boot" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 3 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ findProject(":surf-cloud-api:surf-cloud-api-client:surf-cloud-api-client-paper")
include("surf-cloud-api:surf-cloud-api-client:surf-cloud-api-client-velocity")
findProject(":surf-cloud-api:surf-cloud-api-client:surf-cloud-api-client-velocity")?.name = "surf-cloud-api-client-velocity"

include("surf-cloud-bom")

if (!ci) {
include(":surf-cloud-test-plugin:surf-cloud-test-standalone")
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import dev.slne.surf.surfapi.gradle.util.slneReleases

plugins {
`exclude-kotlin`
id("dev.slne.surf.surfapi.gradle.core")
}

dependencies {
api(project(":surf-cloud-api:surf-cloud-api-common"))
}

publishing {
repositories {
slneReleases()
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import dev.slne.surf.surfapi.gradle.util.slneReleases

plugins {
`exclude-kotlin`
id("dev.slne.surf.surfapi.gradle.paper-raw")
}

dependencies {
api(project(":surf-cloud-api:surf-cloud-api-client:surf-cloud-api-client-common"))
}

publishing {
repositories {
slneReleases()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ fun PlayerTeleportEvent.TeleportCause.toCloudTpCause(): TeleportCause = when (th
PlayerTeleportEvent.TeleportCause.SPECTATE -> TeleportCause.SPECTATE
PlayerTeleportEvent.TeleportCause.EXIT_BED -> TeleportCause.EXIT_BED
PlayerTeleportEvent.TeleportCause.END_PORTAL -> TeleportCause.END_PORTAL
PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT -> TeleportCause.CHORUS_FRUIT
PlayerTeleportEvent.TeleportCause.ENDER_PEARL -> TeleportCause.ENDER_PEARL
PlayerTeleportEvent.TeleportCause.END_GATEWAY -> TeleportCause.END_GATEWAY
PlayerTeleportEvent.TeleportCause.NETHER_PORTAL -> TeleportCause.NETHER_PORTAL
PlayerTeleportEvent.TeleportCause.CONSUMABLE_EFFECT -> TeleportCause.CONSUMABLE_EFFECT
}

fun TeleportCause.toBukkitTpCause(): PlayerTeleportEvent.TeleportCause = when (this) {
Expand All @@ -32,10 +32,10 @@ fun TeleportCause.toBukkitTpCause(): PlayerTeleportEvent.TeleportCause = when (t
TeleportCause.SPECTATE -> PlayerTeleportEvent.TeleportCause.SPECTATE
TeleportCause.EXIT_BED -> PlayerTeleportEvent.TeleportCause.EXIT_BED
TeleportCause.END_PORTAL -> PlayerTeleportEvent.TeleportCause.END_PORTAL
TeleportCause.CHORUS_FRUIT -> PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT
TeleportCause.ENDER_PEARL -> PlayerTeleportEvent.TeleportCause.ENDER_PEARL
TeleportCause.END_GATEWAY -> PlayerTeleportEvent.TeleportCause.END_GATEWAY
TeleportCause.NETHER_PORTAL -> PlayerTeleportEvent.TeleportCause.NETHER_PORTAL
TeleportCause.CONSUMABLE_EFFECT -> PlayerTeleportEvent.TeleportCause.CONSUMABLE_EFFECT
}

fun TeleportFlag.toCloudTpFlag(): CloudTeleportFlag = when (this) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import dev.slne.surf.surfapi.gradle.util.slneReleases

plugins {
id("dev.slne.surf.surfapi.gradle.core")
`exclude-kotlin`
id("dev.slne.surf.surfapi.gradle.velocity")
}

dependencies {
api(project(":surf-cloud-api:surf-cloud-api-client:surf-cloud-api-client-common"))
}

publishing {
repositories {
slneReleases()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package dev.slne.surf.cloud.api.client.velocity.server

import com.velocitypowered.api.proxy.ProxyServer
import dev.slne.surf.cloud.api.common.server.CloudServer
import kotlin.jvm.optionals.getOrNull

fun CloudServer.toRegisteredServer(proxy: ProxyServer) =
proxy.getServer(name).getOrNull() ?: error("Server $name is not registered in Velocity proxy")
1 change: 1 addition & 0 deletions surf-cloud-api/surf-cloud-api-common/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/main/resources/cloud.version
31 changes: 28 additions & 3 deletions surf-cloud-api/surf-cloud-api-common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import dev.slne.surf.surfapi.gradle.util.slneReleases

plugins {
`exclude-kotlin`
id("dev.slne.surf.surfapi.gradle.core")
}

dependencies {
api(libs.bundles.spring.api.common)
implementation(libs.spring.data.jpa) // Hide this from the API
api(libs.bundles.jackson.api.common)
api(libs.bundles.spring.aop)

Expand All @@ -14,16 +16,39 @@ dependencies {
exclude(group = "io.netty")
}

api(libs.nbt)
api(libs.datafixerupper) {
isTransitive = false
}
api(libs.byte.buddy)
api(libs.spring.boot.starter.actuator)
}

val writeCloudVersion by tasks.registering {
group = "build"
description = "Writes the cloud version to the classpath resource"

val outputDir = layout.projectDirectory.dir("src/main/resources")
val outputFile = outputDir.file("cloud.version")

doLast {
outputDir.asFile.mkdirs()
outputFile.asFile.writeText(project.version as String)
}
}

tasks {
processResources {
dependsOn(writeCloudVersion)
}
}

kotlin {
compilerOptions {
optIn.add("dev.slne.surf.cloud.api.common.util.annotation.InternalApi")
}
}

publishing {
repositories {
slneReleases()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package dev.slne.surf.cloud.api.common
import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter
import org.springframework.boot.autoconfigure.AutoConfigurationPackage
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
import org.springframework.boot.autoconfigure.domain.EntityScan
import org.springframework.boot.context.TypeExcludeFilter
import org.springframework.cache.annotation.EnableCaching
import org.springframework.context.annotation.AdviceMode
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.EnableAspectJAutoProxy
import org.springframework.context.annotation.FilterType
import org.springframework.scheduling.annotation.EnableAsync
import org.springframework.scheduling.annotation.EnableScheduling
Expand All @@ -24,10 +23,10 @@ import java.lang.annotation.Inherited
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
@EnableScheduling
@EnableAsync
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@EnableAsync(mode = AdviceMode.ASPECTJ)
//@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@EntityScan
@EnableCaching
@EnableCaching(mode = AdviceMode.ASPECTJ)
@AutoConfigurationPackage
@Inherited
@EnableAutoConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ annotation class SurfNettyPacket(
val id: String,
val flow: PacketFlow,
@property:InternalApi
vararg val protocols: ConnectionProtocol = [ConnectionProtocol.RUNNING]
vararg val protocols: ConnectionProtocol = [ConnectionProtocol.RUNNING, ConnectionProtocol.SYNCHRONIZING]
)

/**
Expand All @@ -43,6 +43,7 @@ object DefaultIds {
// Login
const val SERVERBOUND_LOGIN_START_PACKET = "cloud:serverbound:login_start"
const val CLIENTBOUND_LOGIN_FINISHED_PACKET = "cloud:clientbound:login_finished"
const val SERVERBOUND_WAIT_FOR_SERVER_TO_START_PACKET = "cloud:serverbound:wait_for_server_to_start"
const val SERVERBOUND_LOGIN_ACKNOWLEDGED_PACKET = "cloud:serverbound:login_acknowledged"
const val CLIENTBOUND_LOGIN_DISCONNECT_PACKET = "cloud:clientbound:login_disconnect"
const val SERVERBOUND_KEY_PACKET =
Expand Down Expand Up @@ -125,6 +126,7 @@ object DefaultIds {
const val CLIENTBOUND_CLEAR_RESOURCE_PACKS_PACKET = "cloud:clientbound:clear_resource_packs"

const val PLAYER_CONNECT_TO_SERVER_PACKET = "cloud:player:connect_to_server"
const val PLAYER_CONNECTED_TO_SERVER_PACKET = "cloud:player:connected_to_server"
const val PLAYER_DISCONNECT_FROM_SERVER_PACKET = "cloud:player:disconnect_from_server"

const val SERVERBOUND_REQUEST_DISPLAY_NAME_PACKET = "cloud:serverbound:request_display_name"
Expand Down
Loading