#pragma once #include #ifdef __PCBANG_IP_UPDATE #include "PCRoomIpManager.h" #else #include #include #endif class AccountManager : public util::Singleton { public: //_PCBANG_POLICY_CHANGE_POST_EXPIRED2 #ifdef __NA_20100201_INTERGRATEDBILLING_ static const DWORD PC_ROOM_RECHARGE_QUERY_INTERVAL = 180 * 1000; //ÅëÇÕ ºô¸®Àº 3ºÐ #else static const DWORD PC_ROOM_RECHARGE_QUERY_INTERVAL = 60 * 1000; //Á¤·® ¸¸·á ÈÄ 1ºÐ ÁÖ±â ÁúÀÇ #endif AccountManager(); ~AccountManager(); void Destroy(); void Initialize(); void Update(); static WORD CalcConnectTime(AccountInfo* info); AccountInfo* CreateAccountInfo(LPTSTR account, AccountInfo** overlapped); AccountInfo* Find(LPTSTR account); AccountInfo* FindWithLoginFrontUserID(DWORD frontId); AccountInfo* FindWithAuthKey(DWORD authKey); AccountInfo* FindWithUserGuid(DWORD guid); BOOL ClearInfo(LPTSTR account); BOOL ClearInfo(DWORD frontId); void ClearLocation(AGENTID locationId); void GenerateAuthKey(AccountInfo* info); void GenerateSerialKey(AccountInfo* info); //#ifdef _NEW_BILLING_SYSTEM // template // void ForEachAccount(Operator & Opr); //#else #ifdef _BILLING_CODE_REFACTORING_ void MakeBillingList(STLX_VECTOR* stream_list); #else void MakeBillingList(std::vector < AccountInfo* >* buffer); #endif //#endif void DisplayInfo(); void DisplayDetailInfo(); #ifdef __PCBANG_IP_UPDATE PCRoomIPManager* const GetPCRoomManager() {return &pc_room_manager_;}; #endif private: DWORD GetHashCode(LPTSTR str); typedef STLX_MAP MapAccount; typedef util::CMemoryPoolFactory ACCOUNT_POOL; ACCOUNT_POOL m_AccountPool; MapAccount m_mapAccount; DWORD m_authKey; DWORD m_authKeyOffset; #ifdef __PCBANG_IP_UPDATE PCRoomIPManager pc_room_manager_; #endif util::Timer m_UpdateTimer; }; //#ifdef _NEW_BILLING_SYSTEM //template //void AccountManager::ForEachAccount(Operator& Opr) //{ // MapAccount::iterator it = m_mapAccount.begin(), // end = m_mapAccount.end(); // for( ; it != end; ++it) // { // AccountInfo* pAccountInfo = it->second; // Opr(pAccountInfo); // } //} //#endif