summaryrefslogtreecommitdiff
path: root/src/net/manaserv/inventoryhandler.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-07-04Added logging priorities and use SDLs logging facilitiesThorbjørn Lindeijer1-7/+6
By using SDL logging, we can rely on SDL to filter the log messages by their priority before they get sent to our custom output function. For example, we now no longer get entries for created and destroyed Window instances by default, since these have only "debug" priority whereas the default priority for the "app" category is "info". We can also get log messages raised by SDL itself in our log now. Log levels can be controlled per category through the "SDL_LOGGING" environment variable. Many existing log messages have been assigned a category based on their existing prefix.
2025-04-25GUI: Added support for defining named icons to the themeThorbjørn Lindeijer1-9/+8
Now we can define icon names for each equipment box and then look up the icon image through the theme, enabling some shared control over equipment slot icons between the game data and GUI theme. The icon for an equipment slot is also no longer rendered when the slot has an item in it. Removed the needless storing of equipment box positions and images in the EquipmentWindow, because this information is readily available from the InventoryHandler and the images are already loaded by the Theme.
2025-03-07Removed the functionality to split item stacksThorbjørn Lindeijer1-5/+0
No longer supported by manaserv and not supported by tmwAthena.
2025-03-07Fixed handling of equipmentThorbjørn Lindeijer1-9/+7
* Fixed ManaServ::EquipBackend removing all slots in response to GPMSG_INVENTORY_FULL, rather than resetting them to empty. * Fixed updating of buttons in InventoryWindow as relevant from the ManaServ::InventoryHandler. * Updated handling of equipment sprites in messages related to character appearance (Manaserv now always sends all relevant equipment and as such does not send removals).
2025-03-07Updated manaserv protocol to version 9Thorbjørn Lindeijer1-204/+54
This extends the messages regarding abilities, replacing the specific "attack" messages. It also unifies attribute handling, with a generic system replacing specific variables for attributes like level, xp and skills. The inventory and equipment handling was adjusted such that equipped items stay in the inventory. Support for quest states was added. Added: * GPMSG_ABILITY_REMOVED (mana/manaserv@e3fcc1a47db312933a0f5b7e725c5779a1a45722) * GPMSG_ABILITY_COOLDOWN (mana/manaserv@c2f00b2f3ba920cb25333d19a1d37d251342caf8) * GPMSG_BEING_ABILITY_POINT * GPMSG_BEING_ABILITY_BEING (mana/manaserv@2f2393b6d190deb8958fcb806b58418508d25e28) * GPMSG_ATTRIBUTE_POINTS_STATUS (mana/manaserv@1e5a15c0a5e24fb4b358fff75a7082d65496e1f9) * PGMSG_USE_ABILITY_ON_DIRECTION (mana/manaserv@05fc955a3f8a03539088fa7569395434e29d90e8) * GPMSG_BEING_ABILITY_DIRECTION (mana/manaserv@54389afd7ba9fecf0761333185145e968e2453ae) * GPMSG_QUESTLOG_STATUS (mana/manaserv@66a98a3a0df795761328d62ef2ad07f81e383f9e) Removed: * PGMSG_ATTACK * GPMSG_BEING_ATTACK (mana/manaserv@f31277b327df701361391b1d4b8bd6f89f4e3109) * GPMSG_PLAYER_EXP_CHANGE * GPMSG_LEVELUP * GPMSG_LEVEL_PROGRESS (mana/manaserv@44ee071d7ece5a2023f79307f36e8a244c9e7b3a) Changed: * GPMSG_ABILITY_STATUS (mana/manaserv@ba573fcc38580a01985172b9bc864c97ce855af3) * GPMSG_BEING_LOOKS_CHANGE (mana/manaserv@8ddda85d923a528c7497a628d2fe10fc40b80a1f) * APMSG_CHAR_INFO (mana/manaserv@4f5053f463fd8da0de1615ca6b0f212f02f3d653) * APMSG_CHAR_CREATE_RESPONSE (mana/manaserv@1263c729d85df649c7ab59726bddad7c8cd7ae81) * GPMSG_NPC_BUYSELL_RESPONSE (mana/manaserv@336ce321a9b996e56a61a5364bb32124efa84dd9) Equipment changes (mana/manaserv@f712d68495dd8e040c32da3b1c85bcb7845543ec): * Changed GPMSG_INVENTORY_FULL, GPMSG_EQUIP * Removed PGMSG_MOVE_ITEM * Added GPMSG_EQUIP_RESPONSE, GPMSG_UNEQUIP_RESPONSE, GPMSG_UNEQUIP While this change deals with some of the protocol changes, there's still many changes required in the UI regarding using of abilities (including attacking), showing of certain attributes and quest log.
2025-01-20Wrapped xmlNodePtr access with a Node classThorbjørn Lindeijer1-16/+16
Slightly more ergonomic and this eliminates direct libxml2 usage from many places.
2024-09-27Replaced for_each_xml_child_node macro with helper classThorbjørn Lindeijer1-2/+2
The new XML::Children class enables using a C++11 range-based for loop to iterate over the children of an xmlNodePtr.
2024-08-25Fixed initialization of equipment backendThorbjørn Lindeijer1-15/+7
For new characters (and in general, when logging in with a character that had nothing equipped), the equipment backend wasn't being initialized. This resulted in the equipment not being visible in the Equipment window. Fixes #83
2024-01-29Apply C++11 fixitsThorbjørn Lindeijer1-13/+10
modernize-loop-convert modernize-deprecated-headers
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-13/+13
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-05-05Removed the shared base classes of MessageIn and MessageOutThorbjørn Lindeijer1-1/+1
There wasn't a whole lot gained by sharing a common base class, and it makes extending the manaserv Message{In,Out} classes with a debugging mode unnecessarily complicated. Reviewed-by: Yohann Ferreira
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2011-11-13Added background support to the equipment boxes.Yohann Ferreira1-0/+11
The background images are auto-centered. Also, for Manaserv, a new background parameter has been added in the box node of the equip.xml file to specify the background image. Note that the filename is relative to the gui theme folder. Reviewed-by: Thorbjorn Lindeijer Resolves: TMW-Mantis #769.
2011-08-30Fixed a memleak in the ManaServ::InventoryHandler()Yohann Ferreira1-0/+5
2011-08-30Added a way to specify where the equipment boxes will display.Yohann Ferreira1-8/+32
A <box> sub tag was added to the <slot> tag with a x and y parameter to do so.
2011-08-19Fixed visible equipment updates, and made it based on equip.xml.Yohann Ferreira1-0/+29
2011-08-18Made the equipment window not use server specific code again.Yohann Ferreira1-0/+3
I also made the number of slots displayed taken from the equip.xml file for manaserv.
2011-08-18Made the client able to successfully equip/unequip!Yohann Ferreira1-74/+143
2011-08-11Adapted the client to the latest server changes.Yohann Ferreira1-39/+85
There are two bugs left I'll take care about in the near future: - Items dealing with more than one slot capacity are only showing on the first equip slot. - The unequip button doesn't get updated when clicking on the equipped item. A client design limitation known: - The client still don't handle correctly items applied on more than one item type at equip time.
2011-07-27Followed server protocol changes.Yohann Ferreira1-16/+17
Also documented a TODO.
2011-06-02Some work on the manaserv equipment backendThorbjørn Lindeijer1-16/+145
Currently the same equipment window is used as for tmwAthena so that at least something is visible. This means the location of equipped items is currently illogical. It is now possible to equip and unequip items. Mantis-issue: 164 Reviewed-by: Stefan Dombrowski
2011-04-09Removed the Mana namespaceThorbjørn Lindeijer1-10/+10
It's just an annoyance when it's only applied to a few classes. Either we place everything in this namespace or nothing, and at the moment I don't see any rationale for placing everything in a Mana namespace. Acked-by: Jared Adams
2011-04-09Moved Channels to Mana::Event::ChannelThorbjørn Lindeijer1-3/+3
Acked-by: Jared Adams
2011-04-09Moved Events to Mana::Event::TypeThorbjørn Lindeijer1-6/+6
Acked-by: Jared Adams
2010-12-30Renamed protocol.h to manaserv_protocol.h to follow server's changes.Yohann Ferreira1-1/+1
I'll sync the two files as for the new enums in a separate commit. Trivial fix. Resolves: Mana-mantis #278.
2010-11-11Replace Event names with enums instead of stringsChuck Miller1-6/+6
2010-11-11Have the event system channels use enums instead of stringsChuck Miller1-3/+3
Reviewed-by: Freeyorp
2010-08-26Merged testing branch into master.Yohann Ferreira1-21/+43
2010-08-16Move more to the event systemJared Adams1-71/+81
Most of Net::InventoryHandler is now done through events. The ActorSpriteManager was also replaced by events. A few odds and ends were taken care of too. Reviewed-by: Bertram
2010-08-04Remove some unused headers and fix some chat eventsJared Adams1-5/+0
Reviewed-by: Chuck Miller
2010-07-18Move more from LocalPlayer to PlayerInfoJared Adams1-5/+5
Also cleanup PlayerInfo a bit. Reviewed-by: Chuck Miller
2010-07-17Modify how attributes and stats are handledChuck Miller1-1/+2
Handling moved from LocalPlayer to PlayerInfo class Event system used to update windows Reviewed-by: Jared Adams
2010-03-25Remove the type boolean from InventoryWindowJared Adams1-9/+9
This moves inventory/storage type into the Inventory class, having size default to a call to the netcode to get the sive for the given type. Reviewed-by: Chuck Miller
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-19Fixed a crash when trying to switch serversThorbjørn Lindeijer1-3/+3
Ownership of the charInfo global variable wasn't well defined. It was being locked, unlocked and generally modified from a lot of places, and somewhere in this mess it ended up crashing when switching servers. Now the CharHandler instances, for eAthena and manaserv respectively, own this list of characters. A new class, Net::Character wraps up the slot index in combination with the player dummy. The list is passed on to the CharSelectDialog each time it changes. Both related and unrelated cleanups were made as well. Reviewed-by: Jared Adams
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2010-01-12Standardize header orderJared Adams1-5/+5
Also remove some extra new lines and fix eAthena's PartyTab define guards.
2009-12-08Fix handling of an enum switchJared Adams1-2/+1
Removes warnings on older compilers.
2009-12-07Simplify Equipment handlingJared Adams1-2/+3
Also merge eAthena's EquipmentHandler and InventoryHander. Fixes http://mantis.themanaworld.org/view.php?id=888 .
2009-12-02Centralize netcode handler instances in NetJared Adams1-1/+1
Instead of each netcode making the global variables and Net referencing them, Net now makes them and the netcodes reference them. Also remove an innappropriate ChatHandler reference from eA's AdminHandler.
2009-11-07More eAthena guild stuffJared Adams1-10/+15
Also some related chenges elsewhere
2009-11-03Simplify ManaServ netcode some moreJared Adams1-10/+17
2009-11-03Remove more _SUPPORT ifdefs and do some cleanupJared Adams1-12/+20
2009-10-24REplace instances of TMW with ManaJared Adams1-0/+167