Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
489 B
18 lines
489 B
package org.openrs2.conf
|
|
|
|
public data class Config(
|
|
val game: String,
|
|
val operator: String,
|
|
val domain: String
|
|
) {
|
|
val internalGame: String = game.toInternalName()
|
|
val internalOperator: String = operator.toInternalName()
|
|
|
|
private companion object {
|
|
private val INTERNAL_NAME_REGEX = Regex("(?i)[^a-z0-9]+")
|
|
|
|
private fun String.toInternalName(): String {
|
|
return replace(INTERNAL_NAME_REGEX, "_").trim('_').toLowerCase()
|
|
}
|
|
}
|
|
}
|
|
|