diff --git a/code/nel/include/nel/misc/cdb.h b/code/nel/include/nel/misc/cdb.h index ec77d151d..7cb28fa2e 100644 --- a/code/nel/include/nel/misc/cdb.h +++ b/code/nel/include/nel/misc/cdb.h @@ -62,7 +62,7 @@ public: S17, S18, S19, S20, S21, S22, S23, S24, S25, S26, S27, S28, S29, S30, S31, S32, S33, S34, S35, S36, S37, S38, S39, S40, S41, S42, S43, S44, S45, S46, S47, S48, S49, S50, S51, S52, S53, S54, S55, S56, S57, S58, S59, S60, S61, S62, S63, S64, - TEXT, Nb_Prop_Type + TEXT, PACKED, Nb_Prop_Type }; diff --git a/code/nel/src/misc/cdb_leaf.cpp b/code/nel/src/misc/cdb_leaf.cpp index 049791923..18cc25fb0 100644 --- a/code/nel/src/misc/cdb_leaf.cpp +++ b/code/nel/src/misc/cdb_leaf.cpp @@ -79,6 +79,9 @@ void CCDBNodeLeaf::init( xmlNodePtr node, IProgressCallback &/* progressCallBac // IF it is a TEXT. if(!strcmp(type, "TEXT")) _Type = ICDBNode::TEXT; + // IF it is a PACKED. + else if (!strcmp(type, "PACKED")) + _Type = ICDBNode::PACKED; // ELSE type unknown. else { @@ -123,6 +126,24 @@ void CCDBNodeLeaf::write( CTextId& id, FILE * f) fprintf(f,"%"NL_I64"d\t%s\n",_Property,id.toString().c_str()); } // write // +inline uint readPackedBitCount(CBitMemStream & f) +{ + uint64 isPacked; + f.serial(isPacked, 1); + if (isPacked) + { + uint64 bitCount; + f.serial(bitCount, 4); + nlinfo("PACKED: %u bits", (uint32)(bitCount << 2)); + return bitCount << 2; + } + else + { + nlinfo("PACKED: Not packed"); + return 64; + } +} + //----------------------------------------------- // readDelta //----------------------------------------------- @@ -136,6 +157,8 @@ void CCDBNodeLeaf::readDelta(TGameCycle gc, CBitMemStream & f ) uint bits; if (_Type == TEXT) bits = 32; + else if (_Type == PACKED) + bits = readPackedBitCount(f); else if (_Type <= I64) bits = _Type; else @@ -154,7 +177,7 @@ void CCDBNodeLeaf::readDelta(TGameCycle gc, CBitMemStream & f ) _Property = (sint64)recvd; // if signed - if (! ((_Type == TEXT) || (_Type <= I64))) + if (! ((_Type == TEXT) || (_Type == PACKED) || (_Type <= I64))) { // extend bit sign sint64 mask = (((sint64)1)< - - - - - + type="PACKED" /> ::init(ICDBStructNode *parent< sint64 sint64 - ucstring + ucstring + uint64 Unsupported leaf type 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 58631a86a..cc2dac90a 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.cpp +++ b/code/ryzom/server/src/entities_game_service/database_plr.cpp @@ -1,18 +1,3 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . ///////////////////////////////////////////////////////////////// // WARNING : this is a generated file, don't change it ! @@ -41,7 +26,6 @@ CBankAccessor_PLR::TASCENSOR CBankAccessor_PLR::_ASCENSOR; CBankAccessor_PLR::TCHOOSE_MISSIONS CBankAccessor_PLR::_CHOOSE_MISSIONS; CBankAccessor_PLR::TTRADING CBankAccessor_PLR::_TRADING; CBankAccessor_PLR::TBRICK_FAMILY CBankAccessor_PLR::_BRICK_FAMILY; -CBankAccessor_PLR::TFABER_PLANS CBankAccessor_PLR::_FABER_PLANS; CBankAccessor_PLR::TMISSIONS CBankAccessor_PLR::_MISSIONS; CBankAccessor_PLR::TEXECUTE_PHRASE CBankAccessor_PLR::_EXECUTE_PHRASE; CBankAccessor_PLR::TCHARACTER_INFO CBankAccessor_PLR::_CHARACTER_INFO; @@ -153,11 +137,6 @@ void CBankAccessor_PLR::init() // call sub branch init _BRICK_FAMILY.init(node); - node = bank->getICDBStructNodeFromName( BankTag, "FABER_PLANS" ); - nlassert(node != NULL); - // call sub branch init - _FABER_PLANS.init(node); - node = bank->getICDBStructNodeFromName( BankTag, "MISSIONS" ); nlassert(node != NULL); // call sub branch init @@ -362,7 +341,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; @@ -2251,45 +2230,6 @@ void CBankAccessor_PLR::TBRICK_FAMILY::TArray::init(ICDBStructNode *parent, uint } -void CBankAccessor_PLR::TFABER_PLANS::init(ICDBStructNode *parent) -{ - ICDBStructNode *node = parent; - - _BranchNode = node; - - // leaf init - - - // branch init - - for (uint i=0; i<64; ++i) - { - node = parent->getNode( ICDBStructNode::CTextId(NLMISC::toString("%u", i)), false ); - nlassert(node != NULL); - _Array[i].init(node, i); - } - -} - - -void CBankAccessor_PLR::TFABER_PLANS::TArray::init(ICDBStructNode *parent, uint index) -{ - ICDBStructNode *node = parent; - - _BranchNode = node; - - // leaf init - - node = parent->getNode( ICDBStructNode::CTextId("KNOWN"), false ); - nlassert(node != NULL); - _KNOWN = node; - - - // branch init - -} - - void CBankAccessor_PLR::TMISSIONS::init(ICDBStructNode *parent) { ICDBStructNode *node = parent; @@ -3139,10 +3079,11 @@ void CBankAccessor_PLR::TPACK_ANIMAL::TBEAST::init(ICDBStructNode *parent, uint node = parent->getNode( ICDBStructNode::CTextId("DESPAWN"), false ); nlassert(node != NULL); _DESPAWN = node; - - node = parent->getNode( ICDBStructNode::CTextId("NAME"), true ); + + node = parent->getNode( ICDBStructNode::CTextId("NAME"), false ); 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 bd431a108..2a1ce3878 100644 --- a/code/ryzom/server/src/entities_game_service/database_plr.h +++ b/code/ryzom/server/src/entities_game_service/database_plr.h @@ -1,22 +1,7 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - - -#ifndef INCLUDED_database_PLR_H -#define INCLUDED_database_PLR_H + + +#ifndef INCLUDED_DATABASE_PLR_H +#define INCLUDED_DATABASE_PLR_H ///////////////////////////////////////////////////////////////// // WARNING : this is a generated file, don't change it ! ///////////////////////////////////////////////////////////////// @@ -140,7 +125,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C class TGameTime - { + { public: @@ -183,7 +168,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TINTERFACES - { + { public: @@ -247,11 +232,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TUSER - { + { public: class TSKILL_POINTS_ - { + { public: @@ -294,7 +279,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TFACTION_POINTS_ - { + { public: @@ -337,7 +322,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRRPS_LEVELS - { + { public: @@ -380,7 +365,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TNPC_CONTROL - { + { public: @@ -490,7 +475,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_IS_NEWBIE; ICDBStructNode *_IS_TRIAL; ICDBStructNode *_DEFAULT_WEIGHT_HANDS; - ICDBStructNode *_IS_INVISIBLE; + ICDBStructNode *_IS_INVISIBLE; ICDBStructNode *_COUNTER; TSKILL_POINTS_ _SKILL_POINTS_[4]; TFACTION_POINTS_ _FACTION_POINTS_[6]; @@ -954,6 +939,26 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C return _DEFAULT_WEIGHT_HANDS; } + void setIS_INVISIBLE(CCDBSynchronised &dbGroup, bool value, bool forceSending = false) + { + + + _setProp(dbGroup, _IS_INVISIBLE, value, forceSending); + } + + bool getIS_INVISIBLE(const CCDBSynchronised &dbGroup) + { + bool value; + _getProp(dbGroup, _IS_INVISIBLE, value); + + return value; + } + + ICDBStructNode *getIS_INVISIBLECDBNode() + { + return _IS_INVISIBLE; + } + void setCOUNTER(CCDBSynchronised &dbGroup, uint8 value, bool forceSending = false) { @@ -976,20 +981,6 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _COUNTER; } - - void setIS_INVISIBLE(CCDBSynchronised &dbGroup, bool value, bool forceSending = false) - { - _setProp(dbGroup, _IS_INVISIBLE, value, forceSending); - } - - bool getIS_INVISIBLE(const CCDBSynchronised &dbGroup) - { - bool value; - _getProp(dbGroup, _IS_INVISIBLE, value); - - return value; - } - TSKILL_POINTS_ &getSKILL_POINTS_(uint32 index) { nlassert(index < 4); @@ -1013,15 +1004,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDEFENSE - { + { public: class TSLOTS - { + { public: class TArray - { + { public: @@ -1156,15 +1147,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TFLAGS - { + { public: class TBRICK_TICK_RANGE - { + { public: class TArray - { + { public: @@ -1309,20 +1300,19 @@ 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: class TBARS - { + { public: @@ -1482,15 +1472,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCONTEXT_MENU - { + { public: class TMISSIONS_OPTIONS - { + { public: class TArray - { + { public: @@ -1602,11 +1592,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMISSION_RING - { + { public: class TArray - { + { public: @@ -1927,11 +1917,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TGROUP - { + { public: class TArray - { + { public: @@ -2109,19 +2099,19 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMISSIONS - { + { public: class TArray - { + { public: class TGOALS - { + { public: class TArray - { + { public: @@ -2209,7 +2199,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTARGET - { + { public: @@ -2294,11 +2284,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class THISTO - { + { public: class TArray - { + { public: @@ -2716,7 +2706,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDM_GIFT - { + { public: @@ -2759,15 +2749,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TEXCHANGE - { + { public: class TGIVE - { + { public: class TArray - { + { public: @@ -3062,11 +3052,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRECEIVE - { + { public: class TArray - { + { public: @@ -3467,6 +3457,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); } @@ -3540,15 +3532,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TINVENTORY - { + { public: class THAND - { + { public: class TArray - { + { public: @@ -3618,11 +3610,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TEQUIP - { + { public: class TArray - { + { public: @@ -3692,11 +3684,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTEMP - { + { public: class TArray - { + { public: @@ -4033,11 +4025,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSHARE - { + { public: class TArray - { + { public: @@ -4377,7 +4369,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTM_ - { + { public: @@ -4504,7 +4496,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TROOM - { + { public: @@ -4568,6 +4560,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); } @@ -4575,14 +4569,17 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { uint64 value; _getProp(dbGroup, _MONEY, value); + return value; } - + ICDBStructNode *getMONEYCDBNode() { return _MONEY; } + }; + private: ICDBStructNode *_BranchNode; @@ -4605,8 +4602,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); } @@ -4669,15 +4669,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMODIFIERS - { + { public: class TBONUS - { + { public: class TArray - { + { public: @@ -4786,11 +4786,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMALUS - { + { public: class TArray - { + { public: @@ -4948,11 +4948,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDISABLE_CONSUMABLE - { + { public: class TArray - { + { public: @@ -5040,15 +5040,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TBOTCHAT - { + { public: class TDM_CHOICE - { + { public: class TArray - { + { public: @@ -5310,11 +5310,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TASCENSOR - { + { public: class TArray - { + { public: @@ -5468,11 +5468,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCHOOSE_MISSIONS - { + { public: class TArray - { + { public: @@ -5668,11 +5668,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTRADING - { + { public: class TArray - { + { public: @@ -6000,6 +6000,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); } @@ -6466,11 +6468,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TBRICK_FAMILY - { + { public: class TArray - { + { public: @@ -6536,91 +6538,20 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; - class TFABER_PLANS - { - public: - - class TArray - { - public: - - - private: - ICDBStructNode *_BranchNode; - - ICDBStructNode *_KNOWN; - - - public: - void init(ICDBStructNode *parent, uint index); - - // accessor to branch node - ICDBStructNode *getCDBNode() - { - return _BranchNode; - } - - - void setKNOWN(CCDBSynchronised &dbGroup, uint64 value, bool forceSending = false) - { - - - _setProp(dbGroup, _KNOWN, value, forceSending); - } - - uint64 getKNOWN(const CCDBSynchronised &dbGroup) - { - uint64 value; - _getProp(dbGroup, _KNOWN, value); - - return value; - } - - ICDBStructNode *getKNOWNCDBNode() - { - return _KNOWN; - } - - }; - - - private: - ICDBStructNode *_BranchNode; - - TArray _Array[64]; - - - public: - void init(ICDBStructNode *parent); - - // accessor to branch node - ICDBStructNode *getCDBNode() - { - return _BranchNode; - } - - TArray &getArray(uint32 index) - { - nlassert(index < 64); - return _Array[index]; - } - - }; - class TMISSIONS - { + { public: class TArray - { + { public: class TGOALS - { + { public: class TArray - { + { public: @@ -6708,7 +6639,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTARGET - { + { public: @@ -6793,11 +6724,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class THISTO - { + { public: class TArray - { + { public: @@ -7138,15 +7069,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TEXECUTE_PHRASE - { + { public: class TLINK - { + { public: class TArray - { + { public: @@ -7512,11 +7443,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCHARACTER_INFO - { + { public: class TCHARACTERISTICS - { + { public: @@ -7562,7 +7493,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSCORES - { + { public: @@ -7680,11 +7611,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMAGIC_RESISTANCE - { + { public: class TArray - { + { public: @@ -7778,11 +7709,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMAGIC_PROTECTION - { + { public: class TArray - { + { public: @@ -7900,7 +7831,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDODGE - { + { public: @@ -7970,7 +7901,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPARRY - { + { public: @@ -8040,11 +7971,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSKILLS - { + { public: class TArray - { + { public: @@ -8159,7 +8090,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TXP_CATALYSER - { + { public: @@ -8229,7 +8160,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRING_XP_CATALYSER - { + { public: @@ -8299,7 +8230,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPVP_FACTION_TAG - { + { public: @@ -8405,7 +8336,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPVP_OUTPOST - { + { public: @@ -8532,15 +8463,15 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSUCCESS_MODIFIER - { + { public: class TECO - { + { public: class TArray - { + { public: @@ -8836,11 +8767,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPACK_ANIMAL - { + { public: class TBEAST - { + { public: @@ -8855,7 +8786,8 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C ICDBStructNode *_POS; ICDBStructNode *_HUNGER; ICDBStructNode *_DESPAWN; - ICDBStructNode *_NAME; + ICDBStructNode *_NAME; + public: void init(ICDBStructNode *parent, uint index); @@ -9044,24 +8976,39 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _DESPAWN; } - - void setNAME(CCDBSynchronised &dbGroup, uint32 value, bool forceSending = false) + + void setNAME(CCDBSynchronised &dbGroup, ucstring value, bool forceSending = false) { + + _setProp(dbGroup, _NAME, value, forceSending); } - uint32 getNAME(const CCDBSynchronised &dbGroup) + ucstring getNAME(const CCDBSynchronised &dbGroup) { - uint32 value; + ucstring value; _getProp(dbGroup, _NAME, value); return value; } + + void setNAME(CCDBSynchronised &dbGroup, uint32 stringId, bool forceSending = false) + { + _setProp(dbGroup, _NAME, stringId, forceSending); + } + uint32 getNAME_id(const CCDBSynchronised &dbGroup) + { + uint32 value; + _getProp(dbGroup, _NAME, value); + return value; + } + ICDBStructNode *getNAMECDBNode() { return _NAME; } + }; @@ -9089,7 +9036,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDEBUG_INFO - { + { public: @@ -9132,11 +9079,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TMP_EVAL - { + { public: class TRESULT - { + { public: @@ -9284,7 +9231,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TRESULT_CRITICAL - { + { public: @@ -9481,7 +9428,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TCOMPASS - { + { public: @@ -9566,11 +9513,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TFAME - { + { public: class TPLAYER - { + { public: @@ -9655,7 +9602,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TTRIBE - { + { public: @@ -9860,7 +9807,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TSTATIC_DATA - { + { public: @@ -9903,11 +9850,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TDYN_CHAT - { + { public: class TCHANNEL - { + { public: @@ -10016,11 +9963,11 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TPVP_EFFECTS - { + { public: class TPVP_FACTION_POINTS - { + { public: @@ -10126,7 +10073,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TArray - { + { public: @@ -10240,7 +10187,7 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; class TWEATHER - { + { public: @@ -10316,8 +10263,6 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C static TBRICK_FAMILY _BRICK_FAMILY; - static TFABER_PLANS _FABER_PLANS; - static TMISSIONS _MISSIONS; static TEXECUTE_PHRASE _EXECUTE_PHRASE; @@ -10426,10 +10371,6 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C { return _BRICK_FAMILY; } - static TFABER_PLANS &getFABER_PLANS() - { - return _FABER_PLANS; - } static TMISSIONS &getMISSIONS() { return _MISSIONS; @@ -10483,4 +10424,4 @@ inline void _getProp(const CCDBSynchronised &db, ICDBStructNode *node, NLMISC::C }; -#endif // INCLUDED_database_PLR_H +#endif // INCLUDED_DATABASE_PLR_H diff --git a/code/ryzom/server/src/entities_game_service/player_manager/cdb.h b/code/ryzom/server/src/entities_game_service/player_manager/cdb.h index a75e66189..9eb0ec37c 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/cdb.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/cdb.h @@ -55,7 +55,7 @@ public: I17, I18, I19, I20, I21, I22, I23, I24, I25, I26, I27, I28, I29, I30, I31, I32, I33, I34, I35, I36, I37, I38, I39, I40, I41, I42, I43, I44, I45, I46, I47, I48, I49, I50, I51, I52, I53, I54, I55, I56, I57, I58, I59, I60, I61, I62, I63, I64, - TEXT, Nb_Prop_Type + TEXT, PACKED, Nb_Prop_Type }; diff --git a/code/ryzom/server/src/entities_game_service/player_manager/cdb_leaf.cpp b/code/ryzom/server/src/entities_game_service/player_manager/cdb_leaf.cpp index 45db31bc6..03616c460 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/cdb_leaf.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/cdb_leaf.cpp @@ -79,6 +79,9 @@ void CCDBStructNodeLeaf::init( xmlNodePtr node, NLMISC::IProgressCallback &progr // IF it is a TEXT. if(!strcmp(type, "TEXT")) _Type = ICDBStructNode::TEXT; + // IF it is a PACKED. + else if(!strcmp(type, "PACKED")) + _Type = ICDBStructNode::PACKED; // ELSE type unknown. else { diff --git a/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp b/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp index 21b81fc02..0b9a2efd2 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/cdb_synchronised.cpp @@ -517,6 +517,68 @@ bool CCDBSynchronised::writePermanentDelta( NLMISC::CBitMemStream& s ) return true; } +inline void pushPackedValue( CBitMemStream& s, uint64 value, uint32& bitsize, uint &bits ) +{ + // fast count of max bit + uint32 next = (uint32)(value >> 32); + uint32 test; + bits = 0; + if (next) // 64bit + { + bits += 32; + test = next; + } + else + { + test = (uint32)(value & 0xFFFFFFFF); + } + next >>= 16; + if (next) + { + bits += 16; + test = next; + } + else + { + test = next & 0xFFFF; + } + next >>= 8; + if (next) + { + bits += 8; + test = next; + } + else + { + test = next & 0xFF; + } + next >>= 4; + if (next) + { + bits += 4; + test = next; + } + else + { + test = next & 0xF; + } + if (bits + 5 > 64) // 1 bit isPacked, 4 bits bitCount + { + uint64 isPacked = 0; + s.serialAndLog2( isPacked, 1 ); + s.serialAndLog2( value, 64 ); + bitsize += 65; + } + else + { + uint64 isPacked = 1; + uint64 bitCount = bits >> 2; + s.serialAndLog2( isPacked, 1 ); + s.serialAndLog2( bitCount, 4 ); + s.serialAndLog2( value, bits ); + bitsize += (bits + 5); + } +} /* * Push one change to the stream @@ -540,6 +602,13 @@ void CCDBSynchronised::pushDelta( CBitMemStream& s, CCDBStructNodeLeaf *node, ui if ( VerboseDatabase ) nldebug( "CDB: Pushing value %"NL_I64"d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() ); } + else if ( node->type() == ICDBStructNode::PACKED ) + { + uint bits; + pushPackedValue( s, value, bitsize, bits ); + if ( VerboseDatabase ) + nldebug( "CDB: Pushing value %"NL_I64"d (PACKED %u bits) for index %d prop %s", (sint64)value, bits, index, node->buildTextId().toString().c_str() ); + } else { s.serialAndLog2( value, (uint)node->type() ); @@ -574,6 +643,13 @@ void CCDBSynchronised::pushDeltaPermanent( NLMISC::CBitMemStream& s, CCDBStructN if ( VerboseDatabase ) nldebug( "CDB: Pushing permanent value %"NL_I64"d (TEXT-32) for index %d prop %s", (sint64)value, index, node->buildTextId().toString().c_str() ); } + else if ( node->type() == ICDBStructNode::PACKED ) + { + uint bits; + pushPackedValue( s, value, bitsize, bits ); + if ( VerboseDatabase ) + nldebug( "CDB: Pushing permanent value %"NL_I64"d (PACKED %u bits) for index %d prop %s", (sint64)value, bits, index, node->buildTextId().toString().c_str() ); + } else { s.serialAndLog2( value, (uint)node->type() );