summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)AuthorFilesLines
2011-07-22* CMake: Added options BUILD_TXT_SERVERS, BUILD_SQL_SERVERS, BUILD_MAPCACHE.flaviojs1-4/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14921 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-21* CMake: Only install template files if they don't already exist.flaviojs1-2/+2
* CMake: Added plugin targets. * CMake: Added options BUILD_* to build the converters and individual plugins. (default=OFF) * CMake: Added option WITH_CPACK for package creation. (default=ON) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14918 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-20* Made GCOLLECT use it's debug functions.flaviojs2-36/+42
* Turned off garbage collection for GCOLLECT since there's nothing to do with explicit frees. * Added malloc_verify_ptr/malloc_usage code for all memory libraries. * Added malloc_memory_check for debug purposes, tests memory for errors and memory leaks. * Added explicit memory check on malloc_final. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14917 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-20Removed malloc's Atomic (-A) function macros (see r968, changelog 01/20). ↵ultramage2-53/+6
They were specific to the GC allocator (atomic = promise to not have any pointers to other things inside = will be skipped during Mark phase), serving as a (dubious) optimization trick - which could cause GC to malfunction if used incorrectly. Simplified GC's CALLOC, since the GC docs say GC_MALLOC automatically clears memory. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14916 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-19* Made NO_MEMMGR only be set as a default value, allowing for simultaneous ↵flaviojs3-80/+82
use with the memory libraries. * Moved memory library selection to malloc.c to avoid poisoning the namespace of the rest of the code. * Removed BCHECK code since it's unneeded. (bcheck is an external batch tool that runs on top of the dbx debugger) * Fixed GCOLLECT usage. (missing init and final memory leak check) * Fixed DMALLOC usage. (missing options on CYGWIN and verify memory) * Renamed malloc_verify to malloc_verify_ptr to avoid conflict with DMALLOC. * Changed itemtype from inline to static inline to avoid error with the SunOS compiler. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14913 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-15* Changed the warning message of when setrlimit fails to be more explicit.flaviojs1-2/+9
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14907 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-12* CMake: added search for math.h, added search for socket/nsl library. ↵flaviojs1-0/+3
(tested with Solaris-201011-x86) * Added missing include to socket.c. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14903 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-12* CMake: set project language to C, added module FindFunctionLibrary, added ↵flaviojs1-5/+5
search for dl library. (tested with debian-wheezy-i386) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14902 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-11* Added bonus3 bAddClassDropItem, care of Epoque.L0ne_W0lf1-1/+1
- Added several missing items to the item database, updated others. - Raised level 10 Dec. AGI to be level 48, when used by mobs. - Added missing mercenaries to the mercenary DB, and skills. - Added missing monster_chat_db entries for Nydhoggr's Shadow. - Added Brasilis pets to the pet DB, these pets are unhatchable on purpose. - Added additional quests to the quest_db, mostly for RE. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-10* CMake: added txt-converter targets, added warning for 64bit, added list of ↵flaviojs1-2/+4
available targets. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14900 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-10* Temporary fix for bugreport:4961 (unintended conversion from signed to ↵flaviojs1-0/+10
unsigned). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14896 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-07* Replaced compress/uncompress inline code (encode_zip/decode_zip) with the ↵ai4rei1-54/+2
respective zlib library calls while keeping 3rdparty calls inside common code (follow up to r14888, related r14808). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14891 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-07* CMake: normalized variable names, added ability to create a package/installer.flaviojs1-18/+7
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14890 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-06* CMake: src/common builds static libraries common_base/common_sql, that are ↵flaviojs1-10/+125
used as dependencies by the other targets. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14889 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-06* Merged decode_zip/encode_zip from eapp's grfio to replace our direct use ↵flaviojs2-3/+75
of zlib's uncompress/compress. * Fixed strict-aliasing warning in mapcache's GetFloat. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14888 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-06* Changed grfio.c include order and moved zlib include from the header to ↵flaviojs2-9/+6
the source. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14887 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-04* Fixed 'strnlen' still causing warnings in db.c on Debian (follow up to ↵ai4rei1-1/+0
r14855). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14885 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Removed extra guards around cbasetypes.h include lines, since they give no ↵ultramage9-20/+0
performance improvement. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14876 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Reimplemented integer typedefs in cbasetypes.h in terms of standard ones in ↵ultramage1-56/+33
stdint.h. Used the INT*_C() macro to give the MIN/MAX constants a proper size suffix. Merged the 64bit integers section with the main integer section. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14875 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Added back intptr/uintptr typedefs for backwards compatibility.ultramage1-0/+7
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14874 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Replaced custom type 'intptr' with standard 'intptr_t'.ultramage6-34/+11
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-29* Added experimental support for CMake. (for now: basic build, no extras, ↵flaviojs1-0/+40
only tested with VS10 and cygwin) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14872 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-27* Added common/random and 3rdparty/mt19937ar to project files, makefiles and ↵flaviojs1-8/+17
configure script. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14870 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-26* Fixed a signed literal being assigned to an unsigned variable and other ↵ai4rei1-6/+2
minor cleanups in malloc (bugreport:4765). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14869 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-25Slightly cleaned up some ancient Brandish Spear code:ultramage1-6/+0
* remove helper 'struct square' from common/mmo.h * moved skill_castend_nodamage_id's case ML_BRANDISH to separate function git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14866 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-25* Added Mersenne Twister MT19937 as a random number generator.flaviojs2-0/+103
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14865 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-22Added enum e_skill_flag to represent the values of struct s_skill's ↵ultramage1-1/+12
complicated 'flag' field. Reordered the enum values so SKILL_FLAG_REPLACED_LV_0 goes last and arithmetic can be done on it safely (for storing skill level values). This also adds support for skill levels higher than 10. Fixed several places where SKILL_FLAG_TEMPORARY was not handled properly, and instead was considered as one of the saved skill level values (resulting in skill level -1). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14861 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-18* Fixed missing strlib.h include for compilers without own 'strnlen' ↵ai4rei1-0/+1
implementation (since r14853). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14855 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-16Moved DBMap's string maxlen parameter translation (0 -> UINT16_MAX) to its ↵ultramage2-19/+6
initialization phase, so that it runs once instead of on every hash and compare step. This will slightly speed up most strdb operations. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14854 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-16Fixed DBMap's db_dup_key to allocate only as much as necessary (bugreport:4969).ultramage1-8/+8
This reduces default eA's memory usage by about 400kB. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14853 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-16* Merges from charmerge:flaviojs7-53/+208
- Added DBMap::exists. (r14090) - Added sv_parse_next, a stepped version of sv_parse (delim-separated parser). (r14100 r14104) - Added missing fd check to do_close. (r14145) - Normalized, refactored and restructured some code (in preparation for shutdown/reconnect code). (r14145 r14150) - Changed the char select request code to allow the char-server to reject it. (player in map-server trying to go to char select) (r14150) - Added shutdown support to the servers. (incomplete) (r14152) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14851 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-05-01* Removed functions 'decode_zip' (ancient) and 'encode_zip' (from r824) from ↵ai4rei2-71/+5
grfio. These were outdated copies of zlib's 'uncompress' and 'compress' respectively (related r1530 and r5152). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14808 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-05-01* Removed auto-add feature from mapindex code, as map indexes are used for ↵ai4rei2-13/+0
save data, thus need to be constant across server starts (since r4726). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14807 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-16* Added support for visible garments/robes.ai4rei1-0/+2
- For SQL apply upgrade_svn14797.sql to upgrade table `char`; for TXT no action is necessary, as it upgrades itself. - This also fixes NPCs not being visible with clients 2011-01-11aRagexeRE+ (bugreport:4865). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14797 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-10* Added support for clients 2010-11-23aRagexeRE+ and 2011-01-11aRagexeRE+.ai4rei1-0/+1
- Servers that used packet db version 'default' until now need to be updated to use version '25'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14791 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-09* Fixed memory corruption when amount of players online approached ↵ai4rei1-4/+1
FD_SETSIZE (topic:262388, bugreport:4856, since r11897). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14781 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-08* Fixed a compile error when socket send shortlists are disabled (s->eof ↵ai4rei1-1/+1
instead of s->flag.eof) (follow up to r11930). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-04-05* Moved detection of monotonic clock support to the configure script, which ↵ai4rei1-1/+1
also checks, whether or not it actually works (bugreport:1003, related r11912 and r11983). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14767 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-20* Random accumulated tweaks and fixes.ai4rei1-1/+1
- Added a error message to npc_enable, to spot disablenpc/enablenpc/hideoffnpc/hideonnpc on non-existing NPCs (related r14750). - Replaced inlined npc_name2id code with calls to npc_name2id. - Open Buying Store skill is now exempted from noskill mapflag like Vending as well (bugreport:4815, follow up to r14713). - Fixed signed constant being returned as unsigned value in get_percentage (bugreport:4765, since r12679). - Replaced strlen checks, which checked whether or not a string is empty, with first-byte checks. - Fixed enabling 'fakename' not clearing party and guild name and cleaned up atcommand 'fakename' code. - Cleaned up party/guild name code in clif_charnameack (follow up to r14737). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-07* Cleaned up packet dumping code.ai4rei2-23/+50
- Replaced utils function 'dump' with 'WriteDump' (files) and 'ShowDump' (console), and used those to replace inlined code in clif (related r10947). - Fixed clif_parse_debug not printing anything, when it is used with a variable length packet. - Added ability to dump invalid packets through define DUMP_INVALID_PACKET (clif.c). - Removed code to dump all incoming packets, as that can be achieved with the DUMP_UNKNOWN_PACKET code as well when needed (from r1009, related r10947). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14734 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-26* Reduced MAX_GUILD_STORAGE from 1000 to 600 (like MAX_STORAGE), since ↵ai4rei1-1/+1
storage with 1000 items causes too large packets that are dropped then, which in turn gives the impression that the items are lost (follow up to r14503). - Note: When updating an existing server, keep in mind that excess items in guild storage get lost, when MAX_GUILD_STORAGE is reduced. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14725 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-19* Implemented buying store system (aka. reverse vending, purchase shop) ↵ai4rei1-1/+1
together with related skill and items, without NPCs. - For SQL apply upgrade_svn14713_log.sql to upgrade tables `picklog` and `zenylog`; for TXT no action is necessary. - Requires 2010-04-20aRagexeRE or later and can be disabled in 'conf/battle/feature.conf'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14713 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-16* Updated configure/make scripts to resolve various issues.ai4rei2-3/+6
- Added detection whether or not -fPIC switch is required when compiling shared objects (plug-ins) to resolve compile issues on 64-bit platforms (topic:208746). - Native 'strnlen' implementations are now detected and disable the one in strlib (bugreport:1261). - Define 'DB_MANUAL_CAST_TO_UNION' is now set when necessary (bugreport:1261). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14708 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-08* Added support for new delayed character deletion.ai4rei1-0/+3
- Asks for birth date associated with the account and has a waiting time of 24 hours by default (setting). - For SQL apply upgrade_svn14700.sql to upgrade table `char`; for TXT no action is necessary, as it upgrades itself. - This completes support for clients 2010-08-03aRagexeRE and later. * Updated login sql engine version, missed during `birthdate` addition (follow up to r14672). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14700 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-02* Fixed non-windows 'findfile' utils function missing a 'closedir' call ↵ai4rei1-0/+2
(bugreport:4739, since r1629). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14692 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-31* Various accumulated cleanups and fixes.ai4rei3-8/+8
- Improved the compile speed for files which include common/socket.h on windows builds (related r10471). - Moved FIFOSIZE_SERVERLINK define from common/mmo.h to common/socket.h (since it is a server connection FIFO size setting). - Fixed script command 'areamobuseskill' canceling monster's skill cast before it determined it's new target, which could be 'none' (bugreport:3272, since r13897). - Added a protection against attempts to read an empty backup / write to a full backup in skill_dance_switch as per TODO from r11347. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-31* Fixed faulty WFIFO reallocation causing memory exhaustion (bugreport:4737, ↵ai4rei1-3/+3
since r1816, related r11503, r11571, r11886 and r12232). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14689 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-28* Resolving allow/deny IP rules not working (bugreport:2632).ai4rei2-3/+3
- Fixed 'mask' being filled with 'ip' when standard mask was specified (since r9647). - Fixed 'ip' and 'mask' (bit mask) being stored in wrong byte order (network order instead of host order) (since r10162). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14683 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-23* Some cleaning here and there.ai4rei1-6/+0
- Fixed a typo in basejob_baseclass_upper sample script (since r3893). - Fixed (for sake of consistency) usage of 'sd' before corresponding nullpo check in party_invite (bugreport:2752). - Fixed atcommand config reading would not cap level for charcommands, when using atcommand level as fallback (bugreport:2961, since r13409). - Removed orphaned clif_mob_hp declaration from clif.h (bugreport:2788, since r2092). - Removed unnecessary look-up in itemdb_available macro, as dummy_item is considered unavailable. - Removed leftover shortlist linked-list struct (followup to r10507). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14680 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-15* Various accumulated insignificant fixes to documentation, examples and ↵ai4rei1-1/+1
comments. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14674 54d463be-8e91-2dee-dedb-b68131a5f0ec