summaryrefslogtreecommitdiff
path: root/src/common/HPM.h
AgeCommit message (Collapse)AuthorFilesLines
2016-08-20Re-added HPM support for configuration settingsHaru1-1/+2
Plugin settings should be relative to the the libconfig file root. For example, a configuration setting of type HPCT_CHAR will be relative to the root of conf/char/char-server.conf. In order to add a configuration entry inside the char_configuration block, the full configuration path (slash-delimited) should be passed to addCharConf(), as in the following example: `addCharConf("char_configuration/my_setting", my_parser_function);` Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Added option to make plugin-defined battle config entries optionalHaru1-0/+1
When a setting optional, no warning is issued on the console when said setting is not found in the config Signed-off-by: Haru <haru@dotalux.com>
2016-08-19Ported battle.conf to libconfigHaru1-1/+4
Ported to modern Hercules and cleaned up from Panikon's commits: 44fea0b3cdba6901599265220228ba4359b1f96d, 9cba05bc0811e638bbaaa6cff887d0b2c9872560 Signed-off-by: Haru <haru@dotalux.com>
2016-04-30Moved HPMHooking-related definitions to plugins/HPMHooking.hHaru1-4/+5
- Plugins that want to make use of the HPMHooking must now include "plugins/HPMHooking.h". Signed-off-by: Haru <haru@dotalux.com>
2016-01-25Fix packet id being sent encrypted to Hercules Plugin Manager.hemagx1-1/+1
Now packet id will be passed to Hercules Plugin Manager instead of let it figure it on itself
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-3/+19
Signed-off-by: Haru <haru@dotalux.com>
2015-12-13- Fixed #723 now it's possible to retrieve Battle Config Settings from ↵Your Name1-1/+3
plugins into scripts - Fixed Possible Crash when null parse function pointer passed to HPMi->addConf - Now it's possible to use same parse function for all config entries - Now Battle Config entries must have a return function
2015-10-11Cleanup of the HPluginData implementation (second part)Haru1-10/+16
- Changed the hplugin_data_store's array into a VECTOR. Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Cleanup of the HPluginData implementation (First part)Haru1-8/+12
- Several explicit casts are removed, to have a slightly better type-checking at compile time. - A destructor function is provided, to remove code duplication. Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->cmdline_plugins to a VECTOR and renamed to ↵Haru1-2/+1
HPM->cmdline_load_plugins Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->confs to a VECTOR and renamed to HPM->config_listenersHaru1-2/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->fnames to a vector type, renamed to HPM->filenamesHaru1-2/+5
- This is a generic vector. It doesn't make use of the VECTOR type because it needs to outlive the memory manager. Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->packets[] into an array of VECTORHaru1-2/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->symbols to a VECTORHaru1-5/+7
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Replaced HPM->plugins with a VECTORHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Automatic HPM symbol sharingHaru1-2/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-3/+2
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-2/+2
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-01-18Command line arguments handling overhaulHaru1-14/+6
- 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 <haru@dotalux.com>
2015-01-12Added detailed error message when a plugin fails to loadHaru1-0/+2
- This helps figuring out why a plugin can't be loaded (especially on linux systems.) - Special thanks to Dastgir. Signed-off-by: Haru <haru@dotalux.com>
2014-11-16Moved HPM_s into HPM.c and removed the HPMi_s symbol from the coreHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2014-10-28Added preliminary support for login and char server in the HPMDataCheckHaru1-1/+3
- Special thanks to Ind Signed-off-by: Haru <haru@dotalux.com>
2014-07-11Fixed reserved __identifier violationsHaru1-3/+3
- Complies with CERT DCL37-C - Fixes issue #293 (special thanks to elfring) Signed-off-by: Haru <haru@dotalux.com>
2014-05-30Fixed typos inside src/Shido1-1/+1
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-1/+5
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-5/+1
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-09Fixed order of includes in all source filesHaru1-1/+5
- Changed order according to the (upcoming) code style guidelines. - Fixes several issues caused by missing headers when their include order is changed or in plugins. Signed-off-by: Haru <haru@dotalux.com>
2014-04-17Whitespace cleanupHaru1-1/+1
Replaced some tabs in the middle of the line with spaces. Thanks to KeiKun for pointing out #ifdef<tab>_COMMON_SYSINFO_H_ and making me realize how many of them were there. Signed-off-by: Haru <haru@dotalux.com>
2014-03-16Added --load-plugin commandline argumentHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2014-02-02Introducing HPM Datacheckshennetsind1-3/+5
http://hercules.ws/board/topic/4283-introducing-hpm-datacheck/ Signed-off-by: shennetsind <ind@henn.et>
2014-01-19HPM Custom Data Struct Expansion: map/instance/party/guildshennetsind1-1/+1
As requested by the community in http://hercules.ws/board/topic/3832-hpm-custom-data-struct-for-instance-data-guild-data-and-party-data/ Signed-off-by: shennetsind <ind@henn.et>
2013-12-16Introducing HPM Support for custom battle confsshennetsind1-0/+11
Special Thanks to Mhalicot. Signed-off-by: shennetsind <ind@henn.et>
2013-12-17Changed plugin extension from .so to .dylib on OS XHaru1-1/+3
- No functional changes. That's just the correct OS X file extension for dynamic libs. Signed-off-by: Haru <haru@dotalux.com>
2013-11-19Sanitized and improved several macros through the codeHaru1-12/+12
- Sanitized all potentially unsafe macros (related eA:15259) - Improved some function-like macros to evaluate their argument only once and keep it in a temporary variable. This improves performance in the damage calculation related code. Signed-off-by: Haru <haru@dotalux.com>
2013-11-13HPM Custom Data Struct Makeover!shennetsind1-0/+8
- Modified how the core handles it, making it easier to add new points. - Modified how plugins call it, calls were made shorter, e.g. 'HPMi->getFromSession(session[fd],HPMi->pid,0)' => 'getFromSession(session[fd],0)' -- check src/common/HPMi.h #defines for all the options - Added support for npc_data (getFromNPCD and so on) as requested in http://hercules.ws/board/topic/2923-hpm-custom-struct-npcs/ Signed-off-by: shennetsind <ind@henn.et>
2013-11-09HPM Support for plugin-implemented "--args" (options)shennetsind1-0/+13
As a necessary measure for the upcoming bot that will keep .sql files in sync with their .txt counterparts. Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
2013-10-04HPM: Hooking!shennetsind1-2/+6
http://hercules.ws/board/topic/2399-hpm-hooking-now-available/ Signed-off-by: shennetsind <ind@henn.et>
2013-08-30Changed dlopen to use RTLD_DEEPBIND where availableHaru1-3/+7
- Fixes bugreport:7680 http://hercules.ws/board/tracker/issue-7680-hpm-is-broken/ Signed-off-by: Haru <haru@dotalux.com>
2013-08-08HPM Updateshennetsind1-1/+31
- Custom Packet Support - Custom Data Struct Support (currently append-able to map_session_data and socket_data) - Char Server Support - Login Server Support http://hercules.ws/board/topic/1934-hercules-plugin-manager-update/ Documentation will soon be updated in http://hercules.ws/wiki/HPM Signed-off-by: shennetsind <ind@henn.et>
2013-05-15HPM Updateshennetsind1-1/+1
Made SQL and strlib functions HPM-friendly, special thanks to Yommy for bringing the issue up. Added partial map.c support, for the all-handy map[] array, beware that soon the whole map.c renewal design will be commit and when that happens your usage of map.c functions in plugins might require some updates. Signed-off-by: shennetsind <ind@henn.et>
2013-05-03Fixed Bug #7212shennetsind1-1/+1
http://hercules.ws/board/tracker/issue-7212-warning-while-recompiling-using-centos5/ Signed-off-by: shennetsind <ind@henn.et>
2013-05-02Introducing Hercules Plugin Manangershennetsind1-0/+83
http://hercules.ws/board/topic/549-introducing-hercules-plugin-manager/ Signed-off-by: shennetsind <ind@henn.et>