Skip to content

1.1.0

Compare
Choose a tag to compare
@Distractic Distractic released this 28 Dec 12:04
· 161 commits to main since this release
d087f36

What's Changed

  • Add new fields in server configuration to enable Velocity, BungeeCord and OnlineMode

You can now use the new configuration like this :

import com.github.rushyverse.api.configuration.BungeeCordConfiguration
import com.github.rushyverse.api.configuration.IConfiguration
import com.github.rushyverse.api.configuration.IServerConfiguration
import com.github.rushyverse.api.configuration.VelocityConfiguration
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class MyConfiguration(
    @SerialName("server")
    override val server: MyServerConfiguration
) : IConfiguration

@Serializable
data class MyServerConfiguration(
    override val port: Int,
    override val world: String,
    override val onlineMode: Boolean,
    override val bungeeCord: BungeeCordConfiguration,
    override val velocity: VelocityConfiguration
) : IServerConfiguration
  • Define the start method of RushyServer as Suspend method

At the start of the server, we maybe want to make IO interactions (for database, cache, other, ..). To allow that using coroutine, the start method must be defined like :

import com.github.rushyverse.api.RushyServer

suspend fun main(args: Array<String>) {
    MyServer(args.firstOrNull()).start()
}

class MyServer(private val configurationPath: String?) : RushyServer() {

    override suspend fun start() {
        start<MyConfiguration>(configurationPath) {
            // In coroutine
        }
    }
}

Full Changelog: v1.0.0...v1.1.0