mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-18 12:30:18 -07:00
Fixed the load order of configs with plugins - many configs are now loaded after plugins so that npc/item/object handlers in the old plugin system are set properly
This commit is contained in:
parent
24cea604fc
commit
966a5e1c55
3 changed files with 7 additions and 3 deletions
|
|
@ -4,12 +4,14 @@ import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class ConfigParser {
|
class ConfigParser {
|
||||||
fun parseConfigs() {
|
fun prePlugin() {
|
||||||
NPCConfigParser().load()
|
NPCConfigParser().load()
|
||||||
ItemConfigParser().load()
|
ItemConfigParser().load()
|
||||||
ObjectConfigParser().load()
|
ObjectConfigParser().load()
|
||||||
XteaParser().load()
|
XteaParser().load()
|
||||||
InterfaceConfigParser().load()
|
InterfaceConfigParser().load()
|
||||||
|
}
|
||||||
|
fun postPlugin() {
|
||||||
ShopParser().load()
|
ShopParser().load()
|
||||||
DropTableParser().load()
|
DropTableParser().load()
|
||||||
NPCSpawner().load()
|
NPCSpawner().load()
|
||||||
|
|
|
||||||
|
|
@ -160,11 +160,12 @@ object GameWorld {
|
||||||
Cache.init(ServerConstants.CACHE_PATH)
|
Cache.init(ServerConstants.CACHE_PATH)
|
||||||
databaseManager = DatabaseManager(ServerConstants.DATABASE)
|
databaseManager = DatabaseManager(ServerConstants.DATABASE)
|
||||||
databaseManager!!.connect()
|
databaseManager!!.connect()
|
||||||
ConfigParser().parseConfigs()
|
configParser.prePlugin()
|
||||||
ClassScanner.scanClasspath()
|
ClassScanner.scanClasspath()
|
||||||
ClassScanner.loadPureInterfaces()
|
ClassScanner.loadPureInterfaces()
|
||||||
worldPersists.forEach { it.parse() }
|
worldPersists.forEach { it.parse() }
|
||||||
ClassScanner.loadSideEffectfulPlugins()
|
ClassScanner.loadSideEffectfulPlugins()
|
||||||
|
configParser.postPlugin()
|
||||||
startupListeners.forEach { it.startup() }
|
startupListeners.forEach { it.startup() }
|
||||||
if (run) {
|
if (run) {
|
||||||
SystemManager.flag(if (settings?.isDevMode == true) SystemState.PRIVATE else SystemState.ACTIVE)
|
SystemManager.flag(if (settings?.isDevMode == true) SystemState.PRIVATE else SystemState.ACTIVE)
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,8 @@ object TestUtils {
|
||||||
if(ServerConstants.DATA_PATH == null) {
|
if(ServerConstants.DATA_PATH == null) {
|
||||||
ServerConfigParser.parse(this::class.java.getResource("test.conf"))
|
ServerConfigParser.parse(this::class.java.getResource("test.conf"))
|
||||||
Cache.init(this::class.java.getResource("cache").path.toString())
|
Cache.init(this::class.java.getResource("cache").path.toString())
|
||||||
ConfigParser().parseConfigs()
|
ConfigParser().prePlugin()
|
||||||
|
ConfigParser().postPlugin()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue