From b876092130ea065d285c0c0f3c4b4537bf334e69 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 16 Apr 2012 02:18:07 +0200 Subject: [PATCH] CDB no longer depends on Ryzom database banks. --- code/ryzom/client/src/cdb_branch.cpp | 18 +++++++++--------- code/ryzom/client/src/cdb_branch.h | 16 ++++++++++------ code/ryzom/client/src/cdb_leaf.cpp | 4 ---- code/ryzom/client/src/cdb_synchronised.cpp | 4 +--- code/ryzom/client/src/cdb_synchronised.h | 2 +- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/code/ryzom/client/src/cdb_branch.cpp b/code/ryzom/client/src/cdb_branch.cpp index 52c6fe455..07cd08307 100644 --- a/code/ryzom/client/src/cdb_branch.cpp +++ b/code/ryzom/client/src/cdb_branch.cpp @@ -68,25 +68,25 @@ CCDBNodeBranch::CDBBranchObsInfo *CCDBNodeBranch::_NextNotifiedObs = NULL; uint CCDBNodeBranch::_CurrNotifiedObsList = 0; // Mapping from server database index to client database index (first-level nodes) -vector CCDBNodeBranch::_CDBBankToUnifiedIndexMapping [NB_CDB_BANKS]; +vector CCDBNodeBranch::_CDBBankToUnifiedIndexMapping [CDB_BANKS_MAX]; // Mapping from client database index to TCDBBank (first-level nodes) -vector CCDBNodeBranch::_UnifiedIndexToBank; +vector CCDBNodeBranch::_UnifiedIndexToBank; // Last index mapped uint CCDBNodeBranch::_CDBLastUnifiedIndex = 0; // Number of bits for first-level branches, by bank -uint CCDBNodeBranch::_FirstLevelIdBitsByBank [NB_CDB_BANKS]; +uint CCDBNodeBranch::_FirstLevelIdBitsByBank [CDB_BANKS_MAX]; -extern const char *CDBBankNames[INVALID_CDB_BANK+1]; +extern const char *CDBBankNames[CDB_BANK_INVALID+1]; std::vector< CCDBNodeBranch::IBranchObserverCallFlushObserver* > CCDBNodeBranch::flushObservers; // reset all static data void CCDBNodeBranch::reset() { - for ( uint b=0; b _CDBBankToUnifiedIndexMapping [NB_CDB_BANKS]; + static std::vector _CDBBankToUnifiedIndexMapping [CDB_BANKS_MAX]; // Mapping from client database index to TCDBBank (first-level nodes) - static std::vector _UnifiedIndexToBank; + static std::vector _UnifiedIndexToBank; /// Last index mapped static uint _CDBLastUnifiedIndex; /// Number of bits for first-level branches, by bank - static uint _FirstLevelIdBitsByBank [NB_CDB_BANKS]; + static uint _FirstLevelIdBitsByBank [CDB_BANKS_MAX]; /// called by clear void removeAllBranchObserver(); diff --git a/code/ryzom/client/src/cdb_leaf.cpp b/code/ryzom/client/src/cdb_leaf.cpp index 9b3d26c89..7111e81bc 100644 --- a/code/ryzom/client/src/cdb_leaf.cpp +++ b/code/ryzom/client/src/cdb_leaf.cpp @@ -16,9 +16,6 @@ -#include "stdpch.h" - - //#define TRACE_READ_DELTA //#define TRACE_WRITE_DELTA //#define TRACE_SET_VALUE @@ -31,7 +28,6 @@ #include "cdb_leaf.h" #include "game_share/xml_auto_ptr.h" //#include -#include "interface_v3/interface_manager.h" //////////////// // Namespaces // diff --git a/code/ryzom/client/src/cdb_synchronised.cpp b/code/ryzom/client/src/cdb_synchronised.cpp index 21b1f1748..d25564e70 100644 --- a/code/ryzom/client/src/cdb_synchronised.cpp +++ b/code/ryzom/client/src/cdb_synchronised.cpp @@ -16,8 +16,6 @@ -#include "stdpch.h" - //#define TRACE_READ_DELTA //#define TRACE_WRITE_DELTA //#define TRACE_SET_VALUE @@ -175,7 +173,7 @@ void CCDBSynchronised::write( const string &fileName ) // readDelta // //----------------------------------------------- -void CCDBSynchronised::readDelta( NLMISC::TGameCycle gc, CBitMemStream& s, TCDBBank bank ) +void CCDBSynchronised::readDelta( NLMISC::TGameCycle gc, CBitMemStream& s, uint bank ) { nldebug("Update DB"); diff --git a/code/ryzom/client/src/cdb_synchronised.h b/code/ryzom/client/src/cdb_synchronised.h index a405b39a0..c4a70dd2b 100644 --- a/code/ryzom/client/src/cdb_synchronised.h +++ b/code/ryzom/client/src/cdb_synchronised.h @@ -84,7 +84,7 @@ public: * Update the database from a stream coming from the FE * \param f the stream */ - void readDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream& s, TCDBBank bank ); + void readDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream& s, uint bank ); /** * Return the value of a property (the update flag is set to false)