--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-26 20:43:35 -06:00
24 changed files with 415 additions and 204 deletions
+18 -7
View File
@@ -31,18 +31,26 @@
class GridInfo
{
public:
GridInfo() : i_timer(0) {}
GridInfo(time_t expiry, bool unload = true ) : i_timer(expiry), i_unloadflag(unload) {}
GridInfo()
: i_timer(0), i_unloadActiveLockCount(0), i_unloadExplicitLock(false), i_unloadReferenceLock(false) {}
GridInfo(time_t expiry, bool unload = true )
: i_timer(expiry), i_unloadActiveLockCount(0), i_unloadExplicitLock(!unload), i_unloadReferenceLock(false) {}
const TimeTracker& getTimeTracker() const { return i_timer; }
bool getUnloadFlag() const { return i_unloadflag; }
void setUnloadFlag( bool pFlag) { i_unloadflag = pFlag; }
bool getUnloadLock() const { return i_unloadActiveLockCount || i_unloadExplicitLock || i_unloadReferenceLock; }
void setUnloadExplicitLock( bool on ) { i_unloadExplicitLock = on; }
void setUnloadReferenceLock( bool on ) { i_unloadReferenceLock = on; }
void incUnloadActiveLock() { ++i_unloadActiveLockCount; }
void decUnloadActiveLock() { if(i_unloadActiveLockCount) --i_unloadActiveLockCount; }
void setTimer(const TimeTracker& pTimer) { i_timer = pTimer; }
void ResetTimeTracker(time_t interval) { i_timer.Reset(interval); }
void UpdateTimeTracker(time_t diff) { i_timer.Update(diff); }
private:
TimeTracker i_timer;
bool i_unloadflag;
uint16 i_unloadActiveLockCount : 16; // lock from active object spawn points (prevent clone loading)
bool i_unloadExplicitLock : 1; // explicit manual lock or config setting
bool i_unloadReferenceLock : 1; // lock from instance map copy
};
typedef enum
@@ -92,8 +100,11 @@ class TRINITY_DLL_DECL NGrid
GridInfo* getGridInfoRef() { return &i_GridInfo; }
const TimeTracker& getTimeTracker() const { return i_GridInfo.getTimeTracker(); }
bool getUnloadFlag() const { return i_GridInfo.getUnloadFlag(); }
void setUnloadFlag( bool pFlag) { i_GridInfo.setUnloadFlag(pFlag); }
bool getUnloadLock() const { return i_GridInfo.getUnloadLock(); }
void setUnloadExplicitLock( bool on ) { i_GridInfo.setUnloadExplicitLock(on); }
void setUnloadReferenceLock( bool on ) { i_GridInfo.setUnloadReferenceLock(on); }
void incUnloadActiveLock() { i_GridInfo.incUnloadActiveLock(); }
void decUnloadActiveLock() { i_GridInfo.decUnloadActiveLock(); }
void ResetTimeTracker(time_t interval) { i_GridInfo.ResetTimeTracker(interval); }
void UpdateTimeTracker(time_t diff) { i_GridInfo.UpdateTimeTracker(diff); }