CDB is now part of NLMISC. However it still requires some work!

This commit is contained in:
dfighter1985 2012-04-16 06:08:12 +02:00
parent a2d398f759
commit 3a93d3ac6a
70 changed files with 481 additions and 399 deletions

View file

@ -20,9 +20,10 @@
#define CDB_H #define CDB_H
// misc // misc
#include "nel/misc/types_nl.h" #include "types_nl.h"
#include "nel/misc/smart_ptr.h" #include "smart_ptr.h"
#include "nel/misc/string_mapper.h" #include "string_mapper.h"
#include "sstring.h"
#include <libxml/parser.h> #include <libxml/parser.h>
@ -30,8 +31,6 @@ namespace NLMISC
{ {
class IProgressCallback; class IProgressCallback;
class CBitMemStream; class CBitMemStream;
}
class CCDBNodeLeaf; class CCDBNodeLeaf;
class CCDBNodeBranch; class CCDBNodeBranch;
@ -48,7 +47,7 @@ extern bool VerboseDatabase;
* \date 2002 * \date 2002
*/ */
class ICDBNode : public NLMISC::CRefCount class ICDBNode : public CRefCount
{ {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// end of IDBNode interface // end of IDBNode interface
@ -78,7 +77,7 @@ public:
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class IPropertyObserver : public NLMISC::CRefCount class IPropertyObserver : public CRefCount
{ {
public : public :
virtual ~IPropertyObserver() {} virtual ~IPropertyObserver() {}
@ -198,7 +197,7 @@ public :
* Build the structure of the database from a file * Build the structure of the database from a file
* \param f is the stream * \param f is the stream
*/ */
virtual void init( xmlNodePtr node, NLMISC::IProgressCallback &progressCallBack, bool mapBanks=false ) = 0; virtual void init( xmlNodePtr node, IProgressCallback &progressCallBack, bool mapBanks=false ) = 0;
/** /**
* Save a backup of the database * Save a backup of the database
@ -212,7 +211,7 @@ public :
* \param gc the server gameCycle of this update. Any outdated update are aborted * \param gc the server gameCycle of this update. Any outdated update are aborted
* \param f : the stream. * \param f : the stream.
*/ */
virtual void readDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream & f ) = 0; virtual void readDelta( TGameCycle gc, CBitMemStream & f ) = 0;
/** /**
* Get a node . Create it if it does not exist yet * Get a node . Create it if it does not exist yet
@ -252,7 +251,7 @@ public :
virtual bool setProp( CTextId& id, sint64 value ) = 0; virtual bool setProp( CTextId& id, sint64 value ) = 0;
/// Reset all leaf data from this point /// Reset all leaf data from this point
virtual void resetData(NLMISC::TGameCycle gc, bool forceReset=false) = 0; virtual void resetData(TGameCycle gc, bool forceReset=false) = 0;
/** /**
* Clear the node and his children * Clear the node and his children
@ -314,16 +313,16 @@ public :
virtual void display (const std::string &/* prefix */){} virtual void display (const std::string &/* prefix */){}
/// Return the string id corresponding to the argument /// Return the string id corresponding to the argument
static NLMISC::TStringId getStringId(const std::string& nodeName) static TStringId getStringId(const std::string& nodeName)
{ {
if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper(); if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
return _DBSM->localMap(nodeName); return _DBSM->localMap(nodeName);
} }
/// Return a pointer to the string corresponding to the argument /// Return a pointer to the string corresponding to the argument
static const std::string *getStringFromId(NLMISC::TStringId nodeStringId) static const std::string *getStringFromId(TStringId nodeStringId)
{ {
if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper(); if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
return &_DBSM->localUnmap(nodeStringId); return &_DBSM->localUnmap(nodeStringId);
} }
@ -335,32 +334,34 @@ protected:
/// Constructor /// Constructor
ICDBNode() : _AtomicFlag(false) ICDBNode() : _AtomicFlag(false)
{ {
if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper(); if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
_Name = NLMISC::CStringMapper::emptyId(); _Name = CStringMapper::emptyId();
} }
/// Constructor /// Constructor
ICDBNode (const std::string &name) : _AtomicFlag(false) ICDBNode (const std::string &name) : _AtomicFlag(false)
{ {
if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper(); if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
_Name = _DBSM->localMap(name); _Name = _DBSM->localMap(name);
//_NameDbg = name; //_NameDbg = name;
} }
// utility to build full name efficiently (without reallocating the string at each parent level) // utility to build full name efficiently (without reallocating the string at each parent level)
void _buildFullName(NLMISC::CSString &fullName); void _buildFullName(CSString &fullName);
/// Atomic flag: is the branch an atomic group, or is the leaf a member of an atomic group /// Atomic flag: is the branch an atomic group, or is the leaf a member of an atomic group
bool _AtomicFlag : 1; bool _AtomicFlag : 1;
/// Name of the node /// Name of the node
NLMISC::TStringId _Name; TStringId _Name;
//std::string _NameDbg; //std::string _NameDbg;
static NLMISC::CStringMapper *_DBSM; static CStringMapper *_DBSM;
}; };
}
#endif // CDB_H #endif // CDB_H

View file

@ -21,6 +21,8 @@
#include "cdb.h" #include "cdb.h"
namespace NLMISC{
enum{ enum{
CDB_BANKS_MAX = 3, CDB_BANKS_MAX = 3,
CDB_BANK_INVALID CDB_BANK_INVALID
@ -36,7 +38,7 @@ class CCDBNodeBranch : public ICDBNode
{ {
public: public:
/// Triggered when the branch observers are updated /// Triggered when the branch observers are updated
class IBranchObserverCallFlushObserver : public NLMISC::CRefCount{ class IBranchObserverCallFlushObserver : public CRefCount{
public: public:
virtual ~IBranchObserverCallFlushObserver(){} virtual ~IBranchObserverCallFlushObserver(){}
virtual void onObserverCallFlush() = 0; virtual void onObserverCallFlush() = 0;
@ -54,7 +56,7 @@ public:
* Build the structure of the database from a file * Build the structure of the database from a file
* \param f is the stream * \param f is the stream
*/ */
void init( xmlNodePtr node, class NLMISC::IProgressCallback &progressCallBack, bool mapBanks=false ); void init( xmlNodePtr node, class IProgressCallback &progressCallBack, bool mapBanks=false );
/** /**
* Add a new sub node * Add a new sub node
@ -103,10 +105,10 @@ public:
void write( CTextId& id, FILE * f); void write( CTextId& id, FILE * f);
/// Update the database from the delta, but map the first level with the bank mapping (see _CDBBankToUnifiedIndexMapping) /// Update the database from the delta, but map the first level with the bank mapping (see _CDBBankToUnifiedIndexMapping)
void readAndMapDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream& s, uint bank ); void readAndMapDelta( TGameCycle gc, CBitMemStream& s, uint bank );
/// Update the database from a stream coming from the FE /// Update the database from a stream coming from the FE
void readDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream & f ); void readDelta( TGameCycle gc, CBitMemStream & f );
/** /**
* Return the value of a property (the update flag is set to false) * Return the value of a property (the update flag is set to false)
@ -129,7 +131,7 @@ public:
void clear(); void clear();
/// Reset the data corresponding to the bank (works only on top level node) /// Reset the data corresponding to the bank (works only on top level node)
void resetBank( NLMISC::TGameCycle gc, uint bank) void resetBank( TGameCycle gc, uint bank)
{ {
//nlassert( getParent() == NULL ); //nlassert( getParent() == NULL );
for ( uint i=0; i!=_Nodes.size(); ++i ) for ( uint i=0; i!=_Nodes.size(); ++i )
@ -140,7 +142,7 @@ public:
} }
/// Reset all leaf data from this point /// Reset all leaf data from this point
void resetData(NLMISC::TGameCycle gc, bool forceReset=false) void resetData(TGameCycle gc, bool forceReset=false)
{ {
for ( uint i=0; i!=_Nodes.size(); ++i ) for ( uint i=0; i!=_Nodes.size(); ++i )
{ {
@ -230,7 +232,7 @@ public:
static void removeFlushObserver( IBranchObserverCallFlushObserver *observer ); static void removeFlushObserver( IBranchObserverCallFlushObserver *observer );
// mark this branch and parent branch as 'modified'. This is usually called by sub-leaves // mark this branch and parent branch as 'modified'. This is usually called by sub-leaves
void linkInModifiedNodeList(NLMISC::TStringId modifiedLeafName); void linkInModifiedNodeList(TStringId modifiedLeafName);
/// Find a subnode at this level /// Find a subnode at this level
ICDBNode * find (const std::string &nodeName); ICDBNode * find (const std::string &nodeName);
@ -254,7 +256,7 @@ protected:
class CDBBranchObsInfo class CDBBranchObsInfo
{ {
public: public:
NLMISC::CRefPtr<IPropertyObserver> Observer; CRefPtr<IPropertyObserver> Observer;
// 2 linked list are required : while the observer is notified, it can triger one other observer, so we must link it in another list // 2 linked list are required : while the observer is notified, it can triger one other observer, so we must link it in another list
bool Touched[2]; bool Touched[2];
CDBBranchObsInfo *PrevNotifiedObserver[2]; // NULL means this is the head CDBBranchObsInfo *PrevNotifiedObserver[2]; // NULL means this is the head
@ -265,7 +267,7 @@ protected:
// This is equivalent to creating a sub-branch containing only the specified leaves // This is equivalent to creating a sub-branch containing only the specified leaves
// and setting a branch observer on it, except you don't need to change your database paths // and setting a branch observer on it, except you don't need to change your database paths
// and update large amounts of code and script! // and update large amounts of code and script!
std::vector<NLMISC::TStringId> PositiveLeafNameFilter; std::vector<TStringId> PositiveLeafNameFilter;
public: public:
@ -294,7 +296,7 @@ protected:
} }
// Unlink from the given list. This also clear the '_Touched' flag // Unlink from the given list. This also clear the '_Touched' flag
void unlink(uint list); void unlink(uint list);
void link(uint list, NLMISC::TStringId modifiedLeafName); void link(uint list, TStringId modifiedLeafName);
}; };
typedef std::list<CDBBranchObsInfo> TObsList; // must use a list because pointers on CDBObserverInfo instances must remains valids typedef std::list<CDBBranchObsInfo> TObsList; // must use a list because pointers on CDBObserverInfo instances must remains valids
@ -348,6 +350,7 @@ private:
}; };
}
#endif // CDB_BRANCH_H #endif // CDB_BRANCH_H

View file

@ -19,8 +19,9 @@
#ifndef NL_CDB_CHECK_SUM_H #ifndef NL_CDB_CHECK_SUM_H
#define NL_CDB_CHECK_SUM_H #define NL_CDB_CHECK_SUM_H
#include "nel/misc/types_nl.h" #include "types_nl.h"
namespace NLMISC{
/** /**
* class implementing check sum for the client database * class implementing check sum for the client database
@ -81,6 +82,7 @@ private:
}; };
}
#endif // NL_CDB_CHECK_SUM_H #endif // NL_CDB_CHECK_SUM_H

View file

@ -21,7 +21,10 @@
#include "cdb.h" #include "cdb.h"
#include "cdb_branch.h" #include "cdb_branch.h"
#include "nel/misc/time_nl.h" #include "time_nl.h"
#include "rgba.h"
namespace NLMISC{
/** /**
* Database node which contains a unique property * Database node which contains a unique property
@ -50,16 +53,16 @@ public:
void setValue8 (sint8 prop); void setValue8 (sint8 prop);
inline bool getValueBool() { return (_Property!=(sint64)0 ); } inline bool getValueBool() { return (_Property!=(sint64)0 ); }
void setValueBool (bool prop); void setValueBool (bool prop);
inline NLMISC::CRGBA getValueRGBA() inline CRGBA getValueRGBA()
{ {
NLMISC::CRGBA col; CRGBA col;
col.R = (uint8)(_Property&0xff); col.R = (uint8)(_Property&0xff);
col.G = (uint8)((_Property>>8)&0xff); col.G = (uint8)((_Property>>8)&0xff);
col.B = (uint8)((_Property>>16)&0xff); col.B = (uint8)((_Property>>16)&0xff);
col.A = (uint8)((_Property>>24)&0xff); col.A = (uint8)((_Property>>24)&0xff);
return col; return col;
} }
void setValueRGBA (const NLMISC::CRGBA &color); void setValueRGBA (const CRGBA &color);
/// Return the value of the property before the database change /// Return the value of the property before the database change
inline sint64 getOldValue64() { return _oldProperty; } inline sint64 getOldValue64() { return _oldProperty; }
@ -98,7 +101,7 @@ public:
* Build the structure of the database from a file * Build the structure of the database from a file
* \param f is the stream * \param f is the stream
*/ */
void init( xmlNodePtr node, NLMISC::IProgressCallback &progressCallBack, bool mapBanks=false ); void init( xmlNodePtr node, IProgressCallback &progressCallBack, bool mapBanks=false );
/** /**
* Get a node * Get a node
@ -132,7 +135,7 @@ public:
* Update the database from a stream coming from the FE * Update the database from a stream coming from the FE
* \param f : the stream. * \param f : the stream.
*/ */
void readDelta(NLMISC::TGameCycle gc, NLMISC::CBitMemStream & f ); void readDelta(TGameCycle gc, CBitMemStream & f );
/** /**
* Return the value of a property (the update flag is set to false) * Return the value of a property (the update flag is set to false)
@ -154,10 +157,10 @@ public:
/** /**
* Set the value of a property, only if gc>=_LastChangeGC * Set the value of a property, only if gc>=_LastChangeGC
*/ */
bool setPropCheckGC(NLMISC::TGameCycle gc, sint64 value); bool setPropCheckGC(TGameCycle gc, sint64 value);
/// Reset all leaf data from this point /// Reset all leaf data from this point
void resetData(NLMISC::TGameCycle gc, bool forceReset=false); void resetData(TGameCycle gc, bool forceReset=false);
/** /**
* Clear the node and his children * Clear the node and his children
@ -215,7 +218,7 @@ public:
/// get the last change GameCycle (server tick) for this value /// get the last change GameCycle (server tick) for this value
NLMISC::TGameCycle getLastChangeGC() const {return _LastChangeGC;} TGameCycle getLastChangeGC() const {return _LastChangeGC;}
private: private:
@ -234,7 +237,7 @@ private:
/// gamecycle (servertick) of the last change for this value. /// gamecycle (servertick) of the last change for this value.
/// change are made in readDelta only for change >= _LastChangeGC /// change are made in readDelta only for change >= _LastChangeGC
NLMISC::TGameCycle _LastChangeGC; TGameCycle _LastChangeGC;
/// observers to call when the value really change /// observers to call when the value really change
std::vector<IPropertyObserver*> _Observers; std::vector<IPropertyObserver*> _Observers;
@ -249,7 +252,7 @@ private:
//////////////////// ////////////////////
}
#endif // CDB_LEAF_H #endif // CDB_LEAF_H

View file

@ -16,21 +16,19 @@
#include "stdpch.h"
////////////// //////////////
// Includes // // Includes //
////////////// //////////////
#include "cdb.h" #include "nel/misc/cdb.h"
#include "cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include <nel/misc/bit_mem_stream.h> #include "nel/misc/bit_mem_stream.h"
//////////////// ////////////////
// Namespaces // // Namespaces //
//////////////// ////////////////
using namespace NLMISC;
using namespace std; using namespace std;
namespace NLMISC{
CStringMapper *ICDBNode::_DBSM = NULL; CStringMapper *ICDBNode::_DBSM = NULL;
@ -82,3 +80,6 @@ void ICDBNode::releaseStringMapper()
delete _DBSM; delete _DBSM;
_DBSM = NULL; _DBSM = NULL;
} }
}

View file

@ -26,15 +26,14 @@
////////////// //////////////
// Includes // // Includes //
////////////// //////////////
#include "cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include "cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "nel/misc/xml_auto_ptr.h" #include "nel/misc/xml_auto_ptr.h"
//#include <iostream.h> //#include <iostream.h>
//////////////// ////////////////
// Namespaces // // Namespaces //
//////////////// ////////////////
using namespace NLMISC;
using namespace std; using namespace std;
@ -43,6 +42,8 @@ using namespace std;
#include "nel/misc/file.h" #include "nel/misc/file.h"
#include "nel/misc/i_xml.h" #include "nel/misc/i_xml.h"
#include "nel/misc/progress_callback.h" #include "nel/misc/progress_callback.h"
#include "nel/misc/bit_mem_stream.h"
#include "nel/misc/bit_set.h"
#include <libxml/parser.h> #include <libxml/parser.h>
//#include <io.h> //#include <io.h>
@ -53,7 +54,9 @@ using namespace std;
using namespace std; using namespace std;
using namespace NLMISC;
namespace NLMISC{
///////////// /////////////
// GLOBALS // // GLOBALS //
@ -134,7 +137,7 @@ static /*inline*/ void addNode( ICDBNode *newNode, std::string newName, CCDBNode
std::vector<ICDBNode *> &nodes, std::vector<ICDBNode *> &nodesSorted, std::vector<ICDBNode *> &nodes, std::vector<ICDBNode *> &nodesSorted,
xmlNodePtr &child, const string& bankName, xmlNodePtr &child, const string& bankName,
bool atomBranch, bool clientOnly, bool atomBranch, bool clientOnly,
NLMISC::IProgressCallback &progressCallBack, IProgressCallback &progressCallBack,
bool mapBanks ) bool mapBanks )
{ {
nodesSorted.push_back(newNode); nodesSorted.push_back(newNode);
@ -158,7 +161,7 @@ static /*inline*/ void addNode( ICDBNode *newNode, std::string newName, CCDBNode
} }
} }
void CCDBNodeBranch::init( xmlNodePtr node, NLMISC::IProgressCallback &progressCallBack, bool mapBanks ) void CCDBNodeBranch::init( xmlNodePtr node, IProgressCallback &progressCallBack, bool mapBanks )
{ {
xmlNodePtr child; xmlNodePtr child;
@ -459,7 +462,7 @@ bool CCDBNodeBranch::setProp( CTextId& id, sint64 value )
/* /*
* Update the database from the delta, but map the first level with the bank mapping (see _CDBBankToUnifiedIndexMapping) * Update the database from the delta, but map the first level with the bank mapping (see _CDBBankToUnifiedIndexMapping)
*/ */
void CCDBNodeBranch::readAndMapDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream& s, uint bank ) void CCDBNodeBranch::readAndMapDelta( TGameCycle gc, CBitMemStream& s, uint bank )
{ {
nlassert( ! isAtomic() ); // root node mustn't be atomic nlassert( ! isAtomic() ); // root node mustn't be atomic
@ -491,7 +494,7 @@ void CCDBNodeBranch::readAndMapDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStre
// readDelta // readDelta
// //
//----------------------------------------------- //-----------------------------------------------
void CCDBNodeBranch::readDelta( NLMISC::TGameCycle gc, CBitMemStream & f ) void CCDBNodeBranch::readDelta( TGameCycle gc, CBitMemStream & f )
{ {
if ( isAtomic() ) if ( isAtomic() )
{ {
@ -679,8 +682,6 @@ void CCDBNodeBranch::removeNode (const CTextId& id)
//----------------------------------------------- //-----------------------------------------------
void CCDBNodeBranch::flushObserversCalls() void CCDBNodeBranch::flushObserversCalls()
{ {
H_AUTO ( RZ_Interface_flushObserversCalls )
// nlassert(_CrtCheckMemory()); // nlassert(_CrtCheckMemory());
_CurrNotifiedObs = _FirstNotifiedObs[_CurrNotifiedObsList]; _CurrNotifiedObs = _FirstNotifiedObs[_CurrNotifiedObsList];
while (_CurrNotifiedObs) while (_CurrNotifiedObs)
@ -743,7 +744,7 @@ void CCDBNodeBranch::removeFlushObserver( CCDBNodeBranch::IBranchObserverCallFlu
} }
//----------------------------------------------- //-----------------------------------------------
void CCDBNodeBranch::CDBBranchObsInfo::link(uint list, NLMISC::TStringId modifiedLeafName) void CCDBNodeBranch::CDBBranchObsInfo::link(uint list, TStringId modifiedLeafName)
{ {
// If there a filter set? // If there a filter set?
if (!PositiveLeafNameFilter.empty()) if (!PositiveLeafNameFilter.empty())
@ -810,7 +811,7 @@ void CCDBNodeBranch::CDBBranchObsInfo::unlink(uint list)
} }
//----------------------------------------------- //-----------------------------------------------
void CCDBNodeBranch::linkInModifiedNodeList(NLMISC::TStringId modifiedLeafName) void CCDBNodeBranch::linkInModifiedNodeList(TStringId modifiedLeafName)
{ {
// nlassert(_CrtCheckMemory()); // nlassert(_CrtCheckMemory());
CCDBNodeBranch *curr = this; CCDBNodeBranch *curr = this;
@ -913,7 +914,15 @@ void CCDBNodeBranch::addBranchObserver(const char *dbPathFromThisNode, ICDBNode:
else else
{ {
branchNode = safe_cast<CCDBNodeBranch*>(getNode(ICDBNode::CTextId(dbPathFromThisNode), false)); branchNode = safe_cast<CCDBNodeBranch*>(getNode(ICDBNode::CTextId(dbPathFromThisNode), false));
BOMB_IF (!branchNode, (*getName()) << ":" << dbPathFromThisNode << " branch missing in DB", return); if( branchNode == NULL ){
std::string msg = *getName();
msg += ":";
msg += dbPathFromThisNode;
msg += " branch missing in DB";
nlerror( msg.c_str() );
return;
}
} }
std::vector<std::string> leavesToMonitor(positiveLeafNameFilterSize); std::vector<std::string> leavesToMonitor(positiveLeafNameFilterSize);
for (uint i=0; i!=positiveLeafNameFilterSize; ++i) for (uint i=0; i!=positiveLeafNameFilterSize; ++i)
@ -927,7 +936,14 @@ void CCDBNodeBranch::addBranchObserver(const char *dbPathFromThisNode, ICDBNode:
void CCDBNodeBranch::removeBranchObserver(const char *dbPathFromThisNode, ICDBNode::IPropertyObserver& observer) void CCDBNodeBranch::removeBranchObserver(const char *dbPathFromThisNode, ICDBNode::IPropertyObserver& observer)
{ {
CCDBNodeBranch *branchNode = safe_cast<CCDBNodeBranch*>(getNode(ICDBNode::CTextId(dbPathFromThisNode), false)); CCDBNodeBranch *branchNode = safe_cast<CCDBNodeBranch*>(getNode(ICDBNode::CTextId(dbPathFromThisNode), false));
BOMB_IF (!branchNode, (*getName()) << ":" << dbPathFromThisNode << " branch missing in DB", return); if( branchNode == NULL ){
std::string msg = *getName();
msg += ":";
msg += dbPathFromThisNode;
msg += " branch missing in DB";
nlerror( msg.c_str() );
return;
}
branchNode->removeBranchObserver(&observer); branchNode->removeBranchObserver(&observer);
} }
@ -1043,3 +1059,5 @@ ICDBNode *CCDBNodeBranch::find(const std::string &nodeName)
#undef TRACE_SET_VALUE #undef TRACE_SET_VALUE
#endif #endif
}

View file

@ -16,10 +16,11 @@
#include "stdpch.h" #include "nel/misc/cdb_check_sum.h"
#include "cdb_check_sum.h"
namespace NLMISC{
/* /*
* Constructor * Constructor
*/ */
@ -40,3 +41,6 @@ void CCDBCheckSum::add(uint8 el)
_Factor = (cipher + _Factor) * _Const1 + _Const2; _Factor = (cipher + _Factor) * _Const1 + _Const2;
_Sum += cipher; _Sum += cipher;
} }
}

View file

@ -25,21 +25,23 @@
////////////// //////////////
// Includes // // Includes //
////////////// //////////////
#include "cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "nel/misc/xml_auto_ptr.h" #include "nel/misc/xml_auto_ptr.h"
#include "nel/misc/bit_mem_stream.h"
//#include <iostream.h> //#include <iostream.h>
//////////////// ////////////////
// Namespaces // // Namespaces //
//////////////// ////////////////
using namespace NLMISC;
using namespace std; using namespace std;
namespace NLMISC{
//----------------------------------------------- //-----------------------------------------------
// init // init
//----------------------------------------------- //-----------------------------------------------
void CCDBNodeLeaf::init( xmlNodePtr node, NLMISC::IProgressCallback &/* progressCallBack */, bool /* mapBanks */ ) void CCDBNodeLeaf::init( xmlNodePtr node, IProgressCallback &/* progressCallBack */, bool /* mapBanks */ )
{ {
CXMLAutoPtr type((const char*)xmlGetProp (node, (xmlChar*)"type")); CXMLAutoPtr type((const char*)xmlGetProp (node, (xmlChar*)"type"));
nlassert((const char *) type != NULL); nlassert((const char *) type != NULL);
@ -124,7 +126,7 @@ void CCDBNodeLeaf::write( CTextId& id, FILE * f)
//----------------------------------------------- //-----------------------------------------------
// readDelta // readDelta
//----------------------------------------------- //-----------------------------------------------
void CCDBNodeLeaf::readDelta(NLMISC::TGameCycle gc, CBitMemStream & f ) void CCDBNodeLeaf::readDelta(TGameCycle gc, CBitMemStream & f )
{ {
// If the property Type is valid. // If the property Type is valid.
if(_Type > UNKNOWN && _Type < Nb_Prop_Type) if(_Type > UNKNOWN && _Type < Nb_Prop_Type)
@ -180,7 +182,7 @@ void CCDBNodeLeaf::readDelta(NLMISC::TGameCycle gc, CBitMemStream & f )
//----------------------------------------------- //-----------------------------------------------
// resetData // resetData
//----------------------------------------------- //-----------------------------------------------
void CCDBNodeLeaf::resetData(NLMISC::TGameCycle gc, bool forceReset) void CCDBNodeLeaf::resetData(TGameCycle gc, bool forceReset)
{ {
if(forceReset) if(forceReset)
{ {
@ -247,7 +249,7 @@ bool CCDBNodeLeaf::setProp( CTextId& id, sint64 value )
//----------------------------------------------- //-----------------------------------------------
// setPropCheckGC // setPropCheckGC
//----------------------------------------------- //-----------------------------------------------
bool CCDBNodeLeaf::setPropCheckGC(NLMISC::TGameCycle gc, sint64 value) bool CCDBNodeLeaf::setPropCheckGC(TGameCycle gc, sint64 value)
{ {
// Apply only if happens after the DB change // Apply only if happens after the DB change
if(gc>=_LastChangeGC) if(gc>=_LastChangeGC)
@ -318,7 +320,7 @@ void CCDBNodeLeaf::setValueBool(bool prop)
setValue64(newVal); setValue64(newVal);
} }
void CCDBNodeLeaf::setValueRGBA (const NLMISC::CRGBA &color) void CCDBNodeLeaf::setValueRGBA (const CRGBA &color)
{ {
sint64 newVal = (uint32)(color.R+(color.G<<8)+(color.B<<16)+(color.A<<24)); sint64 newVal = (uint32)(color.R+(color.G<<8)+(color.B<<16)+(color.A<<24));
setValue64(newVal); setValue64(newVal);
@ -386,3 +388,5 @@ void CCDBNodeLeaf::notifyObservers()
#endif #endif
//############################################################################################# //#############################################################################################
}

View file

@ -48,7 +48,7 @@ using namespace NLMISC;
using namespace std; using namespace std;
bool VerboseDatabase = false; bool NLMISC::VerboseDatabase = false;
uint32 NbDatabaseChanges = 0; uint32 NbDatabaseChanges = 0;

View file

@ -20,8 +20,8 @@
#define CDB_SYNCHRONISED_H #define CDB_SYNCHRONISED_H
#include "cdb.h" #include "nel/misc/cdb.h"
#include "cdb_branch.h" #include "nel/misc/cdb_branch.h"
/** /**
* Class to manage a database of properties * Class to manage a database of properties
@ -32,7 +32,7 @@
class CCDBSynchronised class CCDBSynchronised
{ {
/// database /// database
NLMISC::CRefPtr<CCDBNodeBranch> _Database; NLMISC::CRefPtr<NLMISC::CCDBNodeBranch> _Database;
/// string associations /// string associations
std::map<uint32,std::string> _Strings; std::map<uint32,std::string> _Strings;
@ -60,7 +60,7 @@ public:
* Return a ptr on the node * Return a ptr on the node
* \return ptr on the node * \return ptr on the node
*/ */
CCDBNodeBranch * getNodePtr() { return _Database; } NLMISC::CCDBNodeBranch * getNodePtr() { return _Database; }
/** /**
* Build the structure of the database from a file * Build the structure of the database from a file

View file

@ -76,7 +76,7 @@
#include "user_entity.h" #include "user_entity.h"
#include "projectile_manager.h" #include "projectile_manager.h"
#include "init_main_loop.h" #include "init_main_loop.h"
#include "cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include "animation_fx_misc.h" #include "animation_fx_misc.h"
#include "attack_list.h" #include "attack_list.h"
#include "animation_fx_id_array.h" #include "animation_fx_id_array.h"

View file

@ -32,6 +32,10 @@
#include <map> #include <map>
#include <string> #include <string>
namespace NLMISC{
class CCDBNodeLeaf;
}
//#define OLD_STRING_SYSTEM //#define OLD_STRING_SYSTEM
@ -338,8 +342,8 @@ private :
/// \name Dynamic Chat channel mgt /// \name Dynamic Chat channel mgt
// @{ // @{
TChanID _ChatDynamicChannelId; TChanID _ChatDynamicChannelId;
class CCDBNodeLeaf *_DynamicChannelNameLeaf[CChatGroup::MaxDynChanPerPlayer]; NLMISC::CCDBNodeLeaf *_DynamicChannelNameLeaf[CChatGroup::MaxDynChanPerPlayer];
class CCDBNodeLeaf *_DynamicChannelIdLeaf[CChatGroup::MaxDynChanPerPlayer]; NLMISC::CCDBNodeLeaf *_DynamicChannelIdLeaf[CChatGroup::MaxDynChanPerPlayer];
// Id cached. If different from precedent, then the channel must be flushed // Id cached. If different from precedent, then the channel must be flushed
enum {DynamicChannelEmptyId=-1}; enum {DynamicChannelEmptyId=-1};
uint32 _DynamicChannelIdCache[CChatGroup::MaxDynChanPerPlayer]; uint32 _DynamicChannelIdCache[CChatGroup::MaxDynChanPerPlayer];

View file

@ -74,7 +74,7 @@
#include "commands.h" #include "commands.h"
#include "entities.h" #include "entities.h"
#include "teleport.h" #include "teleport.h"
#include "cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "view.h" #include "view.h"
#include "misc.h" #include "misc.h"
#include "demo.h" #include "demo.h"

View file

@ -91,7 +91,10 @@ class CItemSheet;
class CPhysicalDamage; class CPhysicalDamage;
namespace NLMISC{
class CCDBNodeLeaf; class CCDBNodeLeaf;
class CCDBNodeBranch;
}
extern CLFECOMMON::TCLEntityId SlotUnderCursor; extern CLFECOMMON::TCLEntityId SlotUnderCursor;
@ -809,7 +812,7 @@ public:
virtual void setDiffuse(bool onOff, NLMISC::CRGBA diffuse); virtual void setDiffuse(bool onOff, NLMISC::CRGBA diffuse);
static CCDBNodeLeaf *getOpacityDBNode(); static NLMISC::CCDBNodeLeaf *getOpacityDBNode();
static uint32 getOpacityMin(); static uint32 getOpacityMin();
static void setOpacityMin(uint32 value); static void setOpacityMin(uint32 value);
@ -884,7 +887,7 @@ protected:
// Persistent NPC Alias of the entity // Persistent NPC Alias of the entity
uint32 _NPCAlias; uint32 _NPCAlias;
// Local DB Branch for this entity // Local DB Branch for this entity
class CCDBNodeBranch *_DBEntry; class NLMISC::CCDBNodeBranch *_DBEntry;
// Playlist // Playlist
NL3D::UPlayList *_PlayList; NL3D::UPlayList *_PlayList;
NL3D::UPlayList *_FacePlayList; NL3D::UPlayList *_FacePlayList;
@ -1108,7 +1111,7 @@ protected:
// for localSelectBox() computing // for localSelectBox() computing
sint64 _LastLocalSelectBoxComputeTime; sint64 _LastLocalSelectBoxComputeTime;
static NLMISC::CRefPtr<CCDBNodeLeaf> _OpacityMinNodeLeaf; static NLMISC::CRefPtr<NLMISC::CCDBNodeLeaf> _OpacityMinNodeLeaf;
protected: protected:
/** /**

View file

@ -30,7 +30,9 @@
// *************************************************************************** // ***************************************************************************
class CGroupMenu; class CGroupMenu;
class CViewTextMenu; class CViewTextMenu;
namespace NLMISC{
class CCDBNodeLeaf; class CCDBNodeLeaf;
}
// *************************************************************************** // ***************************************************************************
/** /**
@ -77,21 +79,21 @@ private:
// MilkoPad // MilkoPad
CInterfaceGroupPtr _GroupMilkoPad; CInterfaceGroupPtr _GroupMilkoPad;
CCDBNodeLeaf *_MilkoAttackDisengage; NLMISC::CCDBNodeLeaf *_MilkoAttackDisengage;
CCtrlTextButtonPtr _MilkoAttDisBut1; CCtrlTextButtonPtr _MilkoAttDisBut1;
CCtrlTextButtonPtr _MilkoAttDisBut2; CCtrlTextButtonPtr _MilkoAttDisBut2;
CGroupMenu *_GroupMenu; CGroupMenu *_GroupMenu;
CCDBNodeLeaf *_ContextVal; NLMISC::CCDBNodeLeaf *_ContextVal;
CCDBNodeLeaf *_AvailablePrograms; NLMISC::CCDBNodeLeaf *_AvailablePrograms;
CCDBNodeLeaf *_ServerTeamPresent; NLMISC::CCDBNodeLeaf *_ServerTeamPresent;
CCDBNodeLeaf *_MissionOption[NUM_MISSION_OPTIONS]; NLMISC::CCDBNodeLeaf *_MissionOption[NUM_MISSION_OPTIONS];
CCDBNodeLeaf *_ServerInDuel; NLMISC::CCDBNodeLeaf *_ServerInDuel;
CCDBNodeLeaf *_ServerInPvpChallenge; NLMISC::CCDBNodeLeaf *_ServerInPvpChallenge;
CCDBNodeLeaf *_WebPageTitle; NLMISC::CCDBNodeLeaf *_WebPageTitle;
CCDBNodeLeaf *_OutpostSheet; NLMISC::CCDBNodeLeaf *_OutpostSheet;
CCDBNodeLeaf *_OutpostRightToBannish; NLMISC::CCDBNodeLeaf *_OutpostRightToBannish;
CCDBNodeLeaf *_MissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase]; NLMISC::CCDBNodeLeaf *_MissionRing[BOTCHATTYPE::MaxR2MissionEntryDatabase];
CViewTextMenuPtr _TextLootAction; CViewTextMenuPtr _TextLootAction;

View file

@ -27,9 +27,9 @@
// Misc. // Misc.
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
// Game share. // Game share.
#include "cdb.h" #include "nel/misc/cdb.h"
#include "cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include "cdb_synchronised.h" #include "cdb_synchronised.h"

View file

@ -141,10 +141,10 @@ private:
}; };
// update the brick help window when weight of hands has changed // update the brick help window when weight of hands has changed
class CFittedWeaponWeightObserver : public ICDBNode::IPropertyObserver class CFittedWeaponWeightObserver : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };

View file

@ -143,18 +143,18 @@ private:
// The Inventory manipulated. // The Inventory manipulated.
std::vector<CItem> _InventoryMirror; std::vector<CItem> _InventoryMirror;
bool _InventoryObsSetup; bool _InventoryObsSetup;
class CDBInventoryObs : public ICDBNode::IPropertyObserver class CDBInventoryObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
CDBInventoryObs _DBInventoryObs; CDBInventoryObs _DBInventoryObs;
friend class CDBInventoryObs; friend class CDBInventoryObs;
// The animals Status // The animals Status
class CDBAnimalObs : public ICDBNode::IPropertyObserver class CDBAnimalObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
CDBAnimalObs _DBAnimalObs; CDBAnimalObs _DBAnimalObs;
friend class CDBAnimalObs; friend class CDBAnimalObs;

View file

@ -24,6 +24,8 @@
#include "group_compas.h" #include "group_compas.h"
#include "game_share/animal_status.h" #include "game_share/animal_status.h"
using NLMISC::CCDBNodeLeaf;
// *************************************************************************** // ***************************************************************************
// CPositionState // CPositionState
// *************************************************************************** // ***************************************************************************

View file

@ -26,7 +26,9 @@
// *************************************************************************** // ***************************************************************************
namespace NLMISC{
class CCDBNodeLeaf; class CCDBNodeLeaf;
}
// *************************************************************************** // ***************************************************************************
/** /**
@ -58,7 +60,7 @@ protected:
virtual bool getDbPos(sint32 &px, sint32 &py) = 0; virtual bool getDbPos(sint32 &px, sint32 &py) = 0;
// helper to serial a CDBNodeLeaf, based on itsname // helper to serial a CDBNodeLeaf, based on itsname
void serialNodeLeaf(NLMISC::IStream &f, CCDBNodeLeaf *&dbNode); void serialNodeLeaf(NLMISC::IStream &f, NLMISC::CCDBNodeLeaf *&dbNode);
}; };
@ -82,8 +84,8 @@ public:
virtual void serial(NLMISC::IStream &f); virtual void serial(NLMISC::IStream &f);
protected: protected:
// Database infos // Database infos
CCDBNodeLeaf *_DBPos; NLMISC::CCDBNodeLeaf *_DBPos;
CCDBNodeLeaf *_Uid; NLMISC::CCDBNodeLeaf *_Uid;
// The slot of the entity that may be used to get more precise position // The slot of the entity that may be used to get more precise position
CLFECOMMON::TCLEntityId _EntitySlot; CLFECOMMON::TCLEntityId _EntitySlot;
virtual CEntityCL *getEntity(); virtual CEntityCL *getEntity();
@ -103,18 +105,18 @@ class CNamedEntityPositionState : public CPositionState
public: public:
NLMISC_DECLARE_CLASS(CNamedEntityPositionState) NLMISC_DECLARE_CLASS(CNamedEntityPositionState)
virtual bool dbOk() {return _Name && _X && _Y;} virtual bool dbOk() {return _Name && _X && _Y;}
void build(CCDBNodeLeaf *name, CCDBNodeLeaf *x, CCDBNodeLeaf *y); void build(NLMISC::CCDBNodeLeaf *name, NLMISC::CCDBNodeLeaf *x, NLMISC::CCDBNodeLeaf *y);
CCDBNodeLeaf *getNameNode() const { return _Name; } NLMISC::CCDBNodeLeaf *getNameNode() const { return _Name; }
CCDBNodeLeaf *getXNode() const { return _X; } NLMISC::CCDBNodeLeaf *getXNode() const { return _X; }
CCDBNodeLeaf *getYNode() const { return _X; } NLMISC::CCDBNodeLeaf *getYNode() const { return _X; }
// //
virtual bool canSave() const { return true; } virtual bool canSave() const { return true; }
virtual void serial(NLMISC::IStream &f); virtual void serial(NLMISC::IStream &f);
protected: protected:
// Database infos // Database infos
CCDBNodeLeaf *_Name; NLMISC::CCDBNodeLeaf *_Name;
CCDBNodeLeaf *_X; NLMISC::CCDBNodeLeaf *_X;
CCDBNodeLeaf *_Y; NLMISC::CCDBNodeLeaf *_Y;
virtual CEntityCL *getEntity(); virtual CEntityCL *getEntity();
virtual bool getDbPos(sint32 &px, sint32 &py); virtual bool getDbPos(sint32 &px, sint32 &py);
}; };
@ -148,7 +150,7 @@ public:
virtual void serial(NLMISC::IStream &/* f */) { nlassert(0); /* notsavable */ } virtual void serial(NLMISC::IStream &/* f */) { nlassert(0); /* notsavable */ }
protected: protected:
// Database infos // Database infos
CCDBNodeLeaf *_Present; NLMISC::CCDBNodeLeaf *_Present;
// DB ok. // DB ok.
bool dbOk() {return _DBPos && _Present && _Uid;} bool dbOk() {return _DBPos && _Present && _Uid;}
@ -182,7 +184,7 @@ public:
private: private:
// Animal Database infos // Animal Database infos
CCDBNodeLeaf *_Status; NLMISC::CCDBNodeLeaf *_Status;
// DB ok. // DB ok.
bool dbOk() {return _DBPos && _Status && _Uid;} bool dbOk() {return _DBPos && _Status && _Uid;}

View file

@ -23,6 +23,10 @@
#include "game_share/inventories.h" #include "game_share/inventories.h"
#include "game_share/scores.h" #include "game_share/scores.h"
namespace NLMISC{
class CCDBNodeLeaf;
}
// *************************************************************************** // ***************************************************************************
/** /**
@ -214,12 +218,12 @@ private:
CBarInfo BarInfo; CBarInfo BarInfo;
// Connection input (used only for TargetType, TeamMemberType and AnimalType) // Connection input (used only for TargetType, TeamMemberType and AnimalType)
class CCDBNodeLeaf *UIDIn; NLMISC::CCDBNodeLeaf *UIDIn;
class CCDBNodeLeaf *PresentIn; // if not NULL, this is an additional test: if(PresentIn->getValue()==0) => not present NLMISC::CCDBNodeLeaf *PresentIn; // if not NULL, this is an additional test: if(PresentIn->getValue()==0) => not present
class CCDBNodeLeaf *ScoreIn[SCORES::NUM_SCORES]; NLMISC::CCDBNodeLeaf *ScoreIn[SCORES::NUM_SCORES];
// Connection output // Connection output
class CCDBNodeLeaf *ScoreOut[SCORES::NUM_SCORES]; NLMISC::CCDBNodeLeaf *ScoreOut[SCORES::NUM_SCORES];
public: public:
CBarDataEntry(); CBarDataEntry();
@ -258,11 +262,11 @@ private:
// last score get from impulse USER:BARS // last score get from impulse USER:BARS
sint32 Score; sint32 Score;
// input DB value, to get the current MAX // input DB value, to get the current MAX
class CCDBNodeLeaf *DBInMax; NLMISC::CCDBNodeLeaf *DBInMax;
// output DB to store the real value, but clamped to 0 // output DB to store the real value, but clamped to 0
class CCDBNodeLeaf *DBOutVal; NLMISC::CCDBNodeLeaf *DBOutVal;
// output DB to store the ratio -1024,1024 value // output DB to store the ratio -1024,1024 value
class CCDBNodeLeaf *DBOutRatio; NLMISC::CCDBNodeLeaf *DBOutRatio;
CUserScore() CUserScore()
{ {
Score= 0; Score= 0;

View file

@ -29,6 +29,8 @@
static const char *WIN_BOT_CHAT_PAGE_PLAYER_GIFT = "ui:interface:bot_chat_player_gift"; static const char *WIN_BOT_CHAT_PAGE_PLAYER_GIFT = "ui:interface:bot_chat_player_gift";
using NLMISC::CCDBNodeLeaf;
// ************************************************************************************* // *************************************************************************************
void CBotChatPagePlayerGift::begin() void CBotChatPagePlayerGift::begin()
{ {

View file

@ -142,7 +142,7 @@ private:
uint32 _FilterBuyDlgMaxValue; uint32 _FilterBuyDlgMaxValue;
// keep pointer on leaf for fame price factor // keep pointer on leaf for fame price factor
CCDBNodeLeaf * _FamePriceFactorLeaf; NLMISC::CCDBNodeLeaf * _FamePriceFactorLeaf;
bool _DownloadComplete; bool _DownloadComplete;
private: private:

View file

@ -23,6 +23,9 @@
class CViewBase; class CViewBase;
class ucstring; class ucstring;
namespace NLMISC{
class CCDBNodeLeaf;
}
/** Class to get chat text parameters, and to build new text lines /** Class to get chat text parameters, and to build new text lines
* \author Nicolas Vizerie * \author Nicolas Vizerie
@ -56,9 +59,9 @@ public:
private: private:
static CChatTextManager *_Instance; static CChatTextManager *_Instance;
mutable class CCDBNodeLeaf *_TextFontSize; mutable NLMISC::CCDBNodeLeaf *_TextFontSize;
mutable CCDBNodeLeaf *_TextMultilineSpace; mutable NLMISC::CCDBNodeLeaf *_TextMultilineSpace;
mutable CCDBNodeLeaf *_TextShadowed; mutable NLMISC::CCDBNodeLeaf *_TextShadowed;
// ctor, private because of singleton // ctor, private because of singleton
CChatTextManager(); CChatTextManager();

View file

@ -28,7 +28,7 @@
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CCtrlScroll : public CCtrlBase, public ICDBNode::IPropertyObserver class CCtrlScroll : public CCtrlBase, public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
@ -183,7 +183,7 @@ protected:
void computeTargetOfsFromPos(); void computeTargetOfsFromPos();
// from IPropertyObserver // from IPropertyObserver
virtual void update(ICDBNode *node); virtual void update(NLMISC::ICDBNode *node);
// step the value, and clamp it // step the value, and clamp it
void normalizeValue(sint32 &value); void normalizeValue(sint32 &value);

View file

@ -318,7 +318,7 @@ public:
static void setCurrSelection(CDBCtrlSheet *selected); static void setCurrSelection(CDBCtrlSheet *selected);
// get the root branch containing the properties for that sheet // get the root branch containing the properties for that sheet
CCDBNodeBranch *getRootBranch() const; NLMISC::CCDBNodeBranch *getRootBranch() const;
/** If the branch in setSheet(branch) is of the form ...:# (where # is a number), return this number. /** If the branch in setSheet(branch) is of the form ...:# (where # is a number), return this number.
* The value is hence modified by setSheet(). return 0 if not of this form. * The value is hence modified by setSheet(). return 0 if not of this form.
@ -443,7 +443,7 @@ public:
sint getIndexInParent() const; sint getIndexInParent() const;
// get the 'LOCKED' field in the db // get the 'LOCKED' field in the db
CCDBNodeLeaf *getLockValuePtr() { return _GrayedLink; } NLMISC::CCDBNodeLeaf *getLockValuePtr() { return _GrayedLink; }
/// \name Macro /// \name Macro
// @{ // @{
@ -483,35 +483,35 @@ public:
void initSheetSize(); void initSheetSize();
// @} // @}
CCDBNodeLeaf *getSlotType() const { return _TradeSlotType.getNodePtr(); } NLMISC::CCDBNodeLeaf *getSlotType() const { return _TradeSlotType.getNodePtr(); }
// get item weight // get item weight
uint16 getItemWeight() const; uint16 getItemWeight() const;
CCDBNodeLeaf *getItemWeightPtr() const; NLMISC::CCDBNodeLeaf *getItemWeightPtr() const;
// set item weight // set item weight
void setItemWeight(uint16 weight); void setItemWeight(uint16 weight);
// get item info version // get item info version
uint8 getItemInfoVersion() const; uint8 getItemInfoVersion() const;
CCDBNodeLeaf *getItemInfoVersionPtr() const; NLMISC::CCDBNodeLeaf *getItemInfoVersionPtr() const;
// set item info version // set item info version
void setItemInfoVersion(uint8 infoVersion); void setItemInfoVersion(uint8 infoVersion);
// get item Locked state // get item Locked state
uint16 getItemLocked() const; uint16 getItemLocked() const;
CCDBNodeLeaf *getItemLockedPtr() const; NLMISC::CCDBNodeLeaf *getItemLockedPtr() const;
// set item locked state // set item locked state
void setItemLocked(uint16 lock); void setItemLocked(uint16 lock);
// get item PRICE. 0 if no DB // get item PRICE. 0 if no DB
sint32 getItemPrice() const; sint32 getItemPrice() const;
CCDBNodeLeaf *getItemPricePtr() const; NLMISC::CCDBNodeLeaf *getItemPricePtr() const;
// set item PRICE // set item PRICE
void setItemPrice(sint32 price); void setItemPrice(sint32 price);
// get item RESALE_FLAG. 0 if no DB // get item RESALE_FLAG. 0 if no DB
sint32 getItemResaleFlag() const; sint32 getItemResaleFlag() const;
CCDBNodeLeaf *getItemResaleFlagPtr() const; NLMISC::CCDBNodeLeaf *getItemResaleFlagPtr() const;
// set item RESALE_FLAG // set item RESALE_FLAG
void setItemResaleFlag(sint32 rf); void setItemResaleFlag(sint32 rf);
@ -523,25 +523,25 @@ public:
// get item SELLER_TYPE. 0 if no DB // get item SELLER_TYPE. 0 if no DB
sint32 getItemSellerType() const; sint32 getItemSellerType() const;
CCDBNodeLeaf *getItemSellerTypePtr() const; NLMISC::CCDBNodeLeaf *getItemSellerTypePtr() const;
// set item SELLER_TYPE // set item SELLER_TYPE
void setItemSellerType(sint32 rf); void setItemSellerType(sint32 rf);
// get item FABER_QUALITY. 0 if no DB // get item FABER_QUALITY. 0 if no DB
RM_CLASS_TYPE::TRMClassType getItemRMClassType() const; RM_CLASS_TYPE::TRMClassType getItemRMClassType() const;
CCDBNodeLeaf *getItemRMClassTypePtr() const {return _ItemRMClassType;} NLMISC::CCDBNodeLeaf *getItemRMClassTypePtr() const {return _ItemRMClassType;}
// set item FABER_QUALITY // set item FABER_QUALITY
void setItemRMClassType(sint32 fq); void setItemRMClassType(sint32 fq);
// get item FABER_STAT_TYPE. 0 if no DB // get item FABER_STAT_TYPE. 0 if no DB
RM_FABER_STAT_TYPE::TRMStatType getItemRMFaberStatType() const; RM_FABER_STAT_TYPE::TRMStatType getItemRMFaberStatType() const;
CCDBNodeLeaf *getItemRMFaberStatTypePtr() const {return _ItemRMFaberStatType;} NLMISC::CCDBNodeLeaf *getItemRMFaberStatTypePtr() const {return _ItemRMFaberStatType;}
// set item FABER_STAT_TYPE // set item FABER_STAT_TYPE
void setItemRMFaberStatType(sint32 fss); void setItemRMFaberStatType(sint32 fss);
// get item PREREQUISIT_VALID. true of no DB // get item PREREQUISIT_VALID. true of no DB
bool getItemPrerequisitValid() const; bool getItemPrerequisitValid() const;
CCDBNodeLeaf *getItemPrerequisitValidPtr() const; NLMISC::CCDBNodeLeaf *getItemPrerequisitValidPtr() const;
// set item PREREQUISIT_VALID // set item PREREQUISIT_VALID
void setItemPrerequisitValid(bool prv); void setItemPrerequisitValid(bool prv);
@ -610,8 +610,8 @@ protected:
CInterfaceProperty _Worned; // if true means that item is worned (red cross, no longer usable unless it's a tool) CInterfaceProperty _Worned; // if true means that item is worned (red cross, no longer usable unless it's a tool)
// As node leaf for backward compatibilities // As node leaf for backward compatibilities
CCDBNodeLeaf *_ItemRMClassType; NLMISC::CCDBNodeLeaf *_ItemRMClassType;
CCDBNodeLeaf *_ItemRMFaberStatType; NLMISC::CCDBNodeLeaf *_ItemRMFaberStatType;
mutable sint32 _LastSheetId; mutable sint32 _LastSheetId;
@ -703,7 +703,7 @@ protected:
// This String is optional and usage dependent for Item, Macro, or Sentence // This String is optional and usage dependent for Item, Macro, or Sentence
std::string _OptString; std::string _OptString;
CCDBNodeLeaf *_GrayedLink; NLMISC::CCDBNodeLeaf *_GrayedLink;
// Macro or sentence String compiled as texture Ids and positions, from the _OptString. // Macro or sentence String compiled as texture Ids and positions, from the _OptString.
struct CCharBitmap struct CCharBitmap
@ -734,7 +734,7 @@ protected:
sint32 _ItemCaracReqValue; sint32 _ItemCaracReqValue;
// Special for Armour // Special for Armour
CCDBNodeLeaf *_UserColor; NLMISC::CCDBNodeLeaf *_UserColor;
// keep pointer on item sheet // keep pointer on item sheet
const CItemSheet *_ItemSheet; const CItemSheet *_ItemSheet;

View file

@ -141,14 +141,14 @@ protected:
// branch of the DB // branch of the DB
CCDBNodeBranch *_DbBranch; NLMISC::CCDBNodeBranch *_DbBranch;
std::string _DbBranchName; std::string _DbBranchName;
// Branch observer // Branch observer
class CDBObs : public ICDBNode::IPropertyObserver class CDBObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
CDBGroupListSheet *Owner; CDBGroupListSheet *Owner;
virtual void update(ICDBNode* /* node */) {Owner->_BranchModified= true;} virtual void update(NLMISC::ICDBNode* /* node */) {Owner->_BranchModified= true;}
}; };
friend class CDBObs; friend class CDBObs;
CDBObs _DbBranchObs; CDBObs _DbBranchObs;
@ -192,7 +192,7 @@ protected:
} }
// For animals only // For animals only
CCDBNodeLeaf *_AnimalStatus; NLMISC::CCDBNodeLeaf *_AnimalStatus;
sint32 _CacheAnimalStatus; sint32 _CacheAnimalStatus;
// For sectionnable purpose // For sectionnable purpose

View file

@ -44,7 +44,7 @@ public:
private: private:
sint32 _TextId; sint32 _TextId;
std::vector<CCDBNodeLeaf*> _DisableStates; std::vector<NLMISC::CCDBNodeLeaf*> _DisableStates;
}; };

View file

@ -45,7 +45,7 @@ public:
virtual bool isInvalidated(CDBGroupListSheet *pFather); virtual bool isInvalidated(CDBGroupListSheet *pFather);
virtual void update(CDBGroupListSheet *pFather); virtual void update(CDBGroupListSheet *pFather);
virtual sint getSectionId() const; virtual sint getSectionId() const;
CCDBNodeLeaf *LevelDB; NLMISC::CCDBNodeLeaf *LevelDB;
uint LevelCache; uint LevelCache;
}; };

View file

@ -20,7 +20,7 @@
#include "dbgroup_list_sheet_mission.h" #include "dbgroup_list_sheet_mission.h"
#include "view_text_id_formated.h" #include "view_text_id_formated.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "interface_manager.h" #include "interface_manager.h"
using namespace std; using namespace std;

View file

@ -203,14 +203,14 @@ protected:
// branch of the DB // branch of the DB
CCDBNodeBranch *_DbBranch; NLMISC::CCDBNodeBranch *_DbBranch;
std::string _DbBranchName; std::string _DbBranchName;
// Branch observer // Branch observer
class CDBObs : public ICDBNode::IPropertyObserver class CDBObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
CDBGroupListSheetText *Owner; CDBGroupListSheetText *Owner;
virtual void update(ICDBNode* /* node */) {Owner->_BranchModified= true;} virtual void update(NLMISC::ICDBNode* /* node */) {Owner->_BranchModified= true;}
}; };
friend class CDBObs; friend class CDBObs;
CDBObs _DbBranchObs; CDBObs _DbBranchObs;
@ -269,7 +269,7 @@ protected:
sint getIndexOf(const CCtrlButton *button) const; sint getIndexOf(const CCtrlButton *button) const;
// For animals only // For animals only
CCDBNodeLeaf *_AnimalStatus; NLMISC::CCDBNodeLeaf *_AnimalStatus;
sint32 _CacheAnimalStatus; sint32 _CacheAnimalStatus;
// For items only (requirement color) // For items only (requirement color)

View file

@ -46,7 +46,7 @@ public:
virtual void update(CDBGroupListSheetText *pFather); virtual void update(CDBGroupListSheetText *pFather);
virtual void updateViewText(CDBGroupListSheetText *pFather); virtual void updateViewText(CDBGroupListSheetText *pFather);
virtual sint getSectionId() const; virtual sint getSectionId() const;
CCDBNodeLeaf *LevelDB; NLMISC::CCDBNodeLeaf *LevelDB;
uint LevelCache; uint LevelCache;
}; };

View file

@ -140,7 +140,7 @@ protected:
bool _ApplyFamePriceFactor; bool _ApplyFamePriceFactor;
// keep pointer on leaf for fame price factor // keep pointer on leaf for fame price factor
CCDBNodeLeaf * _FamePriceFactorLeaf; NLMISC::CCDBNodeLeaf * _FamePriceFactorLeaf;
sint16 _LastFamePriceFactor; sint16 _LastFamePriceFactor;
TSellerTypeFilter _SellerTypeFilter; TSellerTypeFilter _SellerTypeFilter;

View file

@ -110,7 +110,7 @@ private:
CCompassTarget _SavedTarget; CCompassTarget _SavedTarget;
bool _SavedTargetValid; bool _SavedTargetValid;
CCDBNodeLeaf *_DynamicTargetPos; NLMISC::CCDBNodeLeaf *_DynamicTargetPos;
uint32 _LastDynamicTargetPos; uint32 _LastDynamicTargetPos;
// Color for each type of target // Color for each type of target

View file

@ -93,9 +93,9 @@ protected:
static NLMISC::CRGBA BarColorHPNegative; static NLMISC::CRGBA BarColorHPNegative;
// Node user leaf // Node user leaf
static CCDBNodeLeaf *_Value; static NLMISC::CCDBNodeLeaf *_Value;
static CCDBNodeLeaf *_ValueBegin; static NLMISC::CCDBNodeLeaf *_ValueBegin;
static CCDBNodeLeaf *_ValueEnd; static NLMISC::CCDBNodeLeaf *_ValueEnd;
// Special guild // Special guild
bool _NeedGuildNameId; bool _NeedGuildNameId;

View file

@ -35,7 +35,9 @@
class CContinent; class CContinent;
namespace NLMISC{
class CCDBNodeLeaf; class CCDBNodeLeaf;
}
class CWorldSheet; class CWorldSheet;
class CCtrlQuad; class CCtrlQuad;
struct SMap; struct SMap;
@ -425,8 +427,8 @@ private:
// have the texts been received for mission targets ? // have the texts been received for mission targets ?
std::vector<bool> _MissionTargetTextReceived; std::vector<bool> _MissionTargetTextReceived;
// ptr on db leaf for coordinates of special landmarks // ptr on db leaf for coordinates of special landmarks
CCDBNodeLeaf *_TargetPos; NLMISC::CCDBNodeLeaf *_TargetPos;
CCDBNodeLeaf *_HomePos; NLMISC::CCDBNodeLeaf *_HomePos;
// Animals State for landMarks // Animals State for landMarks
std::vector<NLMISC::CSmartPtr<CAnimalPositionState> > _AnimalPosStates; std::vector<NLMISC::CSmartPtr<CAnimalPositionState> > _AnimalPosStates;
// Teammate State for landMarks // Teammate State for landMarks

View file

@ -53,12 +53,12 @@ private:
private: private:
// observer to know that brick family are modified // observer to know that brick family are modified
struct CBrickFamilyObs : public ICDBNode::IPropertyObserver struct CBrickFamilyObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
CGroupPhraseSkillFilter *Owner; CGroupPhraseSkillFilter *Owner;
BRICK_FAMILIES::TBrickFamily BrickFamily; BRICK_FAMILIES::TBrickFamily BrickFamily;
virtual void update (ICDBNode *node); virtual void update (NLMISC::ICDBNode *node);
}; };
friend struct CBrickFamilyObs; friend struct CBrickFamilyObs;
CBrickFamilyObs _BrickFamilyObs[BRICK_FAMILIES::NbFamilies]; CBrickFamilyObs _BrickFamilyObs[BRICK_FAMILIES::NbFamilies];

View file

@ -51,10 +51,10 @@ private:
private: private:
// observer to know that skills are modified // observer to know that skills are modified
struct CSkillsObs : public ICDBNode::IPropertyObserver struct CSkillsObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
CGroupSkills *Owner; CGroupSkills *Owner;
virtual void update (ICDBNode *node); virtual void update (NLMISC::ICDBNode *node);
} _SkillsObs; } _SkillsObs;
friend struct CSkillsObs; friend struct CSkillsObs;

View file

@ -22,7 +22,7 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "obs_huge_list.h" #include "obs_huge_list.h"
#include "dbgroup_list_sheet_text.h" #include "dbgroup_list_sheet_text.h"
#include "../cdb.h" #include "nel/misc/cdb.h"
#include "game_share/guild_grade.h" #include "game_share/guild_grade.h"
#include "game_share/misc_const.h" #include "game_share/misc_const.h"
@ -209,15 +209,15 @@ private:
// Database management stuff // Database management stuff
class CDBObs : public ICDBNode::IPropertyObserver class CDBObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
class CDBObsMembers : public ICDBNode::IPropertyObserver class CDBObsMembers : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
CDBObs _DBObs; CDBObs _DBObs;

View file

@ -22,7 +22,9 @@
#include "nel/misc/stream.h" #include "nel/misc/stream.h"
class CGroupContainer; class CGroupContainer;
namespace NLMISC{
class CCDBNodeLeaf; class CCDBNodeLeaf;
}
/** /**
* interface config * interface config
@ -111,8 +113,8 @@ public:
// ------------------------------ // ------------------------------
void serial (NLMISC::IStream &f); void serial (NLMISC::IStream &f);
// ------------------------------ // ------------------------------
void setFrom (CCDBNodeLeaf *pNL); void setFrom (NLMISC::CCDBNodeLeaf *pNL);
void setTo (CCDBNodeLeaf *pNL); void setTo (NLMISC::CCDBNodeLeaf *pNL);
}; };
void dataBaseToStream (NLMISC::IStream &f); void dataBaseToStream (NLMISC::IStream &f);

View file

@ -52,7 +52,7 @@ public:
void updateRealtime(CCtrlBase *pSB, bool updateOnScrollEnd); void updateRealtime(CCtrlBase *pSB, bool updateOnScrollEnd);
// Update all parameters to obey their preset (no op if no preset or if preset is Custom) // Update all parameters to obey their preset (no op if no preset or if preset is Custom)
void updateParamPreset(CCDBNodeLeaf *presetChanged); void updateParamPreset(NLMISC::CCDBNodeLeaf *presetChanged);
// set apply button can be pushed // set apply button can be pushed
void validateApplyButton(); void validateApplyButton();
@ -90,7 +90,7 @@ private:
sint32 RTBackupValue; // When canceling sint32 RTBackupValue; // When canceling
// For ConfigFile widget only // For ConfigFile widget only
CCDBNodeLeaf *PresetDB; NLMISC::CCDBNodeLeaf *PresetDB;
// ----------------------- // -----------------------
CParam() CParam()
@ -128,16 +128,16 @@ private:
std::vector<CParam> _Parameters; std::vector<CParam> _Parameters;
// For preset change // For preset change
class CPresetObs : public ICDBNode::IPropertyObserver class CPresetObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
CInterfaceDDX *Owner; CInterfaceDDX *Owner;
CPresetObs() : Owner(NULL) {} CPresetObs() : Owner(NULL) {}
}; };
CPresetObs _PresetObs; CPresetObs _PresetObs;
std::set<CCDBNodeLeaf*> _PresetNodes; std::set<NLMISC::CCDBNodeLeaf*> _PresetNodes;
// reset the preset values according to parameters values // reset the preset values according to parameters values
void resetPreSet(); void resetPreSet();

View file

@ -26,8 +26,11 @@
#include "nel/misc/ucstring.h" #include "nel/misc/ucstring.h"
#include "nel/misc/rgba.h" #include "nel/misc/rgba.h"
namespace NLMISC{
class ICDBNode; class ICDBNode;
class CCDBNodeLeaf;
class CCDBNodeBranch;
}
struct CInterfaceExprUserType; struct CInterfaceExprUserType;
@ -166,7 +169,7 @@ public:
* Node will only be inserted once, so we end up with a set of node (not ordered) * Node will only be inserted once, so we end up with a set of node (not ordered)
* \param noFctCalls when set to true, the terminal function calls will not be made, so the evaluation is only used to see which database entries the expression depends on. * \param noFctCalls when set to true, the terminal function calls will not be made, so the evaluation is only used to see which database entries the expression depends on.
*/ */
static bool eval(const std::string &expr, CInterfaceExprValue &result, std::vector<ICDBNode *> *nodes = NULL, bool noFctCalls = false); static bool eval(const std::string &expr, CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> *nodes = NULL, bool noFctCalls = false);
/** Build a tree from the given expression so that it can be evaluated quickly. /** Build a tree from the given expression so that it can be evaluated quickly.
* This is useful for a fixed expression that must be evaluated often * This is useful for a fixed expression that must be evaluated often
@ -193,11 +196,11 @@ private:
/** eval the value of a single expression /** eval the value of a single expression
* \return position to the next valid character * \return position to the next valid character
*/ */
static const char *evalExpr(const char *expr, CInterfaceExprValue &result, std::vector<ICDBNode *> *nodes, bool noFctCalls); static const char *evalExpr(const char *expr, CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> *nodes, bool noFctCalls);
static const char *evalFct(const char *expr,CInterfaceExprValue &result,std::vector<ICDBNode *> *nodes, bool noFctCalls); static const char *evalFct(const char *expr,CInterfaceExprValue &result,std::vector<NLMISC::ICDBNode *> *nodes, bool noFctCalls);
static const char *evalDBEntry(const char *expr,CInterfaceExprValue &result,std::vector<ICDBNode *> *nodes); static const char *evalDBEntry(const char *expr,CInterfaceExprValue &result,std::vector<NLMISC::ICDBNode *> *nodes);
public: public:
static const char *unpackDBentry(const char *expr, std::vector<ICDBNode *> *nodes, std::string &dest, bool *hasIndirections = NULL); static const char *unpackDBentry(const char *expr, std::vector<NLMISC::ICDBNode *> *nodes, std::string &dest, bool *hasIndirections = NULL);
/** Build tree of a single expression /** Build tree of a single expression
* \return position to the next valid character * \return position to the next valid character

View file

@ -18,8 +18,12 @@
#include "stdpch.h" #include "stdpch.h"
#include "interface_expr_node.h" #include "interface_expr_node.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "../cdb_branch.h" #include "nel/misc/cdb_branch.h"
using NLMISC::ICDBNode;
using NLMISC::CCDBNodeBranch;
using NLMISC::CCDBNodeLeaf;
// ******************************************************************************************************* // *******************************************************************************************************
void CInterfaceExprNodeValue::eval(CInterfaceExprValue &result) void CInterfaceExprNodeValue::eval(CInterfaceExprValue &result)

View file

@ -33,9 +33,9 @@ public:
// eval result of expression, and eventually get the nodes the epression depends on // eval result of expression, and eventually get the nodes the epression depends on
virtual void eval(CInterfaceExprValue &result) = 0; virtual void eval(CInterfaceExprValue &result) = 0;
// The same, but get db nodes the expression depends on (appended to vector) // The same, but get db nodes the expression depends on (appended to vector)
virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes) = 0; virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> &nodes) = 0;
// Get dependencies of the node (appended to vector) // Get dependencies of the node (appended to vector)
virtual void getDepends(std::vector<ICDBNode *> &nodes) = 0; virtual void getDepends(std::vector<NLMISC::ICDBNode *> &nodes) = 0;
}; };
@ -48,8 +48,8 @@ public:
CInterfaceExprValue Value; CInterfaceExprValue Value;
public: public:
virtual void eval(CInterfaceExprValue &result); virtual void eval(CInterfaceExprValue &result);
virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> &nodes);
virtual void getDepends(std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<NLMISC::ICDBNode *> &nodes);
}; };
// ******************************************************************************************************* // *******************************************************************************************************
@ -63,8 +63,8 @@ public:
std::vector<CInterfaceExprNode *> Params; std::vector<CInterfaceExprNode *> Params;
public: public:
virtual void eval(CInterfaceExprValue &result); virtual void eval(CInterfaceExprValue &result);
virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> &nodes);
virtual void getDepends(std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<NLMISC::ICDBNode *> &nodes);
virtual ~CInterfaceExprNodeValueFnCall(); virtual ~CInterfaceExprNodeValueFnCall();
}; };
@ -74,11 +74,11 @@ public:
class CInterfaceExprNodeDBLeaf : public CInterfaceExprNode class CInterfaceExprNodeDBLeaf : public CInterfaceExprNode
{ {
public: public:
class CCDBNodeLeaf *Leaf; class NLMISC::CCDBNodeLeaf *Leaf;
public: public:
virtual void eval(CInterfaceExprValue &result); virtual void eval(CInterfaceExprValue &result);
virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> &nodes);
virtual void getDepends(std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<NLMISC::ICDBNode *> &nodes);
}; };
// ******************************************************************************************************* // *******************************************************************************************************
@ -87,11 +87,11 @@ public:
class CInterfaceExprNodeDBBranch : public CInterfaceExprNode class CInterfaceExprNodeDBBranch : public CInterfaceExprNode
{ {
public: public:
class CCDBNodeBranch *Branch; class NLMISC::CCDBNodeBranch *Branch;
public: public:
virtual void eval(CInterfaceExprValue &result); virtual void eval(CInterfaceExprValue &result);
virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> &nodes);
virtual void getDepends(std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<NLMISC::ICDBNode *> &nodes);
}; };
// ******************************************************************************************************* // *******************************************************************************************************
@ -104,8 +104,8 @@ public:
std::string Expr; std::string Expr;
public: public:
virtual void eval(CInterfaceExprValue &result); virtual void eval(CInterfaceExprValue &result);
virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<ICDBNode *> &nodes); virtual void evalWithDepends(CInterfaceExprValue &result, std::vector<NLMISC::ICDBNode *> &nodes);
virtual void getDepends(std::vector<ICDBNode *> &nodes); virtual void getDepends(std::vector<NLMISC::ICDBNode *> &nodes);
}; };

View file

@ -24,7 +24,7 @@
#include "interface_manager.h" #include "interface_manager.h"
#include "interface_expr_node.h" #include "interface_expr_node.h"
#include "reflect.h" #include "reflect.h"
#include "../cdb_branch.h" #include "nel/misc/cdb_branch.h"
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -19,7 +19,7 @@
#ifndef CL_INTERFACE_LINK_H #ifndef CL_INTERFACE_LINK_H
#define CL_INTERFACE_LINK_H #define CL_INTERFACE_LINK_H
#include "../cdb_branch.h" #include "nel/misc/cdb_branch.h"
class CInterfaceElement; class CInterfaceElement;
class CReflectedProperty; class CReflectedProperty;
@ -45,7 +45,7 @@ class CInterfaceExprNode;
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CInterfaceLink : public ICDBNode::IPropertyObserver class CInterfaceLink : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
#ifdef NL_DEBUG #ifdef NL_DEBUG
@ -66,7 +66,7 @@ public:
/// Updates triggered interface links when triggered by the observed branch /// Updates triggered interface links when triggered by the observed branch
class CInterfaceLinkUpdater : public CCDBNodeBranch::IBranchObserverCallFlushObserver class CInterfaceLinkUpdater : public NLMISC::CCDBNodeBranch::IBranchObserverCallFlushObserver
{ {
public: public:
CInterfaceLinkUpdater(); CInterfaceLinkUpdater();
@ -119,7 +119,7 @@ private:
typedef std::list<CInterfaceLink *> TLinkList; typedef std::list<CInterfaceLink *> TLinkList;
typedef NLMISC::CSmartPtr<CInterfaceLink> TLinkSmartPtr; typedef NLMISC::CSmartPtr<CInterfaceLink> TLinkSmartPtr;
typedef std::vector<TLinkSmartPtr> TLinkVect; typedef std::vector<TLinkSmartPtr> TLinkVect;
typedef std::vector<ICDBNode *> TNodeVect; typedef std::vector<NLMISC::ICDBNode *> TNodeVect;
private: private:
std::vector<CTarget> _Targets; std::vector<CTarget> _Targets;
TNodeVect _ObservedNodes; TNodeVect _ObservedNodes;
@ -161,7 +161,7 @@ private:
* This doesn't update the node directly, but mark it as 'triggered' * This doesn't update the node directly, but mark it as 'triggered'
* The node is really updated during the call to 'updateTrigeredLinks()' * The node is really updated during the call to 'updateTrigeredLinks()'
*/ */
virtual void update(ICDBNode *node); virtual void update(NLMISC::ICDBNode *node);
void createObservers(const TNodeVect &nodes); void createObservers(const TNodeVect &nodes);
void removeObservers(const TNodeVect &nodes); void removeObservers(const TNodeVect &nodes);
// debug : check that there are as many targets as reference to a link // debug : check that there are as many targets as reference to a link

View file

@ -229,12 +229,12 @@ public:
/// Get the root of the database /// Get the root of the database
CCDBNodeBranch *getDB() const { return _DbRootNode; } NLMISC::CCDBNodeBranch *getDB() const { return _DbRootNode; }
// yoyo: should avoid to try creating DbPropr with this system... very dangerous // yoyo: should avoid to try creating DbPropr with this system... very dangerous
CCDBNodeLeaf* getDbProp (const std::string & name, bool bCreate=true); NLMISC::CCDBNodeLeaf* getDbProp (const std::string & name, bool bCreate=true);
void delDbProp(const std::string & name); void delDbProp(const std::string & name);
// get a Db Branch by its name. NULL if don't exist or not a branch (never try to create it) // get a Db Branch by its name. NULL if don't exist or not a branch (never try to create it)
CCDBNodeBranch *getDbBranch(const std::string &name); NLMISC::CCDBNodeBranch *getDbBranch(const std::string &name);
// return the DB as an int32. return 0 if the DB does not exist (never create) // return the DB as an int32. return 0 if the DB does not exist (never create)
sint32 getDbValue32 (const std::string & name); sint32 getDbValue32 (const std::string & name);
@ -448,7 +448,7 @@ public:
* \param id : the text id of the element to observe * \param id : the text id of the element to observe
* \return true if success * \return true if success
*/ */
bool addDBObserver (ICDBNode::IPropertyObserver* observer, ICDBNode::CTextId id); bool addDBObserver (NLMISC::ICDBNode::IPropertyObserver* observer, NLMISC::ICDBNode::CTextId id);
/** /**
* add an observer to a database entry * add an observer to a database entry
@ -456,17 +456,17 @@ public:
* \param id : the text id of the element to observe * \param id : the text id of the element to observe
* \return true if success * \return true if success
*/ */
bool addDBObserver (ICDBNode::IPropertyObserver* observer, const std::string& id) bool addDBObserver (NLMISC::ICDBNode::IPropertyObserver* observer, const std::string& id)
{ {
return addDBObserver(observer, ICDBNode::CTextId(id)); return addDBObserver(observer, NLMISC::ICDBNode::CTextId(id));
} }
/** remove the observer from the dataBase /** remove the observer from the dataBase
*/ */
bool removeDBObserver (ICDBNode::IPropertyObserver* observer, ICDBNode::CTextId id); bool removeDBObserver (NLMISC::ICDBNode::IPropertyObserver* observer, NLMISC::ICDBNode::CTextId id);
bool removeDBObserver (ICDBNode::IPropertyObserver* observer, const std::string& id) bool removeDBObserver (NLMISC::ICDBNode::IPropertyObserver* observer, const std::string& id)
{ {
return removeDBObserver(observer, ICDBNode::CTextId(id)); return removeDBObserver(observer, NLMISC::ICDBNode::CTextId(id));
} }
/// \name Global Interface Options /// \name Global Interface Options
@ -658,7 +658,7 @@ public:
uint8 getLocalSyncActionCounter() const {return _LocalSyncActionCounter;} uint8 getLocalSyncActionCounter() const {return _LocalSyncActionCounter;}
uint8 getLocalSyncActionCounterMask() const {return _LocalSyncActionCounterMask;} uint8 getLocalSyncActionCounterMask() const {return _LocalSyncActionCounterMask;}
bool localActionCounterSynchronizedWith(CCDBNodeLeaf *leaf) bool localActionCounterSynchronizedWith(NLMISC::CCDBNodeLeaf *leaf)
{ {
if (!leaf) return false; if (!leaf) return false;
uint srvVal= leaf->getValue32(); uint srvVal= leaf->getValue32();
@ -737,31 +737,31 @@ private:
void release(); void release();
// When something in the SERVER DB changes // When something in the SERVER DB changes
void onServerChange(ICDBNode *serverNode); void onServerChange(NLMISC::ICDBNode *serverNode);
// When something in the LOCAL DB changes // When something in the LOCAL DB changes
void onLocalChange(ICDBNode *localNode); void onLocalChange(NLMISC::ICDBNode *localNode);
private: private:
class CLocalDBObserver : public ICDBNode::IPropertyObserver class CLocalDBObserver : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
CServerToLocalAutoCopy &_Owner; CServerToLocalAutoCopy &_Owner;
CLocalDBObserver(CServerToLocalAutoCopy &owner) : _Owner(owner) {} CLocalDBObserver(CServerToLocalAutoCopy &owner) : _Owner(owner) {}
virtual void update(ICDBNode *node) {_Owner.onLocalChange(node);} virtual void update(NLMISC::ICDBNode *node) {_Owner.onLocalChange(node);}
}; };
class CServerDBObserver : public ICDBNode::IPropertyObserver class CServerDBObserver : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
CServerToLocalAutoCopy &_Owner; CServerToLocalAutoCopy &_Owner;
CServerDBObserver(CServerToLocalAutoCopy &owner) : _Owner(owner) {} CServerDBObserver(CServerToLocalAutoCopy &owner) : _Owner(owner) {}
virtual void update(ICDBNode *node) {_Owner.onServerChange(node);} virtual void update(NLMISC::ICDBNode *node) {_Owner.onServerChange(node);}
}; };
// A node here is a pair Server<->Local // A node here is a pair Server<->Local
struct CNode struct CNode
{ {
CCDBNodeLeaf *ServerNode; NLMISC::CCDBNodeLeaf *ServerNode;
CCDBNodeLeaf *LocalNode; NLMISC::CCDBNodeLeaf *LocalNode;
bool InsertedInUpdateList; bool InsertedInUpdateList;
CNode() CNode()
{ {
@ -786,7 +786,7 @@ private:
private: private:
// Counter Node // Counter Node
CCDBNodeLeaf *_ServerCounter; NLMISC::CCDBNodeLeaf *_ServerCounter;
// updaters // updaters
CLocalDBObserver _LocalObserver; CLocalDBObserver _LocalObserver;
CServerDBObserver _ServerObserver; CServerDBObserver _ServerObserver;
@ -802,7 +802,7 @@ private:
// List of nodes to update until next synchonized client-server counter // List of nodes to update until next synchonized client-server counter
std::vector<CNode*> _UpdateList; std::vector<CNode*> _UpdateList;
void buildRecursLocalLeaves(CCDBNodeBranch *branch, std::vector<CCDBNodeLeaf*> &leaves); void buildRecursLocalLeaves(NLMISC::CCDBNodeBranch *branch, std::vector<NLMISC::CCDBNodeLeaf*> &leaves);
}; };
// Infos about a modal window. // Infos about a modal window.
@ -833,10 +833,10 @@ private:
// Database management stuff // Database management stuff
class CDBLandmarkObs : public ICDBNode::IPropertyObserver class CDBLandmarkObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode *node); virtual void update(NLMISC::ICDBNode *node);
}; };
// EMOTES // EMOTES
@ -858,22 +858,22 @@ private:
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
public: public:
// cache and expose some commonly used db nodes // cache and expose some commonly used db nodes
CCDBNodeBranch *_DBB_UI_DUMMY; NLMISC::CCDBNodeBranch *_DBB_UI_DUMMY;
CCDBNodeLeaf *_DB_UI_DUMMY_QUANTITY; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_QUANTITY;
CCDBNodeLeaf *_DB_UI_DUMMY_QUALITY; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_QUALITY;
CCDBNodeLeaf *_DB_UI_DUMMY_SHEET; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_SHEET;
CCDBNodeLeaf *_DB_UI_DUMMY_NAMEID; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_NAMEID;
CCDBNodeLeaf *_DB_UI_DUMMY_ENCHANT; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_ENCHANT;
CCDBNodeLeaf *_DB_UI_DUMMY_SLOT_TYPE; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_SLOT_TYPE;
CCDBNodeLeaf *_DB_UI_DUMMY_PHRASE; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_PHRASE;
CCDBNodeLeaf *_DB_UI_DUMMY_WORNED; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_WORNED;
CCDBNodeLeaf *_DB_UI_DUMMY_PREREQUISIT_VALID; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_PREREQUISIT_VALID;
CCDBNodeLeaf *_DB_UI_DUMMY_FACTION_TYPE; NLMISC::CCDBNodeLeaf *_DB_UI_DUMMY_FACTION_TYPE;
private: private:
CCDBNodeLeaf *_CheckMailNode; NLMISC::CCDBNodeLeaf *_CheckMailNode;
CCDBNodeLeaf *_CheckForumNode; NLMISC::CCDBNodeLeaf *_CheckForumNode;
sint64 _UpdateWeatherTime; sint64 _UpdateWeatherTime;
// @} // @}
@ -908,7 +908,7 @@ private:
///the singleton's instance ///the singleton's instance
static CInterfaceManager* _Instance; static CInterfaceManager* _Instance;
CCDBNodeLeaf *_DescTextTarget; NLMISC::CCDBNodeLeaf *_DescTextTarget;
// Capture // Capture
NLMISC::CRefPtr<CCtrlBase> _CaptureKeyboard; NLMISC::CRefPtr<CCtrlBase> _CaptureKeyboard;
@ -960,7 +960,7 @@ private:
sint32 _LastInGameScreenW, _LastInGameScreenH; // Resolution used for last InGame interface sint32 _LastInGameScreenW, _LastInGameScreenH; // Resolution used for last InGame interface
// root node for interfaces properties in the databases // root node for interfaces properties in the databases
CCDBNodeBranch *_DbRootNode; NLMISC::CCDBNodeBranch *_DbRootNode;
// List of active Anims // List of active Anims
std::vector<CInterfaceAnim*> _ActiveAnims; std::vector<CInterfaceAnim*> _ActiveAnims;
@ -998,14 +998,14 @@ private:
void restoreAllContainersBackupPosition(); void restoreAllContainersBackupPosition();
// Some Node leaf // Some Node leaf
CCDBNodeLeaf *_NeutralColor; NLMISC::CCDBNodeLeaf *_NeutralColor;
CCDBNodeLeaf *_WarningColor; NLMISC::CCDBNodeLeaf *_WarningColor;
CCDBNodeLeaf *_ErrorColor; NLMISC::CCDBNodeLeaf *_ErrorColor;
CCDBNodeLeaf *_RProp; NLMISC::CCDBNodeLeaf *_RProp;
CCDBNodeLeaf *_GProp; NLMISC::CCDBNodeLeaf *_GProp;
CCDBNodeLeaf *_BProp; NLMISC::CCDBNodeLeaf *_BProp;
CCDBNodeLeaf *_AProp; NLMISC::CCDBNodeLeaf *_AProp;
CCDBNodeLeaf *_AlphaRolloverSpeedDB; NLMISC::CCDBNodeLeaf *_AlphaRolloverSpeedDB;
// The next ViewText to draw for Over // The next ViewText to draw for Over
NLMISC::CRefPtr<CInterfaceElement> _OverExtendViewText; NLMISC::CRefPtr<CInterfaceElement> _OverExtendViewText;

View file

@ -30,7 +30,7 @@
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class IInterfaceObserver : public ICDBNode::IPropertyObserver class IInterfaceObserver : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
@ -45,7 +45,7 @@ public:
/** /**
* observer update * observer update
*/ */
virtual void update (CCDBNodeLeaf* leaf)=0; virtual void update (NLMISC::CCDBNodeLeaf* leaf)=0;
}; };
@ -160,7 +160,7 @@ public:
return NULL; return NULL;
} }
} }
if ( ! iMngr->addDBObserver(obs,ICDBNode::CTextId (data) ) ) if ( ! iMngr->addDBObserver(obs,NLMISC::ICDBNode::CTextId (data) ) )
{ {
return NULL; return NULL;
} }

View file

@ -22,9 +22,9 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "nel/misc/rgba.h" #include "nel/misc/rgba.h"
#include "../cdb.h" #include "nel/misc/cdb.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "../cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include "../cdb_synchronised.h" #include "../cdb_synchronised.h"
@ -50,20 +50,20 @@ public:
_VolatileValue = NULL; _VolatileValue = NULL;
} }
CCDBNodeLeaf* getNodePtr() const NLMISC::CCDBNodeLeaf* getNodePtr() const
{ {
return _VolatileValue; return _VolatileValue;
} }
void setNodePtr(CCDBNodeLeaf *ptr) void setNodePtr(NLMISC::CCDBNodeLeaf *ptr)
{ {
_VolatileValue = ptr; _VolatileValue = ptr;
} }
bool link (const char *DBProp); bool link (const char *DBProp);
bool link( CCDBNodeLeaf *dbNode ); bool link( NLMISC::CCDBNodeLeaf *dbNode );
bool link( CCDBNodeBranch *dbNode, const std::string &leafId, CCDBNodeLeaf *defaultLeaf = NULL ); bool link( NLMISC::CCDBNodeBranch *dbNode, const std::string &leafId, NLMISC::CCDBNodeLeaf *defaultLeaf = NULL );
/// float operations /// float operations
void setDouble (double value) {setSInt64((sint64&) value);} void setDouble (double value) {setSInt64((sint64&) value);}
@ -99,7 +99,7 @@ public:
private: private:
/// volatile value of the property (pointer to a leaf of the database) /// volatile value of the property (pointer to a leaf of the database)
CCDBNodeLeaf* _VolatileValue; NLMISC::CCDBNodeLeaf* _VolatileValue;
}; };
#endif // NL_INTERFACE_PROPERTY_H #endif // NL_INTERFACE_PROPERTY_H

View file

@ -17,16 +17,16 @@
#include "stdpch.h" #include "stdpch.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "../cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include "inventory_manager.h" #include "inventory_manager.h"
#include "interface_manager.h" #include "interface_manager.h"
#include "bot_chat_page_trade.h" #include "bot_chat_page_trade.h"
#include "bot_chat_page_all.h" #include "bot_chat_page_all.h"
#include "group_container.h" #include "group_container.h"
#include "group_menu.h" #include "group_menu.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "../cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include "list_sheet_base.h" #include "list_sheet_base.h"
#include "../net_manager.h" #include "../net_manager.h"
#include "../user_entity.h" #include "../user_entity.h"

View file

@ -19,7 +19,7 @@
#ifndef RY_INVENTORY_MANAGER_H #ifndef RY_INVENTORY_MANAGER_H
#define RY_INVENTORY_MANAGER_H #define RY_INVENTORY_MANAGER_H
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "dbgroup_list_sheet_text.h" #include "dbgroup_list_sheet_text.h"
#include "dbgroup_list_sheet.h" #include "dbgroup_list_sheet.h"
#include "game_share/item_infos.h" #include "game_share/item_infos.h"
@ -27,7 +27,9 @@
#include "game_share/inventories.h" #include "game_share/inventories.h"
#include "game_share/bot_chat_types.h" #include "game_share/bot_chat_types.h"
namespace NLMISC{
class CCDBNodeBranch; class CCDBNodeBranch;
}
class CDBCtrlSheet; class CDBCtrlSheet;
@ -55,21 +57,21 @@ const uint MAX_PLAYER_INV_ENTRIES = std::max(MAX_BAGINV_ENTRIES, MAX_ANIMALINV_E
class CItemImage class CItemImage
{ {
public: public:
CCDBNodeLeaf *Sheet; NLMISC::CCDBNodeLeaf *Sheet;
CCDBNodeLeaf *Quality; NLMISC::CCDBNodeLeaf *Quality;
CCDBNodeLeaf *Quantity; NLMISC::CCDBNodeLeaf *Quantity;
CCDBNodeLeaf *UserColor; NLMISC::CCDBNodeLeaf *UserColor;
CCDBNodeLeaf *Price; NLMISC::CCDBNodeLeaf *Price;
CCDBNodeLeaf *Weight; NLMISC::CCDBNodeLeaf *Weight;
CCDBNodeLeaf *NameId; NLMISC::CCDBNodeLeaf *NameId;
CCDBNodeLeaf *InfoVersion; NLMISC::CCDBNodeLeaf *InfoVersion;
CCDBNodeLeaf *ResaleFlag; NLMISC::CCDBNodeLeaf *ResaleFlag;
public: public:
// ctor // ctor
CItemImage(); CItemImage();
// build from a branch // build from a branch
void build(CCDBNodeBranch *branch); void build(NLMISC::CCDBNodeBranch *branch);
// shortcuts to avoid NULL pointer tests // shortcuts to avoid NULL pointer tests
uint32 getSheetID() const { return (uint32) (Sheet ? Sheet->getValue32() : 0); } uint32 getSheetID() const { return (uint32) (Sheet ? Sheet->getValue32() : 0); }
uint16 getQuality() const { return (uint16) (Quality ? Quality->getValue16() : 0); } uint16 getQuality() const { return (uint16) (Quality ? Quality->getValue16() : 0); }
@ -302,14 +304,14 @@ private:
sint32 Equip[MAX_EQUIPINV_ENTRIES]; sint32 Equip[MAX_EQUIPINV_ENTRIES];
CDBCtrlSheet *UIEquip[MAX_EQUIPINV_ENTRIES]; CDBCtrlSheet *UIEquip[MAX_EQUIPINV_ENTRIES];
CDBCtrlSheet *UIEquip2[MAX_EQUIPINV_ENTRIES]; CDBCtrlSheet *UIEquip2[MAX_EQUIPINV_ENTRIES];
CCDBNodeLeaf *Money; NLMISC::CCDBNodeLeaf *Money;
CItemImage PAInv[MAX_INVENTORY_ANIMAL][MAX_ANIMALINV_ENTRIES]; CItemImage PAInv[MAX_INVENTORY_ANIMAL][MAX_ANIMALINV_ENTRIES];
// SERVER INVENTORY // SERVER INVENTORY
CItemImage ServerBag[MAX_BAGINV_ENTRIES]; CItemImage ServerBag[MAX_BAGINV_ENTRIES];
CItemImage ServerTempInv[MAX_TEMPINV_ENTRIES]; CItemImage ServerTempInv[MAX_TEMPINV_ENTRIES];
sint32 ServerHands[MAX_HANDINV_ENTRIES]; sint32 ServerHands[MAX_HANDINV_ENTRIES];
sint32 ServerEquip[MAX_EQUIPINV_ENTRIES]; sint32 ServerEquip[MAX_EQUIPINV_ENTRIES];
CCDBNodeLeaf *ServerMoney; NLMISC::CCDBNodeLeaf *ServerMoney;
CItemImage ServerPAInv[MAX_INVENTORY_ANIMAL][MAX_ANIMALINV_ENTRIES]; CItemImage ServerPAInv[MAX_INVENTORY_ANIMAL][MAX_ANIMALINV_ENTRIES];
// Drag'n'Drop // Drag'n'Drop
TFrom DNDFrom; TFrom DNDFrom;
@ -343,24 +345,24 @@ private:
// ItemExtraInfo management. // ItemExtraInfo management.
void onTradeChangeSession(); void onTradeChangeSession();
void onReceiveItemSheet(ICDBNode* node); void onReceiveItemSheet(NLMISC::ICDBNode* node);
void onReceiveItemInfoSlotVersion(ICDBNode* node); void onReceiveItemInfoSlotVersion(NLMISC::ICDBNode* node);
void updateItemInfoQueue(); void updateItemInfoQueue();
void updateItemInfoWaiters(uint slotId); void updateItemInfoWaiters(uint slotId);
class CItemInfoSlotVersionObs : public ICDBNode::IPropertyObserver class CItemInfoSlotVersionObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
class CItemSheetObs : public ICDBNode::IPropertyObserver class CItemSheetObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
class CItemInfoTradeObs : public ICDBNode::IPropertyObserver class CItemInfoTradeObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
CItemInfoTradeObs _DBTradeInfoObs; CItemInfoTradeObs _DBTradeInfoObs;
CItemInfoSlotVersionObs _DBInfoSlotVersionObs; CItemInfoSlotVersionObs _DBInfoSlotVersionObs;
@ -370,19 +372,19 @@ private:
friend class CItemSheetObs; friend class CItemSheetObs;
// Equipment observer // Equipment observer
class CDBEquipObs : public ICDBNode::IPropertyObserver class CDBEquipObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
CDBEquipObs _DBEquipObs; CDBEquipObs _DBEquipObs;
friend class CDBEquipObs; friend class CDBEquipObs;
// Bag observer for auto equipment (put only on the sheet leaf) // Bag observer for auto equipment (put only on the sheet leaf)
class CDBBagObs : public ICDBNode::IPropertyObserver class CDBBagObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
CDBBagObs _DBBagObs; CDBBagObs _DBBagObs;
}; };
@ -441,24 +443,24 @@ private:
CTempInvManager(); CTempInvManager();
// Database management stuff // Database management stuff
class CDBObs : public ICDBNode::IPropertyObserver class CDBObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
class CDBObsType : public ICDBNode::IPropertyObserver class CDBObsType : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
// Database management stuff, specialized for forage progress // Database management stuff, specialized for forage progress
class CDBForageQQObs : public ICDBNode::IPropertyObserver class CDBForageQQObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
CDBForageQQObs() : ICDBNode::IPropertyObserver(), WhichOne(~0), FullValue(0.0f) {} CDBForageQQObs() : NLMISC::ICDBNode::IPropertyObserver(), WhichOne(~0), FullValue(0.0f) {}
virtual void update(ICDBNode *node); virtual void update(NLMISC::ICDBNode *node);
uint WhichOne; uint WhichOne;
float FullValue; float FullValue;
}; };
@ -504,12 +506,12 @@ struct SBagOptions
{ {
CInventoryManager::TInvType InvType; CInventoryManager::TInvType InvType;
CCDBNodeLeaf *DbFilterArmor; NLMISC::CCDBNodeLeaf *DbFilterArmor;
CCDBNodeLeaf *DbFilterWeapon; NLMISC::CCDBNodeLeaf *DbFilterWeapon;
CCDBNodeLeaf *DbFilterTool; NLMISC::CCDBNodeLeaf *DbFilterTool;
CCDBNodeLeaf *DbFilterMP; NLMISC::CCDBNodeLeaf *DbFilterMP;
CCDBNodeLeaf *DbFilterMissMP; NLMISC::CCDBNodeLeaf *DbFilterMissMP;
CCDBNodeLeaf *DbFilterTP; NLMISC::CCDBNodeLeaf *DbFilterTP;
bool LastDbFilterArmor; bool LastDbFilterArmor;
bool LastDbFilterWeapon; bool LastDbFilterWeapon;

View file

@ -76,7 +76,7 @@
* \author Nevrax France * \author Nevrax France
* \date August 2003 * \date August 2003
*/ */
class CHugeListObs : public ICDBNode::IPropertyObserver class CHugeListObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
@ -119,39 +119,39 @@ private:
class CItemDBLeaves class CItemDBLeaves
{ {
public: public:
CCDBNodeLeaf *GuildIcon; // valid only for ascensor NLMISC::CCDBNodeLeaf *GuildIcon; // valid only for ascensor
CCDBNodeLeaf *GuildName; // valid only for ascensor NLMISC::CCDBNodeLeaf *GuildName; // valid only for ascensor
// //
CCDBNodeLeaf *SlotType; NLMISC::CCDBNodeLeaf *SlotType;
CCDBNodeLeaf *Quality; NLMISC::CCDBNodeLeaf *Quality;
CCDBNodeLeaf *SheetIDOrSkill; NLMISC::CCDBNodeLeaf *SheetIDOrSkill;
// //
CCDBNodeLeaf *LogicTextID; // valid if the item is to be obtained for a mission NLMISC::CCDBNodeLeaf *LogicTextID; // valid if the item is to be obtained for a mission
CCDBNodeLeaf *DescTextID; // valid if the item is to be obtained for a mission NLMISC::CCDBNodeLeaf *DescTextID; // valid if the item is to be obtained for a mission
// //
CCDBNodeLeaf *Price; // valid if the item is to be obtained with money NLMISC::CCDBNodeLeaf *Price; // valid if the item is to be obtained with money
// //
CCDBNodeLeaf *MissionText; NLMISC::CCDBNodeLeaf *MissionText;
CCDBNodeLeaf *MissionDetailText; NLMISC::CCDBNodeLeaf *MissionDetailText;
CCDBNodeLeaf *MissionIcon; NLMISC::CCDBNodeLeaf *MissionIcon;
CCDBNodeLeaf *MissionPreReqState; NLMISC::CCDBNodeLeaf *MissionPreReqState;
// items only // items only
CCDBNodeLeaf *Weight; NLMISC::CCDBNodeLeaf *Weight;
CCDBNodeLeaf *NameId; NLMISC::CCDBNodeLeaf *NameId;
CCDBNodeLeaf *InfoVersion; NLMISC::CCDBNodeLeaf *InfoVersion;
CCDBNodeLeaf *UserColor; NLMISC::CCDBNodeLeaf *UserColor;
CCDBNodeLeaf *Enchant; NLMISC::CCDBNodeLeaf *Enchant;
CCDBNodeLeaf *RMClassType; NLMISC::CCDBNodeLeaf *RMClassType;
CCDBNodeLeaf *RMFaberStatType; NLMISC::CCDBNodeLeaf *RMFaberStatType;
CCDBNodeLeaf *PrerequisitValid; NLMISC::CCDBNodeLeaf *PrerequisitValid;
// items Resale only // items Resale only
CCDBNodeLeaf *Quantity; NLMISC::CCDBNodeLeaf *Quantity;
CCDBNodeLeaf *PriceRetire; NLMISC::CCDBNodeLeaf *PriceRetire;
CCDBNodeLeaf *ResaleTimeLeft; NLMISC::CCDBNodeLeaf *ResaleTimeLeft;
CCDBNodeLeaf *VendorNameId; NLMISC::CCDBNodeLeaf *VendorNameId;
CCDBNodeLeaf *FactionType; NLMISC::CCDBNodeLeaf *FactionType;
CCDBNodeLeaf *FactionPointPrice; NLMISC::CCDBNodeLeaf *FactionPointPrice;
CCDBNodeLeaf *SellerType; NLMISC::CCDBNodeLeaf *SellerType;
public: public:
CItemDBLeaves() : GuildIcon(NULL), CItemDBLeaves() : GuildIcon(NULL),
GuildName(NULL), GuildName(NULL),
@ -182,7 +182,7 @@ private:
{} {}
}; };
// //
virtual void update(ICDBNode *node); virtual void update(NLMISC::ICDBNode *node);
void updateUIItemPage(uint index); void updateUIItemPage(uint index);
@ -199,9 +199,9 @@ private:
bool _Init; bool _Init;
CItemDBLeaves _Items[TRADE_PAGE_NUM_ITEMS]; CItemDBLeaves _Items[TRADE_PAGE_NUM_ITEMS];
sint16 _CurrentSessionNb; sint16 _CurrentSessionNb;
CCDBNodeLeaf *_Session; NLMISC::CCDBNodeLeaf *_Session;
CCDBNodeLeaf *_PageID; NLMISC::CCDBNodeLeaf *_PageID;
CCDBNodeLeaf *_HasNext; NLMISC::CCDBNodeLeaf *_HasNext;
bool _DownloadComplete; bool _DownloadComplete;
@ -272,8 +272,8 @@ private:
uint32 _PhraseClientFillFlags; uint32 _PhraseClientFillFlags;
uint32 _PhraseClientFillRace; uint32 _PhraseClientFillRace;
uint32 _PhraseClientFillNumPhrase; uint32 _PhraseClientFillNumPhrase;
CCDBNodeLeaf *_RoleMasterFlagDB; NLMISC::CCDBNodeLeaf *_RoleMasterFlagDB;
CCDBNodeLeaf *_RoleMasterRaceDB; NLMISC::CCDBNodeLeaf *_RoleMasterRaceDB;
}; };
#endif #endif

View file

@ -23,7 +23,7 @@
#include "../client_sheets/sbrick_sheet.h" #include "../client_sheets/sbrick_sheet.h"
#include "game_share/sabrina_com.h" #include "game_share/sabrina_com.h"
#include "game_share/skills.h" #include "game_share/skills.h"
#include "../cdb.h" #include "nel/misc/cdb.h"
#include "brick_learned_callback.h" #include "brick_learned_callback.h"
@ -83,7 +83,7 @@ public:
/** /**
* \return the DB pointing on the BitField for this family. * \return the DB pointing on the BitField for this family.
*/ */
class CCDBNodeLeaf* getKnownBrickBitFieldDB(uint family) const; class NLMISC::CCDBNodeLeaf* getKnownBrickBitFieldDB(uint family) const;
/** /**
* \return true if the brick is learn by the player. * \return true if the brick is learn by the player.
@ -159,7 +159,7 @@ protected:
std::vector <std::vector<NLMISC::CSheetId> > _SheetsByFamilies; std::vector <std::vector<NLMISC::CSheetId> > _SheetsByFamilies;
///vector of bit fields describing the known bricks of each family ///vector of bit fields describing the known bricks of each family
std::vector<CCDBNodeLeaf*> _FamiliesBits; std::vector<NLMISC::CCDBNodeLeaf*> _FamiliesBits;
/// list of roots only /// list of roots only
std::vector <NLMISC::CSheetId> _Roots; std::vector <NLMISC::CSheetId> _Roots;
@ -195,11 +195,11 @@ protected:
NLMISC::CSheetId _InterfaceRemoveBrick; NLMISC::CSheetId _InterfaceRemoveBrick;
// Observer when a brick is learned // Observer when a brick is learned
struct CBrickFamilyObs : public ICDBNode::IPropertyObserver struct CBrickFamilyObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
CSBrickManager *Owner; CSBrickManager *Owner;
virtual void update (ICDBNode *node); virtual void update (NLMISC::ICDBNode *node);
}; };
friend struct CBrickFamilyObs; friend struct CBrickFamilyObs;
CBrickFamilyObs _BrickFamilyObs; CBrickFamilyObs _BrickFamilyObs;

View file

@ -24,7 +24,7 @@
#include "game_share/character_title.h" #include "game_share/character_title.h"
#include "game_share/fame.h" #include "game_share/fame.h"
#include "../sheet_manager.h" #include "../sheet_manager.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "action_handler.h" #include "action_handler.h"
#include "sbrick_manager.h" #include "sbrick_manager.h"
#include "dbgroup_combo_box.h" #include "dbgroup_combo_box.h"

View file

@ -23,7 +23,7 @@
#include "game_share/skills.h" #include "game_share/skills.h"
//#include "game_share/jobs.h" //#include "game_share/jobs.h"
#include "game_share/roles.h" #include "game_share/roles.h"
#include "../cdb.h" #include "nel/misc/cdb.h"
#include "brick_learned_callback.h" #include "brick_learned_callback.h"
#include "skill_change_callback.h" #include "skill_change_callback.h"
@ -189,16 +189,16 @@ private:
uint32 _MinSkillValue[SKILLS::NUM_SKILLS]; uint32 _MinSkillValue[SKILLS::NUM_SKILLS];
/// Nodes on skill values and base values /// Nodes on skill values and base values
CCDBNodeLeaf *_SkillValues[SKILLS::NUM_SKILLS]; NLMISC::CCDBNodeLeaf *_SkillValues[SKILLS::NUM_SKILLS];
CCDBNodeLeaf *_SkillBaseValues[SKILLS::NUM_SKILLS]; NLMISC::CCDBNodeLeaf *_SkillBaseValues[SKILLS::NUM_SKILLS];
// Max child baseskill value (used when checking requirements) // Max child baseskill value (used when checking requirements)
uint32 _MaxChildBaseSkillValue[SKILLS::NUM_SKILLS]; uint32 _MaxChildBaseSkillValue[SKILLS::NUM_SKILLS];
// CallBack set for skill changes // CallBack set for skill changes
struct CSkillChangeObs : public ICDBNode::IPropertyObserver struct CSkillChangeObs : public NLMISC::ICDBNode::IPropertyObserver
{ {
virtual void update (ICDBNode * /* node */) virtual void update (NLMISC::ICDBNode * /* node */)
{ {
CSkillManager *pSM= CSkillManager::getInstance(); CSkillManager *pSM= CSkillManager::getInstance();
pSM->onSkillChange(); pSM->onSkillChange();
@ -214,7 +214,7 @@ private:
sint32 _CacheSkillBaseValues[SKILLS::NUM_SKILLS]; sint32 _CacheSkillBaseValues[SKILLS::NUM_SKILLS];
// A node incremented at each change of skill (the number is not relevant) // A node incremented at each change of skill (the number is not relevant)
CCDBNodeLeaf *_TrackSkillChange; NLMISC::CCDBNodeLeaf *_TrackSkillChange;
// "Title of the player" Management // "Title of the player" Management
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------

View file

@ -54,7 +54,9 @@ const std::string PHRASE_DB_COUNTER_CYCLE="SERVER:EXECUTE_PHRASE:CYCLE_COUNTER"
// TODO_OPTIM: too big test for the list_sheet* each frame with 512 entries!!! // TODO_OPTIM: too big test for the list_sheet* each frame with 512 entries!!!
class CSuccessTableSheet; class CSuccessTableSheet;
namespace NLMISC{
class CCDBNodeLeaf; class CCDBNodeLeaf;
}
/** Special helper class for lua export : enclose a phrase into an object accessible to lua /** Special helper class for lua export : enclose a phrase into an object accessible to lua
@ -457,11 +459,11 @@ private:
CTickRange _BrickRegenRange[64]; CTickRange _BrickRegenRange[64];
// Shortcut To Phrases Leaves // Shortcut To Phrases Leaves
std::vector<CCDBNodeLeaf*> _BookDbLeaves; std::vector<NLMISC::CCDBNodeLeaf*> _BookDbLeaves;
std::vector<CCDBNodeLeaf*> _MemoryDbLeaves; std::vector<NLMISC::CCDBNodeLeaf*> _MemoryDbLeaves;
std::vector<CCDBNodeLeaf*> _MemoryAltDbLeaves; std::vector<NLMISC::CCDBNodeLeaf*> _MemoryAltDbLeaves;
CCDBNodeLeaf *_NextExecuteLeaf; NLMISC::CCDBNodeLeaf *_NextExecuteLeaf;
CCDBNodeLeaf *_NextExecuteIsCyclicLeaf; NLMISC::CCDBNodeLeaf *_NextExecuteIsCyclicLeaf;
// extra client data // extra client data
struct CPhraseClient struct CPhraseClient
@ -582,8 +584,8 @@ private:
void updateMemoryCtrlState(uint memorySlot); void updateMemoryCtrlState(uint memorySlot);
// Shortcut To PhraseSheets Leaves in BotChat // Shortcut To PhraseSheets Leaves in BotChat
std::vector<CCDBNodeLeaf*> _BotChatPhraseSheetLeaves; std::vector<NLMISC::CCDBNodeLeaf*> _BotChatPhraseSheetLeaves;
std::vector<CCDBNodeLeaf*> _BotChatPhrasePriceLeaves; std::vector<NLMISC::CCDBNodeLeaf*> _BotChatPhrasePriceLeaves;
// For phrase compatibility with enchant weapon special power // For phrase compatibility with enchant weapon special power
NLMISC::CSheetId _EnchantWeaponMainBrick; NLMISC::CSheetId _EnchantWeaponMainBrick;
@ -597,9 +599,9 @@ private:
NumProgressType NumProgressType
}; };
std::vector<CCDBNodeLeaf*> _ProgressionDbSheets[NumProgressType]; std::vector<NLMISC::CCDBNodeLeaf*> _ProgressionDbSheets[NumProgressType];
std::vector<CCDBNodeLeaf*> _ProgressionDbLevels[NumProgressType]; std::vector<NLMISC::CCDBNodeLeaf*> _ProgressionDbLevels[NumProgressType];
std::vector<CCDBNodeLeaf*> _ProgressionDbLocks[NumProgressType]; std::vector<NLMISC::CCDBNodeLeaf*> _ProgressionDbLocks[NumProgressType];
// For each skill, which phrase are learned when the skill is gained // For each skill, which phrase are learned when the skill is gained
class CPhraseProgressInfo class CPhraseProgressInfo
@ -704,7 +706,7 @@ private:
CTickRange getRegenTickRange(const CSPhraseCom &phrase) const; CTickRange getRegenTickRange(const CSPhraseCom &phrase) const;
CCDBNodeLeaf *getRegenTickRangeDbLeaf(uint powerIndex) const; NLMISC::CCDBNodeLeaf *getRegenTickRangeDbLeaf(uint powerIndex) const;
// get regen tick range for a specific power, from the database // get regen tick range for a specific power, from the database
CTickRange getRegenTickRange(uint powerIndex) const; CTickRange getRegenTickRange(uint powerIndex) const;
public: public:

View file

@ -20,7 +20,7 @@
#ifndef NL_VIEW_BITMAP_COMBO_H #ifndef NL_VIEW_BITMAP_COMBO_H
#define NL_VIEW_BITMAP_COMBO_H #define NL_VIEW_BITMAP_COMBO_H
#include "../cdb.h" #include "nel/misc/cdb.h"
#include "view_base.h" #include "view_base.h"
#include "nel/3d/u_texture.h" #include "nel/3d/u_texture.h"
#include <string> #include <string>
@ -67,7 +67,7 @@
struct CComboBoxDesc struct CComboBoxDesc
{ {
bool parse(xmlNodePtr cur, CInterfaceElement *owner); bool parse(xmlNodePtr cur, CInterfaceElement *owner);
void addObserver(ICDBNode::IPropertyObserver *obs); void addObserver(NLMISC::ICDBNode::IPropertyObserver *obs);
void getGridSize(uint &numRow,uint &numCol) const; void getGridSize(uint &numRow,uint &numCol) const;
void getDimensions(uint &width, uint &height) const; void getDimensions(uint &width, uint &height) const;
CInterfaceProperty NumRow; CInterfaceProperty NumRow;
@ -94,7 +94,7 @@ struct CComboBoxDesc
* \author Nevrax France * \author Nevrax France
* \date 2002 * \date 2002
*/ */
class CViewBitmapCombo : public CViewBase, public ICDBNode::IPropertyObserver class CViewBitmapCombo : public CViewBase, public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
typedef std::vector<sint32> TIdArray; typedef std::vector<sint32> TIdArray;
@ -160,7 +160,7 @@ private:
void setupSize(); void setupSize();
void getDimensions(uint &numRow, uint &numCol); void getDimensions(uint &numRow, uint &numCol);
// From ICDBNode::IPropertyObserver // From ICDBNode::IPropertyObserver
void update(ICDBNode *leaf); void update(NLMISC::ICDBNode *leaf);
// Return a color from the array, or white if it is empty // Return a color from the array, or white if it is empty
static NLMISC::CRGBA getCol(const TColorArray &array, uint index); static NLMISC::CRGBA getCol(const TColorArray &array, uint index);
static const std::string *getTex(const TStringArray &array, uint index); static const std::string *getTex(const TStringArray &array, uint index);

View file

@ -28,6 +28,7 @@
using namespace std; using namespace std;
using namespace STRING_MANAGER; using namespace STRING_MANAGER;
using NLMISC::CCDBNodeLeaf;
NLMISC_REGISTER_OBJECT(CViewBase, CViewTextID, std::string, "text_id"); NLMISC_REGISTER_OBJECT(CViewBase, CViewTextID, std::string, "text_id");

View file

@ -22,8 +22,9 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "view_text.h" #include "view_text.h"
namespace NLMISC{
class CCDBNodeLeaf; class CCDBNodeLeaf;
}
// *************************************************************************** // ***************************************************************************
class IOnReceiveTextId class IOnReceiveTextId
@ -91,7 +92,7 @@ public:
*/ */
bool setDBTextID(const std::string &dbPath); bool setDBTextID(const std::string &dbPath);
// set a text from a db leaf // set a text from a db leaf
void setDBLeaf(CCDBNodeLeaf *leaf); void setDBLeaf(NLMISC::CCDBNodeLeaf *leaf);
std::string getTextIdDbLink() const; std::string getTextIdDbLink() const;
void setTextIdDbLink(const std::string &link); void setTextIdDbLink(const std::string &link);

View file

@ -141,7 +141,9 @@ extern bool CharNameValid;
bool IsInRingSession = false; bool IsInRingSession = false;
TSessionId HighestMainlandSessionId; // highest in the position stack TSessionId HighestMainlandSessionId; // highest in the position stack
namespace NLMISC{
extern const char *CDBBankNames[INVALID_CDB_BANK+1]; extern const char *CDBBankNames[INVALID_CDB_BANK+1];
}
void cbImpulsionGatewayOpen(NLMISC::CBitMemStream &bms); void cbImpulsionGatewayOpen(NLMISC::CBitMemStream &bms);
void cbImpulsionGatewayMessage(NLMISC::CBitMemStream &bms); void cbImpulsionGatewayMessage(NLMISC::CBitMemStream &bms);
@ -220,7 +222,7 @@ void impulseDatabaseUpdateBank(NLMISC::CBitMemStream &impulse)
} }
catch (const Exception &e) catch (const Exception &e)
{ {
BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:UPDATE_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:UPDATE_BANK %s msg, skipped: %s", NLMISC::CDBBankNames[bank], e.what() ), return );
} }
} }
@ -240,7 +242,7 @@ void impulseDatabaseInitBank(NLMISC::CBitMemStream &impulse)
// read delta // read delta
IngameDbMngr.readDelta( serverTick, impulse, (TCDBBank)bank ); IngameDbMngr.readDelta( serverTick, impulse, (TCDBBank)bank );
nldebug( "CDB: DB_GROUP:INIT_BANK %s", CDBBankNames[bank] ); nldebug( "CDB: DB_GROUP:INIT_BANK %s", NLMISC::CDBBankNames[bank] );
// read guild inventory update // read guild inventory update
if ( bank == CDBGuild ) if ( bank == CDBGuild )
@ -250,7 +252,7 @@ void impulseDatabaseInitBank(NLMISC::CBitMemStream &impulse)
} }
catch (const Exception &e) catch (const Exception &e)
{ {
BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:INIT_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:INIT_BANK %s msg, skipped: %s", NLMISC::CDBBankNames[bank], e.what() ), return );
} }
} }
@ -270,11 +272,11 @@ void impulseDatabaseResetBank(NLMISC::CBitMemStream &impulse)
// reset the bank // reset the bank
IngameDbMngr.getNodePtr()->resetBank( serverTick, (TCDBBank)bank ); IngameDbMngr.getNodePtr()->resetBank( serverTick, (TCDBBank)bank );
nldebug( "CDB: DB_GROUP:RESET_BANK %s", CDBBankNames[bank] ); nldebug( "CDB: DB_GROUP:RESET_BANK %s", NLMISC::CDBBankNames[bank] );
} }
catch (const Exception &e) catch (const Exception &e)
{ {
BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:RESET_BANK %s msg, skipped: %s", CDBBankNames[bank], e.what() ), return ); BOMB( NLMISC::toString( "Problem while decoding a DB_GROUP:RESET_BANK %s msg, skipped: %s", NLMISC::CDBBankNames[bank], e.what() ), return );
} }
} }

View file

@ -244,7 +244,7 @@ public:
//void clearChanges() { ALL_MANAGERS->clearChanges(); } //void clearChanges() { ALL_MANAGERS->clearChanges(); }
void setImpulseCallback(CNetworkConnection::TImpulseCallback callback, void *argument = NULL) { FIRST_MANAGER->setImpulseCallback( callback, argument ); } void setImpulseCallback(CNetworkConnection::TImpulseCallback callback, void *argument = NULL) { FIRST_MANAGER->setImpulseCallback( callback, argument ); }
void setDataBase(CCDBNodeBranch *database) { ALL_MANAGERS->setDataBase( database ); } void setDataBase(NLMISC::CCDBNodeBranch *database) { ALL_MANAGERS->setDataBase( database ); }
bool connect(std::string &result) { bool res = false; std::vector<CNetManager*>::iterator inm; for( inm=_NetManagers.begin(); inm!=_NetManagers.end(); ++inm ) if ( (*inm)->connect( result ) ) res = true; return res; } bool connect(std::string &result) { bool res = false; std::vector<CNetManager*>::iterator inm; for( inm=_NetManagers.begin(); inm!=_NetManagers.end(); ++inm ) if ( (*inm)->connect( result ) ) res = true; return res; }
CNetworkConnection::TConnectionState getConnectionState() const { return FIRST_MANAGER->getConnectionState(); } CNetworkConnection::TConnectionState getConnectionState() const { return FIRST_MANAGER->getConnectionState(); }

View file

@ -41,9 +41,9 @@
#include "game_share/simlag.h" #include "game_share/simlag.h"
#include "cdb.h" #include "nel/misc/cdb.h"
#include "cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "cdb_branch.h" #include "nel/misc/cdb_branch.h"
#include "cdb_synchronised.h" #include "cdb_synchronised.h"
#include "nel/misc/variable.h" #include "nel/misc/variable.h"

View file

@ -60,7 +60,9 @@ const uint PropertiesPerEntity = 16;
const uint EntitiesPerClient = 256; const uint EntitiesPerClient = 256;
*/ */
namespace NLMISC{
class CCDBNodeBranch; class CCDBNodeBranch;
}
namespace CLFECOMMON namespace CLFECOMMON
{ {
@ -364,7 +366,7 @@ public:
/** /**
* Set database entry point * Set database entry point
*/ */
void setDataBase(CCDBNodeBranch *database); void setDataBase(NLMISC::CCDBNodeBranch *database);
//@} //@}
@ -669,7 +671,7 @@ protected:
CPropertyDecoder _PropertyDecoder; CPropertyDecoder _PropertyDecoder;
/// The database entry /// The database entry
CCDBNodeBranch *_DataBase; NLMISC::CCDBNodeBranch *_DataBase;
/// @name Header message decoding /// @name Header message decoding

View file

@ -21,7 +21,7 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "game_share/entity_types.h" #include "game_share/entity_types.h"
#include "game_share/msg_client_server.h" #include "game_share/msg_client_server.h"
#include "cdb.h" #include "nel/misc/cdb.h"
#include "entity_cl.h" #include "entity_cl.h"
#include "interface_v3/view_radar.h" #include "interface_v3/view_radar.h"
#include <string> #include <string>
@ -51,6 +51,7 @@ namespace NPC_ICON
}; };
}; };
using NLMISC::ICDBNode;
/** /**
* Description of a mission giver NPC. * Description of a mission giver NPC.

View file

@ -27,7 +27,7 @@
#include "../misc.h" #include "../misc.h"
#include "../entities.h" #include "../entities.h"
#include "../pacs_client.h" #include "../pacs_client.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "../interface_v3/interface_manager.h" #include "../interface_v3/interface_manager.h"
#include "entity_sorter.h" #include "entity_sorter.h"
// //

View file

@ -887,7 +887,7 @@ private:
public: public:
static uint getMaxNumPlotItems(); static uint getMaxNumPlotItems();
static CCDBNodeLeaf *getPlotItemSheetDBLeaf(uint index); static NLMISC::CCDBNodeLeaf *getPlotItemSheetDBLeaf(uint index);
static bool getIsStartingScenario() { return _IsStartingScenario; } static bool getIsStartingScenario() { return _IsStartingScenario; }
bool isClearingContent() const { return _ClearingContent; } bool isClearingContent() const { return _ClearingContent; }
@ -897,7 +897,7 @@ private:
static void initDummyPlotItems(); static void initDummyPlotItems();
void resetPlotItems(); void resetPlotItems();
static void setReferencePlotItemSheet(uint index, uint32 sheetId); static void setReferencePlotItemSheet(uint index, uint32 sheetId);
static CCDBNodeLeaf *getRefPlotItemSheetDBLeaf(uint index); static NLMISC::CCDBNodeLeaf *getRefPlotItemSheetDBLeaf(uint index);
////////// //////////
// MISC // // MISC //

View file

@ -28,7 +28,7 @@
#include "../player_r2_cl.h" #include "../player_r2_cl.h"
#include "../sheet_manager.h" #include "../sheet_manager.h"
#include "../interface_v3/lua_ihm.h" #include "../interface_v3/lua_ihm.h"
#include "../cdb_leaf.h" #include "nel/misc/cdb_leaf.h"
#include "../interface_v3/interface_manager.h" #include "../interface_v3/interface_manager.h"
#include "dmc/palette.h" #include "dmc/palette.h"
#include "displayer_visual.h" #include "displayer_visual.h"

View file

@ -29,7 +29,7 @@
// 3D Interface. // 3D Interface.
#include "nel/3d/u_visual_collision_entity.h" #include "nel/3d/u_visual_collision_entity.h"
// Client DB // Client DB
#include "cdb.h" #include "nel/misc/cdb.h"
// Client // Client
#include "player_cl.h" #include "player_cl.h"
#include "client_cfg.h" #include "client_cfg.h"
@ -163,7 +163,7 @@ public:
CEntityCL* getMountEntity(); CEntityCL* getMountEntity();
/// Return the DB entry for the specified user's animal (NULL if not found) /// Return the DB entry for the specified user's animal (NULL if not found)
CCDBNodeBranch *getBeastDBEntry( CLFECOMMON::TClientDataSetIndex uid ); NLMISC::CCDBNodeBranch *getBeastDBEntry( CLFECOMMON::TClientDataSetIndex uid );
/** To Inform about an entity removed (to remove from selection for example). /** To Inform about an entity removed (to remove from selection for example).
* This will remove the entity from the target. * This will remove the entity from the target.
@ -486,7 +486,7 @@ public:
} }
protected: protected:
class CSpeedFactor : public ICDBNode::IPropertyObserver class CSpeedFactor : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
/// Initialize /// Initialize
@ -498,7 +498,7 @@ protected:
virtual void serial(class NLMISC::IStream &f) throw(NLMISC::EStream) {f.serial(_Value);} virtual void serial(class NLMISC::IStream &f) throw(NLMISC::EStream) {f.serial(_Value);}
protected: protected:
/// Method called when the ping message is back. /// Method called when the ping message is back.
virtual void update(ICDBNode* leaf); virtual void update(NLMISC::ICDBNode* leaf);
private: private:
float _Value; float _Value;
}; };
@ -515,7 +515,7 @@ protected:
virtual void serial(class NLMISC::IStream &/* f */) throw(NLMISC::EStream) {} virtual void serial(class NLMISC::IStream &/* f */) throw(NLMISC::EStream) {}
}; };
class CMountSpeeds : public ICDBNode::IPropertyObserver class CMountSpeeds : public NLMISC::ICDBNode::IPropertyObserver
{ {
public: public:
/// Initialize /// Initialize
@ -528,7 +528,7 @@ protected:
float getRunSpeed() const { return _RunSpeed; } float getRunSpeed() const { return _RunSpeed; }
protected: protected:
/// Method called when the value is changed /// Method called when the value is changed
virtual void update(ICDBNode* leaf); virtual void update(NLMISC::ICDBNode* leaf);
private: private:
float _WalkSpeed; float _WalkSpeed;
float _RunSpeed; float _RunSpeed;
@ -587,31 +587,31 @@ protected:
/// CSkill points observer /// CSkill points observer
class CSkillPointsObserver : public ICDBNode::IPropertyObserver class CSkillPointsObserver : public NLMISC::ICDBNode::IPropertyObserver
{ {
public : public :
uint SpType; uint SpType;
/// From ICDBNode::IPropertyObserver /// From ICDBNode::IPropertyObserver
virtual void update(ICDBNode* node ); virtual void update(NLMISC::ICDBNode* node );
}; };
CSkillPointsObserver _SkillPointObs[EGSPD::CSPType::EndSPType]; CSkillPointsObserver _SkillPointObs[EGSPD::CSPType::EndSPType];
class CInvisibleObserver : public ICDBNode::IPropertyObserver class CInvisibleObserver : public NLMISC::ICDBNode::IPropertyObserver
{ {
public : public :
virtual void update(ICDBNode* node); virtual void update(NLMISC::ICDBNode* node);
}; };
CInvisibleObserver _InvisibleObs; CInvisibleObserver _InvisibleObs;
/// Fame observer /// Fame observer
class CFameObserver : public ICDBNode::IPropertyObserver class CFameObserver : public NLMISC::ICDBNode::IPropertyObserver
{ {
public : public :
uint32 FactionIndex; uint32 FactionIndex;
/// From ICDBNode::IPropertyObserver /// From ICDBNode::IPropertyObserver
virtual void update(ICDBNode* node ); virtual void update(NLMISC::ICDBNode* node );
}; };
std::vector<CFameObserver *> _FamesObs; std::vector<CFameObserver *> _FamesObs;

View file

@ -25,7 +25,7 @@
#include "nel/misc/types_nl.h" #include "nel/misc/types_nl.h"
#include "streamable_ig.h" #include "streamable_ig.h"
#include "cdb.h" #include "nel/misc/cdb.h"
#include "client_sheets/continent_sheet.h" #include "client_sheets/continent_sheet.h"
#include "game_share/misc_const.h" #include "game_share/misc_const.h"
#include <vector> #include <vector>

View file

@ -17,7 +17,9 @@
#include "stdpch.h" #include "stdpch.h"
#include "ryzom_database_banks.h" #include "ryzom_database_banks.h"
namespace NLMISC{
const char *CDBBankNames[INVALID_CDB_BANK+1] = { "PLR", "GUILD", /* "CONTINENT", */ "OUTPOST", /* "GLOBAL", */ "<NB>", "INVALID" }; const char *CDBBankNames[INVALID_CDB_BANK+1] = { "PLR", "GUILD", /* "CONTINENT", */ "OUTPOST", /* "GLOBAL", */ "<NB>", "INVALID" };
}
// leave not static else this workaround don't work // leave not static else this workaround don't work