#if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // QLConnect.h : header file // #include "QLObj.h" #include "QLSession.h" #include "QLLoginInfo.h" #include "MsgMap.h" #include "QLClient.h" #include "QLNotify.h" #include "QLResponse.h" #include "WebClient.h" // Cmder List //#include "MsgCmder.h" enum OICONNECT_STATE { CONN_STATE_NONE = 0, CONN_STATE_OUTLINE = 1, CONN_STATE_ONLINE = 2, CONN_STATE_LOGINING = 3 }; enum OI_USER_STATUS { OI_USER_STATUS_NONE = 0, OI_USER_STATUS_FLN = 1, // ÀëÏß OI_USER_STATUS_NLN = 2, // ÔÚÏß OI_USER_STATUS_HDN = 3, // ÒþÉí OI_USER_STATUS_AWY = 4, // À뿪 OI_USER_STATUS_BSY = 5, // æ OI_USER_STATUS_BRB = 6, // ¿ª»áÖÐ OI_USER_STATUS_PHN = 7, // µç»°ÖÐ OI_USER_STATUS_LUN = 8, // ³öÍâÎç²Í OI_USER_STATUS_AAY = 9, // ¹«ÎñÍâ³ö OI_USER_STATUS_AWM = 10, OI_USER_STATUS_AWP = 11, OI_USER_STATUS_AWO = 12 }; ///////////////////////////////////////////////////////////////////////////// // CQLConnect window class AFX_EXT_CLASS CQLConnect : public CQLObj { // Construction public: CQLConnect(); virtual ~CQLConnect(); // Attributes public: CList m_listOISession; CMsgMapMgr m_mgrMsgMap_Online; // Msg Map of Online Session CQLLoginInfo *m_pLoginInfo; OICONNECT_STATE m_nConnState; // Á¬½Ó״̬ OI_USER_STATUS m_nUserStatus; // Óû§×´Ì¬ DWORD m_dwSessionID; // Ð嵀 Session ID DWORD m_dwServerFlag; // ·þÎñÆ÷±êʶ CQLClient m_client; CQLNotify m_notify; CWebClient m_webClient; // HTTP 1.1 Download, for Version Update CPtrList m_listCmder; // Operations public: CString GetVer(); CQLLoginInfo * GetLoginInfo(); CString GetSocketAddr(); UINT GetSocketPort(); BOOL GetSocketServer( CString &strServer, UINT &nPort ); BOOL CreateSession( CQLSession *&pSession ); BOOL AddSession( CQLSession *pSession ); POSITION FindSession( UINT nSessionID ); BOOL RemoveSession( CQLSession *pSession ); void CopySessionList( CList &listOISession ); void RemoveSessionCmder( CQLSession *pSession ); BOOL IsThisLogin( CQLLoginInfo *pLoginInfo ); BOOL IsThisSessionID( CString strSessionID ); BOOL SetLoginInfo( CQLLoginInfo *pLoginInfo ); // ÉèÖõǼÐÅÏ¢£¬ÓÃÓڷǵǼģʽ void SetTimeout( int nSecond = 20 ); BOOL SignIn( CQLLoginInfo *pLoginInfo ); // µÇ¼ BOOL SignOut(); BOOL OnSignIn( enum SIGN_IN_STATE nState, int nErrCode = 0 ); // µÇ¼¹ý³ÌÖеķ´À¡ BOOL Logined(); UINT SendCmder( CQLCommander *pCmder, BOOL bValidate = true ); BOOL SetCmderCancel( long nTrID ); CQLCommander * GetCommander( CQLClientSocket *pSocket ); BOOL RemoveCmder( CQLCommander *pCmder ); void DetachCmdList(); void CleanData(); void CleanInvalidSession(); BOOL CheckSession( CString strAppType, DWORD dwFlag ); // ֪ͨ´¦Àí void OnConnectionClosed(); BOOL OnChallenges( CQLResponse *pResponse ); void OnNtyUserStatusChanged( CQLResponse *pResponse ); void OnNtyKillOut( CQLResponse *pResponse ); void OnNtyNotify( CQLResponse *pResponse ); void OnNtyOtherSysMsg( CQLResponse *pResponse, CString strCmdType = _T( "" ) ); // ÃüÁî´¦Àí·´À¡ void OnCmderError( UINT nErrCode, CQLCommander *pCmder, CString strMethod ); void OnCmderResponse( CQLResponse *pResponse, CQLCommander *pCmder ); OI_USER_STATUS GetUserStatus( CString strStatus ); CString GetUserStatus( enum OI_USER_STATUS nUserStatus ); }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line.