ronancpl / HeavenMS

An improved server based on MapleSolaxia (v83 MapleStory private server)
GNU Affero General Public License v3.0
1.02k stars 718 forks source link

Riizade/config file #520

Closed Riizade closed 5 years ago

Riizade commented 5 years ago

This replaces most constants in ServerConstants.java with a YAML file.

Also replaces the configuration .ini files.

This allows us to edit the config and restart the server to reload values without recompiling.

This allows for nested objects more easily, as seen in the worlds configs.

Having done this, I'm not sure it's actually all that useful. I envision placing more server config stuff into the worlds config so that each world can have features enabled or disabled. This makes it a lot easier to do so.

I dunno, give me some feedback and let me know what you think.

I was able to get the server up and running and poked around a bit using the client. Everything seems to work properly.

Riizade commented 5 years ago

This PR doesn't fix imports in .js files which breaks a number of NPCs.

Lemme know what you think of this change before I spend time fixing that.

DumberSoft commented 5 years ago

LOOL Nice

ronancpl commented 5 years ago

@Riizade This PR movement, which makes the server flags accessible outside of compiling range, is pretty nice! Only wondering if there wouldn't have some way to make this happen without having to resort to this many dependency files (from a bit of search it seems YamlBeans only uses one dependency... no need for you to worry on doing the transition though).

Analyzing the "flags getting moved to property files" situation, it's quite a shame though those flags still have to be declared in Java in order to be usable by the source modules. Yet overall this looks like an dependable improvement, looking forward to the script fixes!

And finally, from testing the build... Unfortunately, something seems to have went off during the flags initialization:

image

It's required for the flags to be initialized before a getConnection() call. Perhaps being one of the first tasks executed when booting the server would be a good call.

Riizade commented 5 years ago

The no suitable driver thing is a result of the DB_URL being an empty string (or null) it needs to be a string of the form jdbc:mysql... or whatever the proper format is.

The default on master is an empty String as well, so you'd need to rebase a working instance off of this branch and then make sure you provide a DB_URL String in config.yaml instead of ServerConstants.java to get the DB to connect

ronancpl commented 5 years ago

Thank you.

Oddly enough, when the build was tested back there, tests have shown ServerConfig.HOST as an empty string and, only after the HeavenMS is now online. message, HOST had a value set...

ronancpl commented 5 years ago

Ah, just noticed. You also told it as well, currently DB_URL: "". That's why it happened.