summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)AuthorFilesLines
2016-04-27Add checks for wrong timer id. Some times in code it can be 0 and not -1.Andrei Karas1-2/+8
Now tid is illegal, and tid start counting from 1.
2016-04-25HPM Hooks UpdateHercules.ws1-0/+1
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2016-04-23HPM Hooks UpdateHaru1-0/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-04-16HPM Hooks UpdateHaru1-0/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-04-16HPM Hooks UpdateHaru1-0/+19
Signed-off-by: Haru <haru@dotalux.com>
2016-04-16HPM Hooks UpdateHaru2-0/+12
Signed-off-by: Haru <haru@dotalux.com>
2016-04-16Rewrite client interface for login server (part 1)hemagx1-6/+1
Rewritten incoming/outgoing packet handlers to use structs instead of manipulating the WFIFO buffer bytes directly Signed-off-by: Haru <haru@dotalux.com>
2016-04-16Added const qualifier to the input parameter of bin2hexHaru2-6/+5
Signed-off-by: Haru <haru@dotalux.com>
2016-04-16Updated GNU Make build system to support private headersHaru1-14/+17
Signed-off-by: Haru <haru@dotalux.com>
2016-04-05Disabled some #pragma GCC diagnostic on versions that don't support themHaru2-3/+18
- Fixes compilation on gcc 4.4 for the brave ones who still want to use it (we recommend gcc 4.7 or newer) - Removes some warnings about unknown pragmas on MSVC Signed-off-by: Haru <haru@dotalux.com>
2016-04-04Merge pull request #1210 from HerculesWS/wcast_qualAndrei Karas11-629/+672
Added -Wcast-qual compiler flag
2016-03-21Update Max Zeny to official value 2,147,483,647hemagx1-1/+1
closes #1213
2016-03-20Added separate char* and const char* data types to union DBKeyHaru2-9/+12
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped the remaining (private) typedef in db.cHaru1-62/+62
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBMapHaru5-154/+161
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBIteratorHaru3-45/+49
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru2-154/+154
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed typedefs from db-related enumsHaru2-154/+167
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Changed buffer argument of SQL->StmtBindParam() to constHaru2-6/+15
Parameters are supposed to be read-only Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed unnecessary typedefs from sql.hHaru5-100/+107
- 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-03-20Added const qualifier to some typecastsHaru1-3/+3
Signed-off-by: Haru <haru@dotalux.com>
2016-03-09Corrected some issues in the item data saving functionHaru1-0/+4
- Unique ID could get duplicated (resulting in an apparent item duplication, while it's only unique ID corruption). Fixes #1191 - Removed duplicated code (char_inventory_to_sql, being an almost exact clone of char_memitemdata_to_sql) Signed-off-by: Haru <haru@dotalux.com>
2016-03-06Check allowed range for "View" field in item_db for weapon items.Andrei Karas1-1/+2
Also fix some array sizes.
2016-02-28Changed mob mode field to 32 bit, for future expansionHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-02-27Corrected wrong variable type of struct status_change_data::tickHaru1-4/+6
- The variable should be signed, since it uses the value -1 to indicate infinite duration (and it's stored as signed in the database). - Added #define for the special value -1 (INFINITE_DURATION). - This fixes an issue causing status changes to fail being saved to database (thanks to Michi for reporting it). - Related to commit 8dc75721. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24HPM Hooks UpdateHercules.ws1-0/+2
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2016-02-24Modified RBUFP to return a const void *Haru1-1/+6
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Modified the WBUF family of macros to ensure a non-const buffer is usedHaru1-1/+6
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Changed RFIFO2PTR (and P2PTR) to return const void*Haru1-2/+2
- Also increased robustness of the macro Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Changed RFIFOP and WFIFOP to return const void * and void * respectivelyHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Implemented aStrndup()Haru2-0/+65
- aStrndup() behaves similarly to the POSIX function strdup(). It allocates sufficient memory for a copy of the passed string, copies it, and returns a pointer to the copy. A maximum number of characters is copied (and a NUL terminator is always appended after the end). Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to the {RFIFO,RBUF}{B,W,L,Q} familiesHaru1-9/+9
A read FIFO/buffer should be, well, read-only. Signed-off-by: Haru <haru@dotalux.com>
2016-02-20Fixed some warnings in GCC 5.2Haru1-5/+5
Signed-off-by: Haru <haru@dotalux.com>
2016-02-20Fixed compile warnings in clangHaru1-1/+1
- Fixed a -Wshorten-64-to-32 warning in case there's no thread-local-storage available - Disabled -Wcast-align for the time being Signed-off-by: Haru <haru@dotalux.com>
2016-02-20Added explicit c99 mode to CFLAGS in the configure scriptHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-02-19Fix all known warnings from compiler flags -Wformat*Andrei Karas6-24/+24
Add all missing -Wformat flags into configure.
2016-02-19Fix some cast discards 'const' qualifier from pointer target type warnings.Andrei Karas2-8/+8
Add -Wcast-qual into configure comment.
2016-02-17Replaced some now unnecessary includes with forward declarations in header filesHaru5-5/+8
Added some forgotten <stdio.h> and "common/conf.h" includes to .c files, that were previously masked by the above. Signed-off-by: Haru <haru@dotalux.com>
2016-02-17Removed unnecessary typedefs from libconfigHaru7-117/+120
Signed-off-by: Haru <haru@dotalux.com>
2016-02-17Renamed config->read_file to config->load_fileHaru4-10/+12
- The return value is now consistent with the libconfig standard (CONFIG_TRUE/CONFIG_FALSE). - Removed some redundant error messages. Signed-off-by: Haru <haru@dotalux.com>
2016-02-17Added new set of functions to libconfig in order to handle other data typesHaru2-0/+261
- New data types supported: - uint16 - int16 - uint32 - bool - mutable string - Documented conf_read_file Ported to modern Hercules and cleaned up from Panikon's commits fa09661f1bdbe41060fa97f5e63810523feadcc0, cbb3e3b6ad987eeeaac0c75236feabfd2206cf07, cd79c70101638cff476c40d31e2b7cd031915284, 126f9b2dc1ab5af223ef37be6000346fe18a0a96, b9bf380edc30dab038abef41568081037a75ffb5. Signed-off-by: Haru <haru@dotalux.com>
2016-02-17Updated libconfig to version 1.5Haru2-6/+6
- Based on https://github.com/hyperrealm/libconfig/releases/tag/v1.5 f9f23d7a95608936ea7d839731dbd56f1667b7ed - Improvements that come with this libconfig version: * Don't fclose() a null pointer. * check if file being opened is a directory * added config_set_options(), config_get_options(), setOptions(), getOptions(). * renamed config_setting_lookup_from() to config_setting_lookup() and documented it * floating point precision loss patch * scanner code cleanup * parser code cleanup * bugfix; capture root filename - Parser generated with Bison 2.7 - Scanner generated with flex 2.6 - This includes the windows-compatibility commit 909b06c07e30e456cc63f58d31b0e2f3aad4cc43 from upstream (although not part of version 1.5) Signed-off-by: Haru <haru@dotalux.com>
2016-02-15Fixed a missing include in utils.hHaru1-0/+3
Signed-off-by: Haru <haru@dotalux.com>
2016-02-07Fix blind defined macro WFIFO2PTRhemagx1-1/+1
Follow up b77735473db348a65b749a79549852713f142dc1
2016-02-06Merge pull request #1142 from 4144/pluginsfixHaru1-1/+4
Fix memory corruption if plugin add command line parameter without he…
2016-02-06Fix memory corruption if plugin add command line parameter without ↵Andrei Karas1-1/+4
help/description.
2016-02-05Clear timer function after auto remove timer ended.Andrei Karas1-0/+1
2016-02-05Add missing checks into timer.cAndrei Karas1-5/+58
2016-02-05Add to system information also information about clock function.Andrei Karas3-0/+17
I think issues with stuck skills delay/cooldown related to timers/clock. This change allow to see with what clock functions issue can be reproduced.
2016-02-05Merge pull request #993 from HerculesWS/mobdb2sqlAndrei Karas2-0/+46
Mob DB support for the db2sql plugin