summaryrefslogtreecommitdiff
path: root/src/char/inter.c
AgeCommit message (Collapse)AuthorFilesLines
2016-03-20Dropped typedef from DBMapHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed unnecessary typedefs from sql.hHaru1-0/+1
- Sql -> struct Sql - SqlStmt -> struct SqlStmt - SqlDataType -> enum SqlDataType This is expected to improve compile time, by removing #include cycles (and forward declaring instead) Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed several unnecessary explicit casts of the WFIFOP resultHaru1-4/+4
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Removed several unnecessary RFIFOP typecastsHaru1-7/+6
- While this is arguable, those explicit typecasts are potentially dangerous/misleading (for example, a const specifier might get accidentally dropped without even generating a compiler warning, or a variable type might change during code changes, and any related warning would get silenced by the explicit typecast). - As a reminder Hercules is written in C, and not in C++ (and there's no such thing as "compiling in C++ mode" - they're two different languages.) As such, it is legal to let the compiler automatically promote void* from/to any non-const pointer type, as well as const void* from/to any const pointer type. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to several variable/argument pointersHaru1-3/+3
- This is necessary for compatibility with a const RFIFOP. Signed-off-by: Haru <haru@dotalux.com>
2015-12-22Ensured 32+1 bytes for all buffers that hold variable namesHaru1-5/+7
Related: #865, #866, #867 Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+1
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-15Cleaned up socket interfaceHaru1-4/+4
- 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-07-12Remove useless checks from char server.Andrei Karas1-1/+1
2015-06-19Cleaned up some #includesHaru1-1/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-23/+23
- 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-01Replaced some of the hardcoded values with constants (char)Haru1-2/+2
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
2015-04-09Add checks to inter.cAndrei Karas1-1/+23
2015-01-24Fixed 18 minor issuesHaru1-0/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-01-20Minor fixes and tweaks suggested by cppcheckHaru1-3/+2
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
2015-01-1727 Fixesshennetsind1-21/+15
Addressing out of bounds read/write, pointless null checks on already deferenced variables. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2014-12-31fix typo in inter.c in initerface initialisation.Andrei Karas1-1/+1
2014-11-16Whitespace cleanup (no code changes)Haru1-40/+40
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-16Moved geoip-related functions to geoip.cHaru1-159/+0
Signed-off-by: Haru <haru@dotalux.com>
2014-11-15Move global variable into interface in inter.cAndrei Karas1-83/+83
2014-11-15Move global variable into interface in char.cAndrei Karas1-2/+2
Other variables better move to future char_config.
2014-11-15Create geoip interface.Andrei Karas1-27/+24
2014-11-15Add most functions from inter.c to interfaces.Andrei Karas1-112/+147
2014-11-15Add most functions from int_storage.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_quest.c to interfaces.Andrei Karas1-1/+1
2014-11-15Add most functions from int_pet.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_party.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_mercenary.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_mail.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_homun.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_guild.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_elemental.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from int_auction.c to interfaces.Andrei Karas1-3/+3
2014-11-15Add most functions from char.c to interfaces.Andrei Karas1-10/+11
Introduced interfaces: chr, mapif, loginif.
2014-11-15Split functions in inter.c.Andrei Karas1-16/+11
2014-11-15Add prefix inter_ to most functions in inter.cAndrei Karas1-57/+57
2014-11-15Add prefix char_ to most functions in char.cAndrei Karas1-4/+4
2014-10-30Merge pull request #369 from 4144/sqlpasswordsizeHaruna1-1/+1
Increase sql password field size from 32 to 100 chars.
2014-10-23Added some validation checks in the geoip parse functionHaru1-9/+14
This fixes the warning on some compilers, about the fread return value being ignored. Signed-off-by: Haru <haru@dotalux.com>
2014-10-18Increase sql password field size from 32 to 100 chars.Andrei Karas1-1/+1
32 chars is very small for password.
2014-09-16"Fixes char server crash when saving ##variables while login server is ↵Michieru1-5/+12
offline, thanks to Ancyker" Fix made by Ind :)
2014-08-07Fixed some MSVC incompatibilitiesHaru1-0/+1
- Resolves bugreport:8289 http://hercules.ws/board/tracker/issue-8289-compile-error-vs-2013/ - Disables some winsock-related deprecation warnings. Signed-off-by: Haru <haru@dotalux.com>
2014-08-07Corrected several format-string errors through the codeHaru1-5/+5
- Functions that expect a printf-style format string are now marked as such, so that gcc/clang will emit a warning warn you if you mismatch format string and arguments. Signed-off-by: Haru <haru@dotalux.com>
2014-05-30Fixed typos inside src/Shido1-9/+9
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-21/+22
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-22/+21
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/