#ifndef _CAUTHORIZE_THREAD_H_ #define _CAUTHORIZE_THREAD_H_ #include //#include // Àü¹æ ÂüÁ¶. class CDBComponent; class CAuthInfo; class CAuthorizeThread; //#include "NetString.h" class CAuthorizeThread : public CThread // ,public CNetString::IEventListener { public: // Desc : ŸÀÔ¿¡ µû¶ó ¾Ë¸ÂÀº ÀÎÁõ ½º·¹µå »ý¼º (ÇѰÔÀÓ/´ë¸¸) static CAuthorizeThread* Create(); // Desc : ŸÀÔ¿¡ µû¶ó ¾Ë¸ÂÀº À̸§/ÆÐ½º¿öµå °Ë»ç (ÇѰÔÀÓ/´ë¸¸) static bool CheckUserIDAndPass(const char* szUserAccount_In, const char* szUserPW_In); virtual ~CAuthorizeThread(); bool Initialize(); // Desc : DBObjectµîÀ» »ý¼ºÇÑ´Ù. void Destroy(); // Desc : DBObjectµîÀ» ¼Ò¸ê½ÃŲ´Ù. // void EventPacket(int iIndex, char* pPacket); bool ConnectAll(); private: unsigned int Run(); virtual BOOL End(); protected: virtual void Authorize(CAuthInfo* lpAuthInfo) = 0; // Desc : ÀÎÁõ ¹æ¹ý. CAuthorizeThread(); // Desc : Create ÇÔ¼ö¸¦ »ç¿ëÇØ¼­¸¸ »ý¼ºÇÒ ¼ö ÀÖ°Ô ÇÔ. CDBComponent* m_lpComponent; CDBComponent* m_lpAdminToolComponent; BOOL m_bConnectAll; // NetStringÀ» »ý¼ºÇÑ´Ù. // CNetString* m_lpLogin; // CNetString* m_lpLogout; // std::map m_AuthMap; private: unsigned long m_AuthCount; public: unsigned long MakeSessionID(unsigned long SessionID) { unsigned long dwSessionID = (SessionID ^ ++m_AuthCount); return 0 == dwSessionID ? dwSessionID + rand() : dwSessionID; } }; #endif