2018-07-26 14:09:09 +02:00
|
|
|
#ifndef _INVENTORY_SLOT_UPDATE_PACKET_H
|
|
|
|
#define _INVENTORY_SLOT_UPDATE_PACKET_H
|
|
|
|
|
2019-03-08 15:34:38 +01:00
|
|
|
#include <Network/GamePacket.h>
|
2018-07-26 14:09:09 +02:00
|
|
|
#include "Actor/Player.h"
|
|
|
|
#include "Inventory/Item.h"
|
|
|
|
#include "Forwards.h"
|
|
|
|
|
2021-11-27 00:53:57 +01:00
|
|
|
namespace Sapphire::Network::Packets::WorldPackets::Server
|
2018-07-26 14:09:09 +02:00
|
|
|
{
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
/**
|
|
|
|
* @brief The update inventory-slot packet.
|
|
|
|
*/
|
2021-11-27 00:53:57 +01:00
|
|
|
class UpdateInventorySlotPacket : public ZoneChannelPacket< FFXIVIpcNormalItem >
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2018-10-28 21:53:21 +01:00
|
|
|
public:
|
2021-11-27 00:53:57 +01:00
|
|
|
UpdateInventorySlotPacket( uint32_t playerId, uint16_t slot, uint16_t storageId, const Item& item, uint32_t contextId ) :
|
|
|
|
ZoneChannelPacket< FFXIVIpcNormalItem >( playerId, playerId )
|
2018-10-28 21:53:21 +01:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
initialize( slot, storageId, item, contextId );
|
2020-05-11 06:25:25 +09:00
|
|
|
};
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
private:
|
2021-11-27 00:53:57 +01:00
|
|
|
void initialize( uint16_t slot, uint16_t storageId, const Item& item, uint32_t contextId )
|
2020-05-11 06:25:25 +09:00
|
|
|
{
|
2021-11-27 00:53:57 +01:00
|
|
|
m_data.contextId = contextId;
|
|
|
|
m_data.item.storageId = storageId;
|
|
|
|
m_data.item.catalogId = item.getId();
|
|
|
|
m_data.item.stack = item.getStackSize();
|
|
|
|
m_data.item.containerIndex = slot;
|
|
|
|
m_data.item.flags = static_cast< uint8_t >( item.isHq() ? 1 : 0 );
|
|
|
|
m_data.item.refine = item.getSpiritbond();
|
|
|
|
m_data.item.stain = static_cast< uint8_t >( item.getStain() );
|
|
|
|
m_data.item.signatureId = 0;
|
2020-05-11 06:25:25 +09:00
|
|
|
};
|
2018-08-29 21:40:59 +02:00
|
|
|
};
|
2018-07-26 14:09:09 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /*_MODELEQUIPPACKET_H*/
|