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.
30 lines
847 B
30 lines
847 B
package org.openrs2.game.cluster
|
|
|
|
import jakarta.inject.Inject
|
|
import jakarta.inject.Singleton
|
|
import org.openrs2.conf.Config
|
|
import org.openrs2.protocol.world.downstream.WorldListResponse
|
|
import java.util.SortedMap
|
|
|
|
@Singleton
|
|
public class SingleWorldCluster @Inject constructor(
|
|
config: Config,
|
|
countries: CountryList
|
|
) : Cluster {
|
|
private val worlds = sortedMapOf(
|
|
config.world to WorldListResponse.World(
|
|
countries[config.country],
|
|
config.members,
|
|
config.quickChat,
|
|
config.pvp,
|
|
config.lootShare,
|
|
config.activity,
|
|
config.hostname
|
|
)
|
|
)
|
|
private val players = sortedMapOf(0 to 0)
|
|
|
|
override fun getWorldList(): Pair<SortedMap<Int, WorldListResponse.World>, SortedMap<Int, Int>> {
|
|
return Pair(worlds, players)
|
|
}
|
|
}
|
|
|