#ifndef _RYL_DBAGENT_CASTLE_DB_MANAGER_H_ #define _RYL_DBAGENT_CASTLE_DB_MANAGER_H_ #pragma once #include #include #include #include #include // Àü¹æ ÂüÁ¶ class CDBComponent; class CSendStream; class CSiegeObjectDB; class CSiegeObjectDBMgr; namespace Castle { // Àü¹æ ÂüÁ¶ class CCastleDB; class CCastleDBMgr { public: static CCastleDBMgr& GetInstance(); // typedef std::map, boost::fast_pool_allocator > > CastleMap; bool Initialize(CDBComponent& DBComponent); void Destroy(); void CheckEnableSiegeForAllCastle(bool bIsSiegeTime); void UpdateSiegeCount(); void DestroyAllCastleArms(); void CloseCastleGate(); void OpenCastleGate(); CCastleDB* GetCastle(unsigned long dwCastleID); void GetCastleSiegeInfo(CastleSiegeInfo* lpCastleSiegeInfo, unsigned char& cNum, unsigned short& wSize); // GameServer ·ÎÀÇ Send ÇÔ¼ö void SendCastleInfo(CSendStream& SendStream, unsigned char cZone, unsigned char cChannel); private: CCastleDBMgr(); ~CCastleDBMgr(); bool ReadCastleInfoDB(); bool ReadCastleTaxInfoDB(); bool ReadCastleMineralInfoDB(); CCastleDB* CreateCastle(const CastleInfoDB& CastleInfo); // DB ¿¡¼­ Àоî¿Í¼­ »ý¼º bool SerializeOut(CCastleDB* lpCastle_In, char* lpBuffer_Out, unsigned short& wBufferSize_Out, unsigned char& cDefensiveArmsNum_Out); CCastleDB* CreateCastleDB(const CastleInfoDB& CastleInfo); void DeleteCastleDB(CCastleDB* lpCastleDB); CDBComponent* m_lpDBComponent; boost::pool<> m_CastlePool; CastleMap m_CastleMap; }; }; #endif // _CASTLE_MANAGER_H_