summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)AuthorFilesLines
2015-10-11Cleanup of the HPluginData implementation (First part)Haru6-136/+154
- 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 cmdline->args_data to a VECTORHaru3-21/+22
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Fixed an issue preventing correct nesting of console commands into subcategoriesHaru1-1/+1
- The issue prevented the creation of multiple commands in the same subcategory through console->input->addCommand (i.e. "foo:bar:baz" and "foo:bar:quux" would instead create "foo:bar:baz" and "foo:quux") Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed struct CParseEntry::u.next to VECTOR and renamed to u.childrenHaru2-55/+93
Added a 'type' field to describe the command type (function, category) Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed console->input->cmds to a VECTOR and renamed to console->input->commandsHaru2-35/+35
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed console->input->cmd_list to a VECTOR and renamed to ↵Haru2-64/+74
console->input->command_list Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->cmdline_plugins to a VECTOR and renamed to ↵Haru2-15/+9
HPM->cmdline_load_plugins Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->confs to a VECTOR and renamed to HPM->config_listenersHaru3-42/+53
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->fnames to a vector type, renamed to HPM->filenamesHaru2-24/+41
- 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 VECTORHaru2-44/+43
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed HPM->symbols to a VECTORHaru2-24/+40
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Replaced HPM->plugins with a VECTORHaru2-57/+93
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Changed VECTOR/BHEAP/ARRAY macros to discourage usage of unsigned loop counters.Haru3-27/+43
Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Removed reserved identifiers from db.h (VECTOR, BHEAP implementations)Haru1-561/+738
- According to ISO/IEC 9899:1999 ('C99'), all identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. Signed-off-by: Haru <haru@dotalux.com>
2015-10-10Fixed issue #783Emistry1-1/+1
signed/unsigned mismatch.
2015-10-02Skip bound items in the mergeitem feature.Haru1-0/+1
- Fixes #757, thanks to kyeme - Based on Emistry's PR #754 (improved) Signed-off-by: Haru <haru@dotalux.com>
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru13-325/+10
Signed-off-by: Haru <haru@dotalux.com>
2015-09-25Corrected a plugin unload issueHaru1-13/+14
- This doesn't affect the current unloading function (executed at shutdown), but it is only related to the (upcoming) manual plugin unloading. Signed-off-by: Haru <haru@dotalux.com>
2015-09-25Upgraded Doxygen configuration file to 1.8.10Haru1-0/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-09-18Clarified the intent of several assignments inside conditional expressionsHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-09-09Autotrade Struct to HPMdastgir1-1/+6
2015-09-08Fixed some memory leaks in code using libconfigHaru1-1/+1
- Special thanks to Dastgir Signed-off-by: Haru <haru@dotalux.com>
2015-08-27HPM Hooks UpdateHercules.ws1-0/+1
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2015-08-27Hotkey Rotate Packet ImplementedDastgir1-0/+2
2015-08-17Dont call memset with null pointer.Andrei Karas1-1/+2
2015-08-17Fixed a minor issue in the Hercules startup bannerHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-08-17HPM Hooks UpdateHercules.ws1-0/+1
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2015-08-15HPM Hooks UpdateHaru1-2/+5
2015-08-15Automatic HPM symbol sharingHaru3-41/+3
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Removed some unnecessary shared symbols, already present in interfacesHaru2-265/+275
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Moved sql_handle into the HPMi interfaceHaru2-9/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM Hooks UpdateHaru2-0/+7
2015-08-15Added core HPM interfaceHaru4-29/+26
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM Hooks UpdateHaru1-1/+1
2015-08-15Enabled HPMDataCheck for login and char serversHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM Hooks UpdateHaru2-0/+448
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru33-123/+141
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 interfaceHaru2-118/+117
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Added HPMHooking support for common interfacesHaru1-1/+9
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Minor symbols cleanup to avoid conflictsHaru4-45/+45
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Added showmsg HPM interfaceHaru6-97/+155
- The showmsg interface is automatically imported into plugins by the HPM (just like previously, the various Show* functions were). This change requires no actions from plugin developers. - stdout_with_ansisequence is now available through showmsg->stdout_with_ansisequence - msg_silent is now available through showmsg->silent - console_msg_log is now available through showmsg->console_log - timestamp_format is now available through showmsg->timestamp_format - Plugin-safe macros are provided, so that all Show* and Clear* calls will require no changes. - vShowMessage is provided through the public API, as va_list variant of ShowMessage. - vShowMessage_ is no longer part of the public API. If necessary, va_list variants of the other Show* functions will be added at a later time as follow-ups. Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Cleaned up strlib interfaceHaru2-120/+73
- Replaced some macro calls with the proper interface syntax - Removed useless macros and workarounds - Removed no longer needed library function re-definitions API changes summary: - The macros remove_control_chars(), trim(), normalize_name(), stristr(), e_mail_check(), config_switch(), safestrncpy(), safestrnlen(), safesnprintf(), strline(), bin2hex() can now be safely used both inside and outside strlib.c - The macros strnlen() and strtok_r() can now be safely used both inside and outside strlib.c, on the systems where they are necessary. The systems that provide those natively, aren't affected by this change. - jstrescape() is now strlib->jstrescape() - jstrescapecpy() is now strlib->jstrescapecpy() - jmemescapecpy() is now strlib->jmemescapecpy() - a custom strtoull() implementation is no longer provided, since all supported systems and compilers provide a library implementation. Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Cleaned up socket interfaceHaru2-76/+59
- Replaced some macro calls with the proper interface syntax - Removed useless macros and workarounds API changes summary: - WFIFOSET() can now be safely used both inside and outside socket.c - RFIFOSKIP() can now be safely used both inside and outside socket.c - do_close() is now sockt->close() - flush_fifo() is now sockt->flush() - flush_fifos() is now sockt->flush_fifos() - getips() is now sockt->getips() - host2ip() is now sockt->host2ip() - ip2str() is now sockt->ip2str() - ntows() is now sockt->ntows() - make_connection() is now sockt->make_connection() - make_listen_bind() is now sockt->make_listen_bind() - realloc_fifo() is now sockt->realloc_fifo() - realloc_writefifo() is now sockt->realloc_writefifo() - session_isActive() is now sockt->session_is_active() - session_isValid() is now sockt->session_is_valid() - set_defaultparse() is now sockt->set_defaultparse() - set_eof() is now sockt->eof() - set_noblocking() is now sockt->set_noblocking() - str2ip() is now sockt->str2ip() Signed-off-by: Haru <haru@dotalux.com>
2015-08-13Added check for execinfo.h/backtrace() to the configure scriptHaru1-6/+6
- This fixes compilation on systems such as FreeBSD, where -lexecinfo is necessary, or Cygwin, where execinfo.h is not available. Signed-off-by: Haru <haru@dotalux.com>
2015-08-11HPM Hooks UpdateHercules.ws1-0/+1
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2015-08-11subnet.conf overhaulHaru2-0/+208
The subnet.conf system has been rewritten to offer greater flexibility, and to fix some issues that appeared with 838321a36c79e71117320154c9b611c99e93af03. It is now possible to enter, separately, LAN subnets: - `lan_subnets`: This is essentially the same feature present in the old subnet.conf. Each entry in this list defines a (LAN, private) subnet the server is in. Clients connecting from the same subnet, will be redirected to the LAN IP rather than the default public IP. The format has been simplified, and it only requires one IP and one subnet mask (as opposed to a character and a map server IP). - `allowed`: Allowed IPs are IP ranges a server (char to login or map to char) can connect from. Any attempt to connect as a server from an IP not included here, will fail. For convenience, a wildcard range (matching all possible IP addresses) has been provided (`0.0.0.0:0.0.0.0`), but it is very advisable to edit it to a more restrictive set. - `trusted`: Trusted IPs are IP ranges excluded from the IPban checks. This may be useful, for example, to exclude the server's own IP from ipbans, in case of false positives. Any IP ranges added to this list are also implicitly included in the allowed IP ranges.
2015-08-10Added support for visual Studio 2015Haru3-2/+6
Please report any issues Signed-off-by: Haru <haru@dotalux.com>
2015-08-10Fixed a compile error in CygwinHaru1-3/+3
- Follow-up to c5ff02958806ea5a672dcc9371602a6c090c6758 - Cygwin doesn't support backtrace() nor it provides execinfo.h Signed-off-by: Haru <haru@dotalux.com>
2015-08-10Fixed a compile error on WIN32/MSVCHaru1-0/+6
- Follow-up to 84e02ac28fbb15c58d0a0f8a916b49663198b05b - Thanks to KirieZ for pointing it out. Signed-off-by: Haru <haru@dotalux.com>
2015-08-01HPM Hooks UpdateHercules.ws1-0/+3
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>