diff options
Diffstat (limited to 'indra/llinventory/llsaleinfo.cpp')
-rw-r--r-- | indra/llinventory/llsaleinfo.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp index d0c7c728f3..c268544955 100644 --- a/indra/llinventory/llsaleinfo.cpp +++ b/indra/llinventory/llsaleinfo.cpp @@ -280,6 +280,17 @@ void LLSaleInfo::setSalePrice(S32 price) mSalePrice = llclamp(mSalePrice, 0, S32_MAX); } +LLSD LLSaleInfo::packMessage() const +{ + LLSD result; + + U8 sale_type = static_cast<U8>(mSaleType); + result["sale-type"] = (U8)sale_type; + result["sale-price"] = (S32)mSalePrice; + //result[_PREHASH_NextOwnerMask] = mNextOwnerPermMask; + return result; +} + void LLSaleInfo::packMessage(LLMessageSystem* msg) const { U8 sale_type = static_cast<U8>(mSaleType); @@ -288,6 +299,16 @@ void LLSaleInfo::packMessage(LLMessageSystem* msg) const //msg->addU32Fast(_PREHASH_NextOwnerMask, mNextOwnerPermMask); } +void LLSaleInfo::unpackMessage(LLSD sales) +{ + U8 sale_type = (U8)sales["sale-type"].asInteger(); + mSaleType = static_cast<EForSale>(sale_type); + + mSalePrice = (S32)sales["sale-price"].asInteger(); + mSalePrice = llclamp(mSalePrice, 0, S32_MAX); + //msg->getU32Fast(block, _PREHASH_NextOwnerMask, mNextOwnerPermMask); +} + void LLSaleInfo::unpackMessage(LLMessageSystem* msg, const char* block) { U8 sale_type; |