summaryrefslogtreecommitdiff
path: root/src/map/storage.c
AgeCommit message (Collapse)AuthorFilesLines
2021-03-08[TMW2] Hercules Ultimate Storage SystemJesusaves1-86/+315
2018-12-14Add inventory size field into db and using it in server.Andrei Karas1-2/+2
2018-09-19Update storage packet for 2018-08-29 RE.Andrei Karas1-2/+2
2018-08-23Add packet PACKET_ZC_INVENTORY_MOVE_FAILED.Andrei Karas1-2/+4
2018-07-01Change functions to static where possible (Part 4 - map)Haru1-73/+73
This fixes issues with plugins defining symbols with the same names Signed-off-by: Haru <haru@dotalux.com>
2018-05-312012-2018 !Maytichai Saowa1-1/+1
2017-09-19remove trailing whitespaces from sourcegumi1-2/+2
2017-05-30Fix saving of storage for non-stackable items.smokexyz1-0/+2
Thanks to @MishimaHaruna for the fix.
2017-05-30Fix storage saving checks and amount update.smokexyz1-0/+2
Special thanks to @MishimaHaruna for the fix.
2017-05-22Add storage_data reception, parsing and sending to/from the map-server.Smokexyz1-71/+136
Remove loading and saving of storage_data through char.c Re-declaration of structure storage_data as a vector. Re-code of portions in the map-server using storage_data. A new approach is taken by saving the loaded storage data from sql into memory for the duration of the session, thereby removing the need of querying the database to re-load all items everytime a storage save routine is issued from the map-server. Saving of storage items is done through a new function that significantly reduces the number of queries compared to char_memitemdata_tosql(), and therefore run-time speed. This method potentially reduces the number of update and delete queries from MAX_STORAGE (which could be >= 600) times to literally 1. Storage items are stored in a dynamically allocated array and handled accordingly. struct mmo_charstatus size reduces by 34,800 bytes. Update pc_checkitem() with masks for item checks. `sd->state.itemcheck` has been changed to `sd->itemcheck` of type `enum pc_checkitem_types` `battle/items.conf` has been updated to reflect configuration changes. Further updates to assert a successful reception of storage data in related functions.
2017-04-04Implementation of Item Options System.Smokexyz1-3/+6
Allows the infusing of equipments with bonus item options. This feature is constrained to clients of packet versions greater than or equal to `20150226`. Item Options and their effects are defined server-side in `db/item_options.conf` and client side in `data/luafiles514/lua files/datainfo/addrandomoptionnametable.lub` The ID of the option must tally with the correct index of the description provided in the client side lua file to avoid bugs. IT_OPT_* keys and MAX_ITEM_OPTIONS macro are also exported from the source as constants. An additional flag `disable_options` has been added to sql, and as `DisableOptions: true/false (boolean, defaults to false !!for equipments only!!)` to item_db.conf files. Script commands documentation is also included. SQL file updates are included. Credits: [Smokexyz](https://github.com/Smokexyz) Style and Script Fixes by [Asheraf](https://github.com/Asheraf) Initial design Idea by [secretdataz](https://github.com/secretdataz)
2016-10-28Fixed copyright year for 2016Lemongrass31101-1/+1
2016-09-19Add missing checks into storage.cAndrei Karas1-14/+39
2016-07-25Added a missing entry into messages.conf and added some comments where ↵epuncker1-6/+6
missing, ref #1282
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Added const qualifier to some typecastsHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-02-19Fix some cast discards 'const' qualifier from pointer target type warnings.Andrei Karas1-2/+2
Add -Wcast-qual into configure comment.
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-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-07-08Update Unique ID system to match official now it cover all cash items ↵Ibrahim Hossam1-1/+3
include stackable ones. Implement ForceSerial option in Package Item Database to force serial for any item. Implement ForceSerial option in item database to force serial for any item. Implement Merge Client interface to merge stackable items with serial numbers ( check npc/other/item_merge.txt ).
2015-06-19Removed ".." from include directivesHaru1-15/+15
- 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-16/+18
- 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-02-23Hercules Ultimate Localization Designshennetsind1-6/+6
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>
2014-11-16Whitespace cleanup (no code changes)Haru1-72/+72
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-10-05Follow up a46b190764df4cce0b378bc691218ac0814a5673shennetsind1-15/+9
Dropped id2storage entirely, replaced with idb_get (1) it was redundant 2) the rename on a46b190764df4cce0b378bc691218ac0814a5673 was a very poor choice as plugins using the previous version would be calling the other). Signed-off-by: shennetsind <ind@henn.et>
2014-10-05Follow up b9b32ac7609eshennetsind1-8/+8
Fixes issue where kicking a online guild member (on a server with GP_BOUND_ITEMS defined) would render the guilds storage (if not previously loaded during the servers lifespan (since boot)) to be wiped. Special Thanks to Xgear! Signed-off-by: shennetsind <ind@henn.et>
2014-07-11Fixed reserved __identifier violationsHaru1-3/+3
- Complies with CERT DCL37-C - Fixes issue #293 (special thanks to elfring) Signed-off-by: Haru <haru@dotalux.com>
2014-06-27Removed Unused Include.Potte1-1/+0
Signed-off-by: Shido <the.keikun@gmail.com>
2014-05-30Fixed typos inside src/Shido1-5/+5
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-15/+17
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-17/+15
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-09Fixed order of includes in all source filesHaru1-15/+17
- Changed order according to the (upcoming) code style guidelines. - Fixes several issues caused by missing headers when their include order is changed or in plugins. Signed-off-by: Haru <haru@dotalux.com>
2013-12-15Replaced pc->pc_has_permission/can_give_items/can_give_bound_items with ↵shennetsind1-4/+4
equivalent macros Because 2/3 jumps to perform such a operation is just awful Signed-off-by: shennetsind <ind@henn.et>
2013-12-14Replaced pc->get_group_level with a macro (pc_get_group_level)shennetsind1-2/+2
Because 2 jumps to get a single value is just awful. Signed-off-by: shennetsind <ind@henn.et>
2013-11-07Further item bind adjustmentsshennetsind1-2/+2
Thanks to Haruna! Signed-off-by: shennetsind <ind@henn.et>
2013-11-07Item Bound Fixes/Adjustments/Improvementsshennetsind1-3/+5
Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
2013-11-06Merge remote-tracking branch 'origin/master'shennetsind1-3/+14
Signed-off-by: shennetsind <ind@henn.et> Conflicts: conf/messages.conf src/common/mmo.h src/map/pc_groups.c src/map/pc_groups.h
2013-11-05Introducing the Hercules Standalone Script Syntax CheckerHaru1-1/+3
- Added a command line argument '--script-check' to check a script's syntax without running the server (and without requiring a SQL connection). Usage: ./map-server --script-check /path/to/the/script.txt - For convenience, a script-checker bash script is provided, to set the path correctly when called from a different directory. Usage: /path/to/Hercules/script-checker /path/to/the/script/to/check.txt - While the script checker will supposedly work under windows as well, no convenience scripts are currently provided for platforms other than UNIX (feel free to open a pull request with a .bat launcher or whatever you like) - Integration with IDEs or text editors is possible. In fact, I already have a fully functional plugin for vim (through vim-syntastic), and if there's enough interest, I'll publish it. - screenshot: http://d.pr/i/NOBD - If you want an online checker, http://haru.ws/scriptchecker/ is running this code, without modifications and will be kept up to date (without any warranty though.) - Special thanks to Ind, Yommy, Streusel, who helped making this possible, in a way or another.
2013-10-31No error after compilation, but when logging in at map server it will crash.sevenzz231-3/+14
Im pretty sure its on the clif.c Signed-off-by: sevenzz23 <sevenzz23@yahoo.com>
2013-10-04Fixed Storage AddItem Bugshennetsind1-2/+3
Fixed a ancient bug where trying to add a item to a full storage would render the item un-draggable (server was failing to respond properly). Thanks to Sanasol for bringing it up. Signed-off-by: shennetsind <ind@henn.et>
2013-09-28HPM: Storage.c Completedshennetsind1-24/+23
Moved missing declarations of interest into the interface, init/final from storage into gstorage Signed-off-by: shennetsind <ind@henn.et>
2013-09-27Renamed iMap interface to mapHaru1-17/+12
Signed-off-by: Haru <haru@dotalux.com>
2013-09-17HPM: Itemdb.c Interfaceshennetsind1-2/+2
Fully Integrated. Closes #110 Signed-off-by: shennetsind <ind@henn.et>
2013-07-29Added intif interfaceSusu1-2/+2
2013-07-17Added missing initialization of some functions in the homunculus interfaceHaru1-1/+1
- Fixes issue #7536 (thanks to jTynne for the report) http://hercules.ws/board/tracker/issue-7536-map-crash-july-15th/ - Minor corrections to the other interfaces as well (reordered initialization to follow the definitions, removed duplicate entry in the skill interface initialization, commented out some unused entries) Signed-off-by: Haru <haru@dotalux.com>
2013-07-11Fix to Bug #7434shennetsind1-3/+7
Fixing a ancient bug where placing a item from inventory to cart when cart is full would render such item un-clickable, same for when doing so from storage to cart. Special Thanks to Yommy for all the data, jTynne for bringing this up. http://hercules.ws/board/tracker/issue-7434-weightinability-to-click-item-issue/ Signed-off-by: shennetsind <ind@henn.et>
2013-07-01Fixed Bug #7216shennetsind1-0/+3
Special Thanks to Shikazu, wouldn't have been able to identify this issue without his help! http://hercules.ws/board/index.php?app=tracker&showissue=7216 Signed-off-by: shennetsind <ind@henn.et>
2013-06-25- Added chrif interfaceSusu1-6/+6
2013-06-23Official Item Group/Package/Chainshennetsind1-23/+17
http://hercules.ws/board/topic/1244-official-item-grouppackagechain/ Also Further implemented itemdb.c/storage.c interfaces, and a minor update to db2sql plugin. Signed-off-by: shennetsind <ind@henn.et>