From ce08d6238d902590dbfb650f889a8ab8887356bf Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 9 Nov 2014 02:07:09 +0100 Subject: Command line arguments handling overhaul - login_server, char_server, map_server as well as the tools (mapcache) now have a common command line arguments handling mechanism. - All of them now accept `--help` (`-h`), `--version` (`-v`) and `--load-plugin`. - login_server now accepts `--login-config` and `--lan-config` instead of relying on positional arguments to override those files. The old syntax will no longer work, please update your custom startup scripts. - char_server now accepts `--char-config`, `--inter-config`, `--lan-config` instead of relying on positional arguments. The old syntax will no longer work, please update your custom startup scripts. - mapcache now accepts `--grf-list`, `--map-list`, `--map-cache`, `--rebuild` in place of, respectively, `-grf`, `-list`, `-cache`, `-rebuild`. - A new macro `CMDLINEARG()` is provided, to help defining new command line argument handlers (i.e. in plugins). the `addArg()` call is still required, but its syntax has changed. The `help` argument is now of type `const char *` rather than a function pointer, and it is supposed to contain the message to show in the `--help` screen. Pass `NULL` if no help message is desired. Signed-off-by: Haru --- src/map/map.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/map/map.h') diff --git a/src/map/map.h b/src/map/map.h index 9721b19f3..a1c6d2cde 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -812,7 +812,13 @@ struct map_cache_map_info { struct map_interface { /* vars */ - bool minimal; + bool minimal; ///< Starts the server in minimal initialization mode. + bool scriptcheck; ///< Starts the server in script-check mode. + + /** Additional scripts requested through the command-line */ + char **extra_scripts; + int extra_scripts_count; + int retval; int count; @@ -1005,7 +1011,7 @@ struct map_interface { struct mob_data * (*getmob_boss) (int16 m); struct mob_data * (*id2boss) (int id); // reload config file looking only for npcs - void (*reloadnpc) (bool clear, const char * const *extra_scripts, int extra_scripts_count); + void (*reloadnpc) (bool clear); int (*check_dir) (int s_dir,int t_dir); uint8 (*calc_dir) (struct block_list *src,int16 x,int16 y); @@ -1068,9 +1074,6 @@ struct map_interface { int (*nick_db_final) (DBKey key, DBData *data, va_list args); int (*cleanup_db_sub) (DBKey key, DBData *data, va_list va); int (*abort_sub) (struct map_session_data *sd, va_list ap); - void (*helpscreen) (bool do_exit); - void (*versionscreen) (bool do_exit); - bool (*arg_next_value) (const char *option, int i, int argc, bool must); void (*update_cell_bl) (struct block_list *bl, bool increase); int (*get_new_bonus_id) (void); void (*add_questinfo) (int m, struct questinfo *qi); -- cgit v1.2.3-70-g09d2