Added: CREATE_TIME and SERIAL properties to items in database.xml

--HG--
branch : item_group
This commit is contained in:
Nuno Gonçalves 2017-04-06 15:01:10 +02:00
parent ad347d09c8
commit de949a60a9
4 changed files with 91 additions and 13 deletions

View file

@ -37,6 +37,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="LOCKED" <leaf name="LOCKED"
@ -79,6 +83,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="LOCKED" <leaf name="LOCKED"
@ -130,6 +138,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<!-- No LOCKED state --> <!-- No LOCKED state -->
@ -168,6 +180,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="WEIGHT" <leaf name="WEIGHT"
@ -223,6 +239,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="LOCKED" <leaf name="LOCKED"
@ -278,6 +298,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<!-- <leaf name="LOCKED" type="I10"/> No longer needed --> <!-- <leaf name="LOCKED" type="I10"/> No longer needed -->
@ -309,6 +333,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<!-- <leaf name="LOCKED" type="I10"/> No longer needed --> <!-- <leaf name="LOCKED" type="I10"/> No longer needed -->
@ -352,6 +380,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<!-- No LOCKED state --> <!-- No LOCKED state -->
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />

View file

@ -334,6 +334,8 @@
<leaf name="SHEET" type="I32"/> <leaf name="SHEET" type="I32"/>
<leaf name="QUALITY" type="I10"/> <leaf name="QUALITY" type="I10"/>
<leaf name="QUANTITY" type="I10"/> <leaf name="QUANTITY" type="I10"/>
<leaf name="CREATE_TIME" type="I32" />
<leaf name="SERIAL" type="I32" />
<leaf name="USER_COLOR" type="I3"/> <leaf name="USER_COLOR" type="I3"/>
<leaf name="LOCKED" type="I10"/> <leaf name="LOCKED" type="I10"/>
<leaf name="WEIGHT" type="I16"/> <leaf name="WEIGHT" type="I16"/>
@ -375,6 +377,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<!-- <leaf name="LOCKED" type="I10"/> No longer needed --> <!-- <leaf name="LOCKED" type="I10"/> No longer needed -->
@ -407,6 +413,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<!-- <leaf name="LOCKED" type="I10"/> No longer needed --> <!-- <leaf name="LOCKED" type="I10"/> No longer needed -->
@ -457,6 +467,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="LOCKED" <leaf name="LOCKED"
@ -502,6 +516,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="LOCKED" <leaf name="LOCKED"
@ -555,6 +573,10 @@
<!-- for forage progress, max QL409 x10 --> <!-- for forage progress, max QL409 x10 -->
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I12" /> type="I12" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<!-- for forage progress, max x409 x10 --> <!-- for forage progress, max x409 x10 -->
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
@ -596,6 +618,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="WEIGHT" <leaf name="WEIGHT"
@ -653,6 +679,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="LOCKED" <leaf name="LOCKED"
@ -860,6 +890,10 @@
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<!-- No LOCKED state --> <!-- No LOCKED state -->
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="WEIGHT" <leaf name="WEIGHT"
@ -1133,6 +1167,10 @@
type="I10" /> type="I10" />
<leaf name="QUANTITY" <leaf name="QUANTITY"
type="I10" /> type="I10" />
<leaf name="CREATE_TIME"
type="I32" />
<leaf name="SERIAL"
type="I32" />
<leaf name="USER_COLOR" <leaf name="USER_COLOR"
type="I3" /> type="I3" />
<leaf name="LOCKED" <leaf name="LOCKED"

View file

@ -122,7 +122,7 @@ namespace INVENTORIES
const char *InfoVersionStr = "INFO_VERSION"; const char *InfoVersionStr = "INFO_VERSION";
const char *CItemSlot::ItemPropStr [NbItemPropId] = const char *CItemSlot::ItemPropStr [NbItemPropId] =
{ "SHEET", "QUALITY", "QUANTITY", "USER_COLOR", "LOCKED", "WEIGHT", "NAMEID", "ENCHANT", "RM_CLASS_TYPE", "RM_FABER_STAT_TYPE", "PRICE", "RESALE_FLAG", "PREREQUISIT_VALID", "WORNED" }; { "SHEET", "QUALITY", "QUANTITY", "USER_COLOR", "CREATE_TIME", "SERIAL", "LOCKED", "WEIGHT", "NAMEID", "ENCHANT", "RM_CLASS_TYPE", "RM_FABER_STAT_TYPE", "PRICE", "RESALE_FLAG", "PREREQUISIT_VALID", "WORNED" };
const uint CItemSlot::DataBitSize [NbItemPropId] = const uint CItemSlot::DataBitSize [NbItemPropId] =
{ 32, 10, 10, 3, 10, 16, 32, 10, 3, 5, 32, 2, 1, 1 }; { 32, 10, 10, 3, 32, 32, 10, 16, 32, 10, 3, 5, 32, 2, 1, 1 };
} }

View file

@ -112,6 +112,17 @@ namespace INVENTORIES
return _RawId < other._RawId; return _RawId < other._RawId;
} }
uint32 getCreateTime() const
{
return _CreateTime;
}
uint32 getSerialNumber() const
{
return _SerialNumber;
}
private: private:
union union
{ {
@ -255,6 +266,8 @@ namespace INVENTORIES
Quality, Quality,
Quantity, Quantity,
UserColor, UserColor,
CreateTime,
Serial,
Locked, Locked,
Weight, Weight,
NameId, NameId,
@ -354,8 +367,8 @@ namespace INVENTORIES
bms.serial( _SlotIndex, CInventoryCategoryTemplate::SlotBitSize ); bms.serial( _SlotIndex, CInventoryCategoryTemplate::SlotBitSize );
uint i; uint i;
// SHEET, QUALITY, QUANTITY and USER_COLOR never require compression // SHEET, QUALITY, QUANTITY, USER_COLOR, CREATE_TIME and SERIAL never require compression
for (i = 0; i < 4; ++i) for (i = 0; i < 6; ++i)
bms.serial((uint32&)_ItemProp[i], DataBitSize[i]); bms.serial((uint32&)_ItemProp[i], DataBitSize[i]);
// For all other the compression is simple the first bit indicates if the value is zero // For all other the compression is simple the first bit indicates if the value is zero
@ -411,19 +424,14 @@ namespace INVENTORIES
private: private:
struct COneProp struct COneProp
{
union
{ {
TItemPropId ItemPropId; TItemPropId ItemPropId;
uint32 ItemPropIdUint32;
};
sint32 ItemPropValue; sint32 ItemPropValue;
void serial( NLMISC::CBitMemStream& bms ) void serial( NLMISC::CBitMemStream& bms )
{ {
bms.serial((uint32&)ItemPropIdUint32, NbBitsForItemPropId); bms.serial( (uint32&)ItemPropId, NbBitsForItemPropId );
bms.serial((uint32&)ItemPropValue, CItemSlot::DataBitSize[ItemPropId]); bms.serial( (uint32&)ItemPropValue, CItemSlot::DataBitSize[ItemPropId] );
} }
}; };