summaryrefslogtreecommitdiff
path: root/src/map/map.c
AgeCommit message (Collapse)AuthorFilesLines
2015-10-11Cleanup of the HPluginData implementation (First part)Haru1-10/+2
- 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-09-28Fixed merge behaviour of map zones. Fixes #572Kpy!1-6/+10
- Both "Normal" and "PK Mode" default zones will now be overwritten (instead of merged) by "GvG", "PvP" and "Battlegrounds" zones. - Refactored some code to clarify intent.
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-104/+75
Signed-off-by: Haru <haru@dotalux.com>
2015-09-24Add bl parameter to map_searchrandfreecell and map_addflooritem.Andrei Karas1-4/+4
2015-09-24Add bl parameter to closest_freecell.Andrei Karas1-5/+5
2015-09-24Add bl parameter to getcell functions.Andrei Karas1-19/+20
2015-09-10Add to path search functions source bl for plugins usage.Andrei Karas1-3/+3
2015-09-08Fixed some memory leaks in code using libconfigHaru1-2/+2
- Special thanks to Dastgir Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Automatic HPM symbol sharingHaru1-49/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Removed some unnecessary shared symbols, already present in interfacesHaru1-4/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Moved sql_handle into the HPMi interfaceHaru1-2/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15Added core HPM interfaceHaru1-9/+9
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+3
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-15Added showmsg HPM interfaceHaru1-5/+5
- 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 socket interfaceHaru1-2/+2
- 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-12Fixed some issues reported by CoverityHaru1-1/+1
Follow-up to 5090bdf750017f0d631401edd563c452bd10ec24, 84e02ac28fbb15c58d0a0f8a916b49663198b05b Signed-off-by: Haru <haru@dotalux.com>
2015-08-10Fixed a compile error on WIN32/MSVCHaru1-3/+3
- Follow-up to 84e02ac28fbb15c58d0a0f8a916b49663198b05b - Thanks to KirieZ for pointing it out. Signed-off-by: Haru <haru@dotalux.com>
2015-08-09Removed unused tables sstatus and interregHaru1-3/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-08-09Deprecated SQL item, monster and monster skill databasesHaru1-0/+24
- The files are (and will) still be included for use in Control Panels or websites, but their use as the data source for the map server is no longer supported. Please upgrade to their text counterparts instead. Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-52/+51
- 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 (map)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-05-19Fixed some issues reported by coverity scan [3/3]Haru1-4/+1
- Automatically zeroed variables are now zeroed in the correct size, regardless of padding. - Special thanks to Ind. Signed-off-by: Haru <haru@dotalux.com>
2015-02-23Hercules Ultimate Localization Designshennetsind1-0/+22
Servers can now run on any number of languages, without editing npc files. Designed by Haruna and Ind http://hercules.ws/board/topic/8687-hercules-ultimate-localization-design/ Signed-off-by: shennetsind <ind@henn.et>
2015-01-24Fixed Bug 8395shennetsind1-57/+77
Adjusted zone merging logic to not merge items the main zone originally intended to enable (i.e. normal zone disables Velum_Jamadhar, gvg zone sets Velum_Jamadhar: false) Special Thanks to Ancyker, Michieru http://hercules.ws/board/tracker/issue-8395-map-zone-db-stacking-incorrectly-siege-gears-not-working/ Signed-off-by: shennetsind <ind@henn.et>
2015-01-24Channels refactoring: quit, leave, deleteHaru1-4/+0
Signed-off-by: Haru <haru@dotalux.com>
2015-01-24Moved the Hercules Channel System to its own file/interfaceHaru1-8/+13
Signed-off-by: Haru <haru@dotalux.com>
2015-01-22Removed name distinction between (sql) mob/item/mob_skill db and db_re variantsHaru1-9/+0
- Since there (currently and in future) is no difference between the table structure for renewal and pre-renewal databases, it makes no sense to have extra code that makes a distinction between their names. A server will always use either one or the other, never both at the same time. - If you have a mob_db_re, mob_skill_db_re and/or item_db_re table, please rename it to mob_db, mob_skill_db and/or item_db_re, respectively. - No upgrade script provided. I'd like to remind everyone that these tables are optional (and deprecated), and they are only offered for convenience for those who need them for web control panels and similar software. Signed-off-by: Haru <haru@dotalux.com>
2015-01-20Minor fixes and tweaks suggested by cppcheckHaru1-20/+18
- 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-18Command line arguments handling overhaulHaru1-162/+201
- login_server, char_server, map_server as well as the tools (mapcache) now have a common command line arguments handling mechanism. - All of them now accept `--help` (`-h`), `--version` (`-v`) and `--load-plugin`. - login_server now accepts `--login-config` and `--lan-config` instead of relying on positional arguments to override those files. The old syntax will no longer work, please update your custom startup scripts. - char_server now accepts `--char-config`, `--inter-config`, `--lan-config` instead of relying on positional arguments. The old syntax will no longer work, please update your custom startup scripts. - mapcache now accepts `--grf-list`, `--map-list`, `--map-cache`, `--rebuild` in place of, respectively, `-grf`, `-list`, `-cache`, `-rebuild`. - A new macro `CMDLINEARG()` is provided, to help defining new command line argument handlers (i.e. in plugins). the `addArg()` call is still required, but its syntax has changed. The `help` argument is now of type `const char *` rather than a function pointer, and it is supposed to contain the message to show in the `--help` screen. Pass `NULL` if no help message is desired. Signed-off-by: Haru <haru@dotalux.com>
2015-01-18Fixing 38 issuesshennetsind1-3/+3
Addressing out of bounds read/write, pointless null checks on already deferenced variables, dead code. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2015-01-17Another ~10 Fixesshennetsind1-1/+1
Addressing out of bounds read/write, resource leaks. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
2015-01-1710 Distinct fixesshennetsind1-22/+22
Addressing out of bounds read-write. Special Thanks to 4144, Haruna! Signed-off-by: shennetsind <ind@henn.et>
2014-12-31Improve performance a bit by removing strlen(str) > 0.Andrei Karas1-1/+1
2014-12-31fix wrong check.Andrei Karas1-1/+1
2014-12-31Add some missing null pointer checks after automatic checks.Andrei Karas1-30/+34
2014-12-28Split mob sql database into mob_db and mob_db_re.malufett1-4/+10
-http://hercules.ws/board/topic/8084-separate-the-mob-db-and-mob-db-re/
2014-12-26Allowed flag values of map_count_oncell to stackHaru1-34/+30
- Follow-up to ea34b80 - It is now possible to stack 0x1|0x2 as a valid flag value. Signed-off-by: Haru <haru@dotalux.com>
2014-12-21Fixed Bug#8458malufett1-10/+27
-http://hercules.ws/board/tracker/issue-8458-sgs-running-and-gm-hide/?gopid=24216#entry24216 Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
2014-12-14Fixed some improper grammar.Mysteries1-1/+1
2014-12-06Merge pull request #405 from 4144/clifextHaruna1-3/+3
Extend clif.c
2014-12-06into mapindex add variable with default map and position.Andrei Karas1-3/+3
2014-12-06add channels config into clif interface.Andrei Karas1-3/+3
2014-11-26AIHOHAAAAAAA (!!!!) addressing susus interfacing thing overlookshennetsind1-7/+1
Signed-off-by: shennetsind <ind@henn.et>
2014-11-16Whitespace cleanup (no code changes)Haru1-35/+31
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-15Add support for plugin options in map server config (inter-server.conf).Andrei Karas1-0/+2
2014-11-03HPM Hooks UpdateHercules.ws1-94/+94
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
2014-11-03* No cell stacking implemented (official version)Michieru1-9/+105
- Split config cell_stack_limit into custom_cell_stack_limit (previous feature) and official_cell_stack_limit (see below) - Expanded map_count_oncell by a flag parameter, currently only one flag is supported: only count standing units (needed for official cell stack feature) - Added a new function map_closest_freecell that will return the closest free cell using the same order that official servers use - Monsters will now actively search for a free cell when starting to walk randomly and when unlocking target - When any unit finishes walking (regularly) and is not on a free cell, it will now actively search for a free cell - Step actions will be delayed until a suitable cell was found, they will even be executed when the player walked slightly out of attack range - Monsters will now stop instantly if their target is completely non-existent * This is mainly for looters that had their loot taken * Hide and most other situations still use the configuration setting monster_chase_refresh Mega Thanks to Playtester
2014-10-28Added preliminary support for login and char server in the HPMDataCheckHaru1-3/+0
- Special thanks to Ind Signed-off-by: Haru <haru@dotalux.com>
2014-10-26- Can't cast icewall more than once on the same center cell. Special thanks ↵Michieru1-0/+4
to Ind - Service for you now work properly on all skill level. - Fixed a problem that sometimes randomly a status change was removed on logout although it shouldn't. Special thanks to Playtester
2014-10-18Fix bug:7454Michieru1-13/+12
* Official Icewall implementation and other fixes - Reverted all the icewall-related changes done in SVN r15777 and following as testing shows they aren't official and are actually pretty exploitable (bugreport:7412) - Instead implemented the official icewall characteristic that monsters can only leave an icewall cell to the west or south, the changes include: * The "sight" path check no longer checks for the current cell so standing on an icewall allows you to see/attack into any direction * The path finding will still ignore the current cell as before but the walk routine will not allow to walk east or north while standing on an icewall cell * This leads monsters in the situation where they go through an AI loop not allowing them to escape the icewall (if their target is north or east of them) * Monster in this situation will use idle skills and if they get attacked will use their rudeattacked skills if available, similar to traps like Spiderweb * Added a configuration icewall_walk_block that allows to configure how long a monster should go through the AI loop before the server allows it any movement, this "safety" system is official and seems to equal about 75 AI loops; if you want to disable the whole icewall system so that monsters don't get stuck in icewall at all, just set this to 0 * Here are videos from jRO showing how this system works: http://ragdo.blog56.fc2.com/blog-entry-763.html - Implemented the official calculation for "direction"; now you will be considered horizontal/vertical/diagonally aligned with a target cell in the exact same way as on official servers, this is for example used to determine whether an icewall or a firewall should be horizontal, vertical or diagonal; the only thing that is still unofficial is the default direction (officially always "west"); effectively now there are more situations considered diagonal than before - Further cleanups on the idle skill use code for immobile monsters and monsters near a player but without a target (now skill using will always go via mob_unlocktarget) * This also fixes that monsters switched to idle mode and start to use idle skills one second too late Mega thanks to Playtester (rathena 5540d89cb0e)