#ifndef _SIEGE_OBJECT_MANAGER_H_ #define _SIEGE_OBJECT_MANAGER_H_ #pragma once #include #include #include #include // Àü¹æ ÂüÁ¶ class CSiegeObject; class CCamp; class CSiegeObjectMgr { public: ~CSiegeObjectMgr(); static CSiegeObjectMgr& GetInstance(); // ŸÀÔ Á¤ÀÇ typedef std::map SiegeObjectMap; // typedef std::map CampMap; // void Destroy(); void DestroyAllCamp(); // DBAgent Server Á¢¼Ó½Ã DB ¿¡¼­ ¾ò¾î¿Â Á¤º¸·Î °´Ã¼ »ý¼ºÇÔ¼ö CSiegeObject* CreateCastleObject(CastleObjectInfo& CastleObject); // Ŭ¶óÀ̾ðÆ®ÀÇ ¿äûÀ¸·Î DBAgentServer ¸¦ °ÅÃļ­ °´Ã¼¸¦ »ý¼ºÇÏ´Â ÇÔ¼ö CSiegeObject* CreateCamp(unsigned long dwCID, unsigned long dwCampID, unsigned long dwGID, unsigned long dwHP, unsigned char cState, unsigned char cUpgradeStep, const CampRight& campRight, Position Pos, unsigned char cMaterial, bool bFullHP); CSiegeObject* CreateWorldWeapon(unsigned long dwCID, unsigned long dwCampID, unsigned long dwGID, unsigned long dwHP, unsigned char cState, unsigned char cUpgradeStep, const CampRight& campRight, Position Pos, unsigned char cMaterial, bool bFullHP, unsigned short wObjectType); CSiegeObject* CreateSiegeArms(unsigned long dwCID, unsigned long dwOwnerID, unsigned char cNation, unsigned long dwHP, unsigned short wObjectType, unsigned char cState, unsigned char cUpgradeStep, Position Pos); CSiegeObject* ChangeCampType(unsigned long dwCampID, unsigned short wChangeType); CCamp* GetCamp(unsigned long dwCampID); CSiegeObject* GetSiegeObject(unsigned long dwObjectID); bool DeleteSiegeObject(unsigned long dwCID); bool DeleteSiegeObject(CSiegeObject* lpObject); bool DeleteCamp(unsigned long dwCampID); bool ExistBuildingOrDestroyingCamp(unsigned long dwGID); bool ExistCampInRadius(const Position& Pos); bool ExistCompleteCampInRadius(const Position& Pos, unsigned long dwGID); void HasCampByGID(unsigned long dwGID, bool& bHasDevelopingCamp, bool& bHasCompleteCamp); bool HasSiegeArms(unsigned long dwCID); // ÇØ´ç CID °¡ °ø¼º º´±â ¼ÒÀ¯ ¿©ºÎ. unsigned long GetSiegeObjectCount(void); // ------------------------------------------------------------------------------------------------------ // ¿ùµå ¿þÆù °ü·Ã ÇÔ¼ö void SetWorldWeaponInfo(unsigned char cKarRemainSiegeTime, unsigned char cMerRemainSiegeTime); void UpdateWorldWeaponInfo(unsigned char cNation, unsigned char cRemainSiegeTime); bool EnableCreateWorldWeapon(unsigned char cNation, unsigned short& wError) const; void DecreaseWeaponRemainSiegeTime(); CCamp* GetWorldWeapon() const { return m_lpWorldWeapon; } void RequestWorldWeaponCreation() { m_bRequestWorldWeaponCreation = true; } void ReleaseWorldWeaponCreation() { m_bRequestWorldWeaponCreation = false; } // ------------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------------ // Process ÇÔ¼ö void ProcessAllSiegeObject(); void ProcessCampRegenHPAndMP(); void ProcessMiningCamp(unsigned long dwProcessType); void ProcessCampShopUpdate(bool bForce); void ProcessWorldWeaponFire(); // ------------------------------------------------------------------------------------------------------ // DBAgentServer -> GameServer ¿ä»õ Á¤º¸ Àü¼Û bool SerializeIn(char* lpBuffer, unsigned short wSize, unsigned long dwCID); // Client ¿¡°Ô ±æµå ¿ä»õ Á¤º¸ Àü¼Û bool SendCampInfo(CSendStream& SendStream); // ÇØ´ç ¼ºÀÇ ¸ðµç ¿ÀºêÁ§Æ®ÀÇ ÁÖÀÎÀÌ ¹Ù²î¾ú´Ù´Â°ÍÀ» º´±âÀÇ ¹Ý°æ 5¼¿¿¡ Àִ ij¸¯ÅÍ¿¡°Ô ¾Ë·ÁÁØ´Ù. bool SendChangeMaster(unsigned long dwCastleID, unsigned char cNation); bool SendLoseOwnership(unsigned long dwCastleID); // ¸ðµç °ø¼º°ü·Ã ¿ÀºêÁ§Æ®µéÀ» ¹Ý°æ 5¼¿¿¡ Àִ ij¸¯Å͵鿡°Ô ¾Ë·ÁÁØ´Ù. // Vincent - ºê·Îµå ij½ºÆ® Å×½ºÆ® ÄÚµå void PrepareBroadCast(); void BroadCast(); private: CSiegeObjectMgr(); // DBAgent Server Á¢¼Ó½Ã DB ¿¡¼­ ¾ò¾î¿Â Á¤º¸·Î °´Ã¼ »ý¼ºÇÔ¼ö CSiegeObject* CreateCamp(char* lpBuffer, unsigned short wSize, unsigned long dwCID); CSiegeObject* CreateMiningCamp(char* lpBuffer, unsigned short wSize, unsigned long dwCID); CSiegeObject* CreateCampShop(char* lpBuffer, unsigned short wSize, unsigned long dwCID); CSiegeObject* CreateWorldWeapon(char* lpBuffer, unsigned short wSize, unsigned long dwCID, unsigned char cNation); SiegeObjectMap m_SiegeObjectMap; CampMap m_CampMap; // ------------------------------------------------------------------------------------------------------ // ¿ùµå ¿þÆù °ü·Ã CCamp* m_lpWorldWeapon; // ¿ùµå ¿þÆù (Çϳª »ÓÀ̹ǷΠµû·Î °ü¸®) unsigned char m_cKarRemainSiegeTime; // Ä«¸£Å×¶õÆ® ¿ùµå ¿þÆùÀÌ ºÎ¼­ÁøÈÄ Áö³ª¾ßÇÒ °ø¼º ½Ã°£ Ƚ¼ö unsigned char m_cMerRemainSiegeTime; // Ä«¸£Å×¶õÆ® ¿ùµå ¿þÆùÀÌ ºÎ¼­ÁøÈÄ Áö³ª¾ßÇÒ °ø¼º ½Ã°£ Ƚ¼ö bool m_bRequestWorldWeaponCreation; // ¿ùµå ¿þÆù »ý¼ºÀ» DBAgentServer ¿¡ ¿äûÇÑ »óÅÂÀΰ¡ // ------------------------------------------------------------------------------------------------------ }; #endif // _SIEGE_OBJECT_MANAGER_H_