123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
- // For more information, see LICENCE in the main folder
- #ifndef PACKETS_HPP
- #define PACKETS_HPP
- #pragma warning( push )
- #pragma warning( disable : 4200 )
- // Required for MESSAGE_SIZE, TALKBOX_MESSAGE_SIZE
- #include "map.hpp"
- #define MAX_ITEM_OPTIONS MAX_ITEM_RDM_OPT
- #define UNAVAILABLE_STRUCT int8 _____unavailable
- /* packet size constant for itemlist */
- #if MAX_INVENTORY > MAX_STORAGE && MAX_INVENTORY > MAX_CART
- #define MAX_ITEMLIST MAX_INVENTORY
- #elif MAX_CART > MAX_INVENTORY && MAX_CART > MAX_STORAGE
- #define MAX_ITEMLIST MAX_CART
- #else
- #define MAX_ITEMLIST MAX_STORAGE
- #endif
- #define MAX_ACHIEVEMENT_DB MAX_ACHIEVEMENT_OBJECTIVES
- #define DEFINE_PACKET_HEADER(name, id) const int16 HEADER_##name = id;
- #include "packets_struct.hpp"
- // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
- #if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 )
- #pragma pack( push, 1 )
- #endif
- struct PACKET_CZ_REQ_MAKINGARROW{
- int16 packetType;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- } __attribute__((packed));
- struct PACKET_CZ_SE_PC_BUY_CASHITEM_LIST_sub{
- uint32 itemId;
- uint32 amount;
- uint16 tab;
- } __attribute__((packed));
- struct PACKET_CZ_SE_PC_BUY_CASHITEM_LIST{
- int16 packetType;
- int16 packetLength;
- uint16 count;
- uint32 kafraPoints;
- struct PACKET_CZ_SE_PC_BUY_CASHITEM_LIST_sub items[];
- } __attribute__((packed));
- struct PACKET_CZ_REQ_CASH_BARGAIN_SALE_ITEM_INFO{
- int16 packetType;
- int16 packetLength;
- uint32 AID;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- };
- struct PACKET_ZC_ACK_CASH_BARGAIN_SALE_ITEM_INFO{
- int16 packetType;
- uint16 result;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- uint32 price;
- };
- struct PACKET_CZ_REQ_APPLY_BARGAIN_SALE_ITEM{
- int16 packetType;
- uint32 AID;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- uint32 amount;
- uint32 startTime;
- #if PACKETVER >= 20150520
- uint16 hours;
- #else
- uint8 hours;
- #endif
- };
- struct PACKET_CZ_REQ_REMOVE_BARGAIN_SALE_ITEM{
- int16 packetType;
- uint32 AID;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- };
- struct PACKET_ZC_NOTIFY_BARGAIN_SALE_SELLING{
- int16 packetType;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- uint32 remainingTime;
- };
- struct PACKET_ZC_NOTIFY_BARGAIN_SALE_CLOSE{
- int16 packetType;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- };
- struct PACKET_ZC_ACK_COUNT_BARGAIN_SALE_ITEM{
- int16 packetType;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- uint32 amount;
- };
- struct PACKET_ZC_ACK_GUILDSTORAGE_LOG_sub{
- uint32 id;
- #if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
- uint32 itemId;
- #else
- uint16 itemId;
- #endif
- int32 amount;
- uint8 action;
- int32 refine;
- int64 uniqueId;
- uint8 IsIdentified;
- uint16 itemType;
- struct EQUIPSLOTINFO slot;
- char name[NAME_LENGTH];
- char time[NAME_LENGTH];
- uint8 attribute;
- };
- struct PACKET_ZC_ACK_GUILDSTORAGE_LOG{
- int16 packetType;
- int16 PacketLength;
- uint16 result;
- uint16 amount;
- struct PACKET_ZC_ACK_GUILDSTORAGE_LOG_sub items[];
- };
- struct PACKET_EFST_SET_ENTER {
- int16 PacketType;
- uint32 GID;
- uint16 type;
- uint32 remaining;
- #if PACKETVER >= 20120618
- uint32 total;
- #endif
- int32 val1;
- int32 val2;
- int32 val3;
- };
- // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
- #if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 )
- #pragma pack( pop )
- #endif
- DEFINE_PACKET_HEADER(CZ_REQMAKINGITEM, 0x18e)
- DEFINE_PACKET_HEADER(CZ_REQ_MAKINGARROW, 0x1ae)
- DEFINE_PACKET_HEADER(CZ_REQ_ITEMREPAIR, 0x1fd)
- DEFINE_PACKET_HEADER(CZ_REQ_MAKINGITEM, 0x25b)
- DEFINE_PACKET_HEADER(CZ_REQ_CASH_BARGAIN_SALE_ITEM_INFO, 0x9ac)
- DEFINE_PACKET_HEADER(ZC_ACK_CASH_BARGAIN_SALE_ITEM_INFO, 0x9ad)
- DEFINE_PACKET_HEADER(CZ_REQ_APPLY_BARGAIN_SALE_ITEM, 0x9ae)
- DEFINE_PACKET_HEADER(CZ_REQ_REMOVE_BARGAIN_SALE_ITEM, 0x9b0)
- DEFINE_PACKET_HEADER(ZC_NOTIFY_BARGAIN_SALE_SELLING, 0x9b2)
- DEFINE_PACKET_HEADER(ZC_NOTIFY_BARGAIN_SALE_CLOSE, 0x9b3)
- DEFINE_PACKET_HEADER(ZC_ACK_COUNT_BARGAIN_SALE_ITEM, 0x9c4)
- DEFINE_PACKET_HEADER(ZC_ACK_GUILDSTORAGE_LOG, 0x9da)
- DEFINE_PACKET_HEADER(CZ_REQ_APPLY_BARGAIN_SALE_ITEM2, 0xa3d)
- #if PACKETVER >= 20120618
- DEFINE_PACKET_HEADER(ZC_EFST_SET_ENTER, 0x984)
- #elif PACKETVER >= 20111108
- DEFINE_PACKET_HEADER(ZC_EFST_SET_ENTER, 0x8ff)
- #endif
- const int16 MAX_INVENTORY_ITEM_PACKET_NORMAL = ( ( INT16_MAX - ( sizeof( struct packet_itemlist_normal ) - ( sizeof( struct NORMALITEM_INFO ) * MAX_ITEMLIST) ) ) / sizeof( struct NORMALITEM_INFO ) );
- const int16 MAX_INVENTORY_ITEM_PACKET_EQUIP = ( ( INT16_MAX - ( sizeof( struct packet_itemlist_equip ) - ( sizeof( struct EQUIPITEM_INFO ) * MAX_ITEMLIST ) ) ) / sizeof( struct EQUIPITEM_INFO ) );
- const int16 MAX_STORAGE_ITEM_PACKET_NORMAL = ( ( INT16_MAX - ( sizeof( struct ZC_STORE_ITEMLIST_NORMAL ) - ( sizeof( struct NORMALITEM_INFO ) * MAX_ITEMLIST) ) ) / sizeof( struct NORMALITEM_INFO ) );
- const int16 MAX_STORAGE_ITEM_PACKET_EQUIP = ( ( INT16_MAX - ( sizeof( struct ZC_STORE_ITEMLIST_EQUIP ) - ( sizeof( struct EQUIPITEM_INFO ) * MAX_ITEMLIST ) ) ) / sizeof( struct EQUIPITEM_INFO ) );
- const int16 MAX_GUILD_STORAGE_LOG_PACKET = ( ( INT16_MAX - sizeof( struct PACKET_ZC_ACK_GUILDSTORAGE_LOG ) ) / sizeof( struct PACKET_ZC_ACK_GUILDSTORAGE_LOG_sub ) );
- #undef MAX_ITEM_OPTIONS
- #undef UNAVAILABLE_STRUCT
- #undef MAX_ITEMLIST
- #undef MAX_ACHIEVEMENT_DB
- #undef MAX_PACKET_POS
- #undef DEFINE_PACKET_HEADER
- #pragma warning( pop )
- #endif /* PACKETS_HPP */
|