summaryrefslogtreecommitdiff
path: root/src/plugins/sample.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-13Update copyright headers for year 2020Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2019-04-18Restore the ability for HPM Hooks to hook to private interfacesIbrahim Zidan1-0/+23
- Starting from 5db7c799055c6ae9c4463f6cf4c88a35597d5d31 the ability to hook to private interfaces was removed, this commit restores this ability by introducing two new macros specifically for this. - addHookPrePriv to add a pre-hook for private interface member - addHookPostPriv to add a post-hook for private interface member Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
2019-03-12Fix rand() not support on certain compilerAnnieRuru1-4/+5
2016-08-19Added option to make plugin-defined battle config entries optionalHaru1-2/+3
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-04-30Added one level of indirection to all variables in pre-hook functionsHaru1-2/+3
- Previously, only scalar variables had their indirection level increased. Now pointers do as well (this allows users to override const pointers) Signed-off-by: Haru <haru@dotalux.com>
2016-04-30Removed extra indirection level in HPMHooking post-hooksHaru1-4/+6
- The extra indirection level (necessary to override function arguments from a hook) isn't necessary in post-hooks, but only in pre-hooks. - This simplifies the syntax and code of post-hooks. Signed-off-by: Haru <haru@dotalux.com>
2016-04-30Added type-checking for the addHookPre() and addHookPost() macrosHaru1-2/+2
- The macros will now throw a warning at compile time if a plugin is using a wrong function type for a pre or post hook. This avoids some very subtle, hard to detect, issues. - The macros now require 3 arguments instead of 2. Example: old code: addHookPre("ifname->function" my_hook); becomes: addHookPre(ifname, function, my_hook); Signed-off-by: Haru <haru@dotalux.com>
2016-04-30Moved HPMHooking-related definitions to plugins/HPMHooking.hHaru1-0/+1
- Plugins that want to make use of the HPMHooking must now include "plugins/HPMHooking.h". Signed-off-by: Haru <haru@dotalux.com>
2016-02-19Fix all known warnings from compiler flags -Wformat*Andrei Karas1-4/+4
Add all missing -Wformat flags into configure.
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-3/+21
Signed-off-by: Haru <haru@dotalux.com>
2015-12-13- Fixed #723 now it's possible to retrieve Battle Config Settings from ↵Your Name1-4/+27
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-12-12Added server type checks to the sample plugin, to avoid hooking errors on ↵Haru1-16/+25
login/char servers Related to issue #909 Signed-off-by: Haru <haru@dotalux.com>
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-08-15Added core HPM interfaceHaru1-12/+5
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-13/+4
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-08-15Moved session array into the socket interfaceHaru1-11/+8
Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-11/+11
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-06-02Re-implemented clif->colormes to accept arbitrary colorsHaru1-1/+1
- Due to the backward-incompatible change, clif->colormes was renamed to clif->messagecolor_self (for similarity with clif->messagecolor). The 'color' argument is now a 0xRRGGBB color rather than a color_table index. - enum clif_colors is no longer needed, but 0xRRGGBB-based constants are now provided to replace the old COLOR_* values. Signed-off-by: Haru <haru@dotalux.com>
2014-11-16Whitespace cleanup (no code changes)Haru1-22/+20
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
2014-11-15Enable build HPM hooking plugin for char server.Andrei Karas1-1/+1
Enable char server in sample plugin.
2014-10-28Added preliminary support for login and char server in the HPMDataCheckHaru1-1/+1
- Special thanks to Ind Signed-off-by: Haru <haru@dotalux.com>
2014-05-16Follow-up to b6b3f58795288701d0e162d43fa6f0a47af913b3Haru1-5/+5
- Includes in some files weren't sorted alphabetically. Special thanks to KeiKun. Signed-off-by: Haru <haru@dotalux.com>
2014-03-11Fixed Bug 8067shennetsind1-1/+3
Sample plugin compiler error on msvc, credits to AnnieRuru (Thank you!) http://hercules.ws/board/tracker/issue-8067-pluginsamplec-throws-error-on-microsoft-compiler/ Signed-off-by: shennetsind <ind@henn.et>
2014-02-03Wrap up on HPMDCshennetsind1-0/+2
http://hercules.ws/board/topic/4283-introducing-hpm-datacheck/ Signed-off-by: shennetsind <ind@henn.et>
2013-12-16Introducing HPM Support for custom battle confsshennetsind1-1/+12
Special Thanks to Mhalicot. Signed-off-by: shennetsind <ind@henn.et>
2013-11-22Minor HPMi Sub Modificationsshennetsind1-13/+19
- HPMi->addCommand is now addAtcommand, dropped usage of ACMD_A() - HPMi->addScript is now addScriptCommand, dropped usage of BUILDIN_A() - HPMi->addCPCommand is now addCPCommand, dropped necessity of CPCMD_A() - HPMi->addPacket is now addPacket, 5th param (HPMi->pid) is now automatically filled by the macro, therefore param count drops to 4 (packetID,packetLength,packetFunction,packetIncomingPoint). There is no longer necessity to check for the availability of the commands, the macros will do it on their own and drop a warning about it upon failure. These changes won't affect pre-compiled plugins. Signed-off-by: shennetsind <ind@henn.et>
2013-11-13HPM Custom Data Struct Makeover!shennetsind1-7/+7
- 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-10-04HPM: Hooking!shennetsind1-1/+31
http://hercules.ws/board/topic/2399-hpm-hooking-now-available/ Signed-off-by: shennetsind <ind@henn.et>
2013-09-16Corrected line endings and BOM issues with several filesHaru1-1/+1
- Ensured final end-of-line character in every file. - Corrected cases of mixed line endings (mostly CR and CRLF within the same file.) - Removed extra BOM from some scripts, since it causes a parsing error. Signed-off-by: Haru <haru@dotalux.com>
2013-08-08HPM Updateshennetsind1-4/+78
- 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-02Follow up a2c45a8db6d724b98ab41fe9e75e1f7ea7523d5dshennetsind1-5/+1
Missing CMakeLists.txt edit, removed unnecessary check on the sample plugin Signed-off-by: shennetsind <ind@henn.et>
2013-05-02Introducing Hercules Plugin Manangershennetsind1-0/+74
http://hercules.ws/board/topic/549-introducing-hercules-plugin-manager/ Signed-off-by: shennetsind <ind@henn.et>