#pragma once #include #include class User; class FieldInfo; class Channnel; typedef STLX_HASH_MAP USER_MAP; typedef USER_MAP::iterator USER_MAP_ITER; typedef std::pair USER_MAP_PAIR; // ±âº»ÀûÀÎ Zone Á¤ÀÇ class BaseZone { public: BaseZone(void); virtual ~BaseZone(void); VOID Init(); virtual VOID Release(); virtual BOOL AddUser( DWORD dwGuid, User *pUser, DWORD dwRoomKey=0 )=0; virtual BOOL RemoveUser( DWORD dwGuid )=0; virtual BOOL Send( BYTE *pMsg, WORD wSize )=0; VOID AddLinkedZone( BaseZone *pZone ); virtual inline VOID SendToAll( BYTE *pMsg, WORD wSize ) { Send( pMsg, wSize ); SendLinkedZone( pMsg, wSize ); } inline VOID SetZoneType( eZONETYPE type ) { m_zoneType = type; } inline eZONETYPE GetZoneType() { return m_zoneType; } inline VOID SetChaosZoneType(ChaosZoneType type) { chaoszone_type_ = type; } inline ChaosZoneType GetChaosZoneType() { return chaoszone_type_; } inline VOID SetKey( DWORD key ) { m_dwKey = key; } inline DWORD GetKey() { return m_dwKey; } inline DWORD GetNumberOfUsers() { return (DWORD)m_mapUsers.size(); } virtual VOID SendToMe( BYTE *pMsg, WORD wSize )=0; inline VOID SetMapCode( MAPCODE mapCode ) { m_MapCode = mapCode; } inline MAPCODE GetMapCode() { return m_MapCode; } //add by __NA001094_080928_TASK_SURVIVAL_SOLOING_QUEST_ETC__ runtime community block/release void SetBlockZone(BOOL value) { m_bBlockZone = value; } BOOL IsBlockZone() { return m_bBlockZone; } #ifdef _NA_004694_20120412_1202_PARTY_ROOM_KEY inline VOID SetRoomKey(const DWORD key) { room_key_ = key; } inline const DWORD GetRoomKey() { return room_key_;} #endif // NA_004694_20120412_1202_PARTY_ROOM_KEY protected: virtual VOID SendLinkedZone( BYTE *pMsg, WORD wSize )=0; public: USER_MAP m_mapUsers; eZONETYPE m_zoneType; ChaosZoneType chaoszone_type_; util::CLinkedlist m_LinkedZone; DWORD m_dwKey; MAPCODE m_MapCode; BOOL m_bBlockZone; #ifdef _NA_004694_20120412_1202_PARTY_ROOM_KEY DWORD room_key_; #endif // NA_004694_20120412_1202_PARTY_ROOM_KEY }; // ÀϹÝÀûÀΠäÆÃ ä³Î 󸮿ë class ChatZone : public BaseZone { public: ChatZone(); virtual ~ChatZone(); virtual BOOL AddUser( DWORD dwGuid, User *pUser, DWORD dwRoomKey=0 ); virtual BOOL RemoveUser( DWORD dwGuid ); virtual BOOL Send( BYTE *pMsg, WORD wSize ); virtual VOID SendToMe( BYTE *pMsg, WORD wSize ) { Send( pMsg, wSize ); } util::CLinkedlist &GetLinkedZoneList() { return m_LinkedZone; } protected: virtual VOID SendLinkedZone( BYTE *pMsg, WORD wSize ); }; // ½Ã¾ß ¹üÀ§ 󸮿ë class ViewPortZone : public BaseZone { public: ViewPortZone(); virtual ~ViewPortZone(); BOOL AddUser( DWORD dwGuid, User *pUser, DWORD dwRoomKey=0 ); BOOL RemoveUser( DWORD dwGuid ); BOOL Send( BYTE *pMsg, WORD wSize ); VOID SendToMe( BYTE *pMsg, WORD wSize ); VOID SetParentVillage( BaseZone* pZone ) { m_pParentVillage = pZone; } VOID SendToAll( BYTE *pMsg, WORD wSize ); protected: VOID SendLinkedZone( BYTE *pMsg, WORD wSize ) { __UNUSED((pMsg, wSize)); } BaseZone* m_pParentVillage; // ÀÚ½ÅÀÌ ¼ÓÇÑ ¸¶À»ÀÇ ChatZone ÀνºÅϽº Æ÷ÀÎÅÍ }; typedef STLX_HASH_MAP VIEWPORT_MAP; typedef VIEWPORT_MAP::iterator VIEWPORT_MAP_ITER; typedef std::pair VIEWPORT_MAP_PAIR; typedef STLX_HASH_MAP BATTLE_MAP; typedef BATTLE_MAP::iterator BATTLE_MAP_ITER; typedef std::pair BATTLE_MAP_PAIR; // ¸¶À» ä³Î 󸮿ë class VillageZone : public ChatZone { public: VillageZone(); virtual ~VillageZone(); VOID Init( MAPCODE MapCode, FieldInfo *pFieldInfo ); VOID Release(); BOOL AddUser( DWORD dwGuid, User *pUser, DWORD dwRoomKey=0 ); BOOL RemoveUser( DWORD dwGuid ); BOOL Send( BYTE *pMsg, WORD wSize ); VOID SendToMe( BYTE *pMsg, WORD wSize ); // inline MAPCODE GetMapCode() { return m_MapCode; } DWORD GetFieldCode(); VOID AddBattleLinkedZone( ChatZone *pZone ); VOID RemoveBattleLinkedZone( ChatZone *pZone ); protected: VOID SendLinkedZone( BYTE *pMsg, WORD wSize ); // MAPCODE m_MapCode; FieldInfo *m_pFieldInfo; VIEWPORT_MAP m_mapZone; BATTLE_MAP m_mapBattle; }; // ÆÄƼ/±æµå/ä³Î äÆÃ 󸮿ë class CommChatZone : public ChatZone { public: CommChatZone(); virtual ~CommChatZone(); VOID Release(); BOOL AddUser( DWORD dwGuid, User *pUser, DWORD dwRoomKey=0 ); BOOL RemoveUser( DWORD dwGuid ); BYTE GetPartyVoiceChatInfo( BYTE *pStatus, User *pTarget ); inline TCHAR* GetChatRoomName() { return m_ptszChatRoomName; } VOID SetChatRoomName( TCHAR* ptszName ); BOOL GetFirstUserName( TCHAR* ptszName ); BOOL GetNextUserName( TCHAR* ptszName ); private: TCHAR m_ptszChatRoomName[MAX_ROOMTITLE_LENGTH+1]; // äÆÃ¹æ À̸§ USER_MAP_ITER m_iterUserName; };