Files
mir_server/Gateway/common/db/store_data.h
aixianling 5c9f1dae4a init
2025-01-09 17:45:40 +08:00

33 lines
661 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _STORE_DATA_H_
#define _STORE_DATA_H_
#include "common.h"
#include "item_data.h"
struct StoreItemData
{
int id; //商品id
int currency_type; //购买的货币类型
int currency; //购买需要的货币数量
int discount; //折扣类型1是8折2是5折
ItemData itemData; //道具数据
StoreItemData()
{
memset(this, 0, sizeof(StoreItemData));
}
public:
//修改useritem 注意需要修改以下3个函数 writeToPack, writeDbPack, writeCrcPack
//组装发送给客户端的包
void writeData(DataPacket& pack) {
pack.writeBuf(this, sizeof(StoreItemData));
}
void readData(DataPacketReader& pack) {
pack.readBuf(this, sizeof(StoreItemData));
}
};
#endif