Rename shop currency and vouchers to points, synchronize the wiki catalogue, and display point rewards. Add wear40 item metadata transport and pet identity accessors; stage sixteen timed mounts and appearance items with AVA2 model registration. Include build and sbtest acceptance evidence. Remaining shop systems are unfinished and are not enabled or deployed. Wear40 requires the matching server migration and mt20261022 client.
33 lines
1.3 KiB
C++
33 lines
1.3 KiB
C++
#pragma once
|
|
#include <stdint.h>
|
|
#include <string>
|
|
#include <cstring>
|
|
|
|
// PORT: supplementary AVA2 pet/rarity state. Classic item packets retain 3 sockets / 7 attributes.
|
|
#pragma pack(push,1)
|
|
struct PortItemExtra {
|
|
int32_t sockets[5];
|
|
uint8_t types[8];
|
|
int16_t values[8];
|
|
char name[25];
|
|
};
|
|
#pragma pack(pop)
|
|
static_assert(sizeof(PortItemExtra)==69,"extended item state");
|
|
|
|
inline std::string PortItemExtraHex(const PortItemExtra& extra) {
|
|
static const char digits[]="0123456789abcdef";
|
|
const auto p=reinterpret_cast<const unsigned char*>(&extra);
|
|
std::string result(sizeof(extra)*2,'0');
|
|
for(unsigned i=0;i<sizeof(extra);++i){result[2*i]=digits[p[i]>>4];result[2*i+1]=digits[p[i]&15];}
|
|
return result;
|
|
}
|
|
inline bool PortItemExtraRead(const char* hex,PortItemExtra& extra) {
|
|
std::memset(&extra,0,sizeof(extra));
|
|
if(!hex || !*hex)return true;
|
|
if(std::strlen(hex)!=sizeof(extra)*2)return false;
|
|
auto nibble=[](char c){return c>='0' && c<='9'?c-'0':c>='A' && c<='F'?c-'A'+10:c>='a' && c<='f'?c-'a'+10:-1;};
|
|
auto p=reinterpret_cast<unsigned char*>(&extra);
|
|
for(unsigned i=0;i<sizeof(extra);++i){int a=nibble(hex[2*i]),b=nibble(hex[2*i+1]);if(a<0 || b<0){std::memset(&extra,0,sizeof(extra));return false;}p[i]=(a<<4)|b;}
|
|
extra.name[24]=0;return true;
|
|
}
|