Add libconfig import support to remaining conf files#3409
Conversation
62cf4ca to
3505112
Compare
d26954e to
d4106c9
Compare
| #endif // BUILDBOT | ||
|
|
||
| { | ||
| const char *import = NULL; |
There was a problem hiding this comment.
there's no need to open a new scope, we're using C11 already.
|
|
||
| static void bg_config_read(void) | ||
| { | ||
| bg_config_read_from_file("conf/battlegrounds.conf"); |
There was a problem hiding this comment.
I don't like that creating a function just to do this call? instead edit the original function to take a file name and edit the call with default file name.
| } | ||
|
|
||
| { | ||
| const char *import = NULL; |
There was a problem hiding this comment.
there's no need to open a new scope, we're using C11 already.
|
|
||
| static void read_channels_config(void) | ||
| { | ||
| read_channels_config_from_file("conf/channels.conf"); |
There was a problem hiding this comment.
Same, no need for new function.
| ShowStatus("Done reading '"CL_WHITE"%u"CL_RESET"' channels in '"CL_WHITE"%s"CL_RESET"'.\n", db_size(channel->db), config_filename); | ||
| } | ||
|
|
||
| { |
There was a problem hiding this comment.
there's no need to open a new scope, we're using C11 already.
| clan->config_read_additional_settings(settings, config_filename); | ||
| clan->read_db(settings, config_filename, reload); | ||
|
|
||
| { |
There was a problem hiding this comment.
there's no need to open a new scope, we're using C11 already.
| * Pool of config objects kept alive until all group processing is done. | ||
| * group_settings->commands/permissions/root point into these configs. | ||
| */ | ||
| #define PC_GROUPS_MAX_CONFIGS 2 |
There was a problem hiding this comment.
why is there a limit? a vector can be used here.
Pull Request Prelude
Changes Proposed
Adds the
import:override mechanism to conf files that were missing it, consistent with the existing pattern used inmap-server.conf,char-server.conf, etc.conf/atcommand.conf— added import lookup inatcommand_config_read()conf/groups.conf— refactoredread_config()inpc_groups.cto use a static config pool so all configs stay alive until inheritance resolution andatcommand->load_groups()completeconf/channels.conf— splitread_channels_config()into a_from_file()helper with recursive import supportconf/battlegrounds.conf— same wrapper/helper split patternconf/clans.conf— import recurses withreload=falseto avoid clearing the DB on the secondary fileconf/network.confandconf/api/api_network.conf— added import lookup insocket_net_config_read()(already accepted a filename)conf/plugins.conf— replaced the oldfopenreplace-hack with proper merge support; HPMHooking-first ordering preserved via anis_primaryflagEach modified conf file gets an
import:line pointing toconf/import/<name>.conf, and a corresponding skeleton is added toconf/import-tmpl/.Issues addressed: #62