Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
145 stars 127 forks source link

Get values directly from config.lua #410

Closed EPuncker closed 4 years ago

EPuncker commented 4 years ago

There are some values that would be nice if they were given directly from config.lua (on installation maybe?) so we didn't need to double set them nor have inconsistency issues, as the following:

Znote commented 4 years ago

As mentioned in an unrelated PR:

About config: I want to eventually find a good "config manager" solution, I don't like the idea of a parser going through an unrelated file and write AAC config files to disk. I'm looking a bit into a mysql + apcu cache solution. But I have to be very mindful of complexity as well, a config file works fast and is relatively easy for people who know they should check it out and edit it properly to their configurations.

I'm also considering an "installation health" page that you can visit that will try to identify and inform about typical misconfigurations. Like database schema doesn't seem to fit configured TFS engine, cache files arent working properly or are to quick to refresh. This page could potentially look up the server name of config.lua and config.php and inform that it has detected an protocol login issue due to mismatch.

I don't like the idea of: 1: Give AAC access to parse an OT config.lua file 2: Write config values to disk

This is why serverinfo.php has a config.lua parser, but skips and doesn't store connection information. (only stores non-critical information as a public cache file).

serverinfo.php has gone through 3 iterations, the first version was a blank page where you could type info in manually. The second version was added by @Alvaritos (which was much better than the first version!) This is where server_path was added to config.php and parsed for server information. And the third version was made by me, but this time making it possible to parse the lua file through a textarea input field (as a one step install step) to generate only the information needed to generate the page.

EPuncker commented 4 years ago

okay, I agree, I'll just leave the achievements and vocations.xml for future implementation just in case

EPuncker commented 4 years ago

well the main concern of this PR was for the server name, and seems like it was finally figured out on https://github.com/Znote/ZnoteAAC/commit/529abad19cfd96895b909866931b136951e00a43