From 79e916f61d3ac581f60e392cd1a2c1a82f5db5e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Gon=C3=A7alves?= Date: Fri, 7 Apr 2017 02:49:12 +0200 Subject: [PATCH] Changed: CREATE_TIME and SERIAL properties to items in EGS code --HG-- branch : compatibility-develop --- .../entities_game_service/database_plr.cpp | 46 +++- .../src/entities_game_service/database_plr.h | 242 +++++++++++++++++- .../game_item_manager/player_inventory.cpp | 6 +- 3 files changed, 282 insertions(+), 12 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/database_plr.cpp b/code/ryzom/server/src/entities_game_service/database_plr.cpp index 01c848d3b..e76c9f0b4 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.cpp +++ b/code/ryzom/server/src/entities_game_service/database_plr.cpp @@ -362,7 +362,7 @@ void CBankAccessor_PLR::TUSER::init(ICDBStructNode *parent) node = parent->getNode( ICDBStructNode::CTextId("IS_INVISIBLE"), false ); nlassert(node != NULL); _IS_INVISIBLE = node; - + node = parent->getNode( ICDBStructNode::CTextId("COUNTER"), false ); nlassert(node != NULL); _COUNTER = node; @@ -1198,6 +1198,14 @@ void CBankAccessor_PLR::TEXCHANGE::TGIVE::TArray::init(ICDBStructNode *parent, u nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -1277,6 +1285,14 @@ void CBankAccessor_PLR::TEXCHANGE::TRECEIVE::TArray::init(ICDBStructNode *parent nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -1484,6 +1500,14 @@ void CBankAccessor_PLR::TINVENTORY::TTEMP::TArray::init(ICDBStructNode *parent, nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -1574,6 +1598,14 @@ void CBankAccessor_PLR::TINVENTORY::TSHARE::TArray::init(ICDBStructNode *parent, nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -2126,6 +2158,14 @@ void CBankAccessor_PLR::TTRADING::TArray::init(ICDBStructNode *parent, uint inde nlassert(node != NULL); _QUANTITY = node; + node = parent->getNode( ICDBStructNode::CTextId("CREATE_TIME"), false ); + nlassert(node != NULL); + _CREATE_TIME = node; + + node = parent->getNode( ICDBStructNode::CTextId("SERIAL"), false ); + nlassert(node != NULL); + _SERIAL = node; + node = parent->getNode( ICDBStructNode::CTextId("USER_COLOR"), false ); nlassert(node != NULL); _USER_COLOR = node; @@ -3139,11 +3179,11 @@ void CBankAccessor_PLR::TPACK_ANIMAL::TBEAST::init(ICDBStructNode *parent, uint node = parent->getNode( ICDBStructNode::CTextId("DESPAWN"), false ); nlassert(node != NULL); _DESPAWN = node; - - // WARNING: let the value to true, else it'll corrupt backups + node = parent->getNode( ICDBStructNode::CTextId("NAME"), true ); nlassert(node != NULL); _NAME = node; + // branch init diff --git a/code/ryzom/server/src/entities_game_service/database_plr.h b/code/ryzom/server/src/entities_game_service/database_plr.h index 67e0f7798..bef0cb796 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.h +++ b/code/ryzom/server/src/entities_game_service/database_plr.h @@ -956,6 +956,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setIS_INVISIBLE(CCDBSynchronised &dbGroup, bool value, bool forceSending = false) { + + _setProp(dbGroup, _IS_INVISIBLE, value, forceSending); } @@ -971,7 +973,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _IS_INVISIBLE; } - + void setCOUNTER(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -1313,14 +1315,13 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _DODGE; } - - TBRICK_TICK_RANGE &getBRICK_TICK_RANGE() + TBRICK_TICK_RANGE &getBRICK_TICK_RANGE() { return _BRICK_TICK_RANGE; } - + }; - + class TTARGET { public: @@ -2781,6 +2782,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -2867,6 +2870,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -3080,6 +3123,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -3166,6 +3211,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -3471,6 +3556,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setMONEY(CCDBSynchronised &dbGroup, uint64 value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY, value, forceSending); } @@ -3710,6 +3797,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -3796,6 +3885,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -4051,6 +4180,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -4140,6 +4271,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -4572,6 +4743,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setMONEY(CCDBSynchronised &dbGroup, uint64 value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY, value, forceSending); } @@ -4582,12 +4755,14 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return value; } - + ICDBStructNode *getMONEYCDBNode() { return _MONEY; } + }; + private: ICDBStructNode *_BranchNode; @@ -4610,8 +4785,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _BranchNode; } + void setMONEY(CCDBSynchronised &dbGroup, uint64 value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY, value, forceSending); } @@ -5687,6 +5865,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_SHEET; ICDBStructNode *_QUALITY; ICDBStructNode *_QUANTITY; + ICDBStructNode *_CREATE_TIME; + ICDBStructNode *_SERIAL; ICDBStructNode *_USER_COLOR; ICDBStructNode *_WEIGHT; ICDBStructNode *_NAMEID; @@ -5785,6 +5965,46 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _QUANTITY; } + void setCREATE_TIME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _CREATE_TIME, value, forceSending); + } + + uint32 getCREATE_TIME(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _CREATE_TIME, value); + + return value; + } + + ICDBStructNode *getCREATE_TIMECDBNode() + { + return _CREATE_TIME; + } + + void setSERIAL(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + { + + + _setProp(dbGroup, _SERIAL, value, forceSending); + } + + uint32 getSERIAL(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _SERIAL, value); + + return value; + } + + ICDBStructNode *getSERIALCDBNode() + { + return _SERIAL; + } + void setUSER_COLOR(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -6005,6 +6225,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C void setMONEY_SHEET(CCDBSynchronised &dbGroup, NLMISC::CSheetId value, bool forceSending = false) { + + _setProp(dbGroup, _MONEY_SHEET, value, forceSending); } @@ -8861,6 +9083,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_HUNGER; ICDBStructNode *_DESPAWN; ICDBStructNode *_NAME; + public: void init(ICDBStructNode *parent, uint index); @@ -9049,9 +9272,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _DESPAWN; } - + void setNAME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) { + + _setProp(dbGroup, _NAME, value, forceSending); } @@ -9062,11 +9287,12 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return value; } - + ICDBStructNode *getNAMECDBNode() { return _NAME; } + }; diff --git a/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp b/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp index dcb7e5a49..c549506da 100644 --- a/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp +++ b/code/ryzom/server/src/entities_game_service/game_item_manager/player_inventory.cpp @@ -1071,12 +1071,16 @@ void CCharacterInvView::updateClientSlot(uint32 slot, const CGameItemPtr item) { resaleFlag = BOTCHATTYPE::ResaleKOLockedByOwner; } - + + const INVENTORIES::TItemId &itemId = item->getItemId(); + INVENTORIES::CItemSlot itemSlot( slot ); itemSlot.setItemProp( INVENTORIES::Sheet, item->getSheetId().asInt() ); itemSlot.setItemProp( INVENTORIES::Quality, item->quality() ); itemSlot.setItemProp( INVENTORIES::Quantity, item->getStackSize() ); itemSlot.setItemProp( INVENTORIES::UserColor, item->color() ); + itemSlot.setItemProp( INVENTORIES::CreateTime, itemId.getCreateTime() ); + itemSlot.setItemProp( INVENTORIES::Serial, itemId.getSerialNumber() ); itemSlot.setItemProp( INVENTORIES::Locked, item->getLockCount() ); itemSlot.setItemProp( INVENTORIES::Weight, item->weight() / 10 ); itemSlot.setItemProp( INVENTORIES::NameId, item->sendNameId(getCharacter()) );