使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 4905e2e7537d507f218e8e9595485e09d9f3a2b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
 
#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<CQLSession*, CQLSession*>    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<CQLSession*, CQLSession*> &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.