add AIForm
This commit is contained in:
+58
-17
@@ -24,6 +24,7 @@
|
||||
#include "ResetFormUnit.h"
|
||||
#include "ChipsFormUnit.h"
|
||||
#include "ActCodeFormUnit.h"
|
||||
#include "AIFormUnit.h"
|
||||
|
||||
#define USER_VAR_FILE "rbmvrf"
|
||||
#define USER_VAR_VERSION 0x02
|
||||
@@ -321,6 +322,20 @@ void __fastcall TMainForm::FormCloseQuery(TObject *Sender, bool &CanClose)
|
||||
}
|
||||
}
|
||||
|
||||
if(AIForm){
|
||||
int mrRet = MessageBox(Handle, L"AI 助手尚未关闭,是否确定退出程序?", L"退出",
|
||||
MB_ICONQUESTION | MB_OKCANCEL);
|
||||
|
||||
if( mrRet==mrCancel ){
|
||||
CanClose = false;
|
||||
return;
|
||||
}
|
||||
|
||||
AIForm->Perform( WM_CLOSE, 0, 0 );
|
||||
|
||||
Sleep(300);
|
||||
}
|
||||
|
||||
Logout();
|
||||
}
|
||||
|
||||
@@ -1859,9 +1874,13 @@ bool __fastcall TMainForm::StopWebLoad()
|
||||
|
||||
m_bWebLogon = false;
|
||||
|
||||
if(!m_sActCode.Length())
|
||||
// if(!m_sActCode.Length())
|
||||
g_uid = 0;
|
||||
|
||||
u_sApiKey = "";
|
||||
if(AIForm)
|
||||
AIForm->OnLogout();
|
||||
|
||||
if( g_iPlatform==PF_PA ){
|
||||
m_loginValues[0] = m_loginValues[1] = m_loginValues[2]
|
||||
= m_loginValues[3] = m_loginValues[4] = m_loginValues[5] = "";
|
||||
@@ -2314,6 +2333,7 @@ void __fastcall TMainForm::UMHttpReturn(TMessage &msg)
|
||||
extm = 0,
|
||||
repeat = bVerify ? op : (op - UR_LOGIN),
|
||||
errRes = 0;
|
||||
String apiKey;
|
||||
|
||||
if( errCode==0 ){
|
||||
int len = urThread->m_sizeOut;
|
||||
@@ -2336,6 +2356,9 @@ void __fastcall TMainForm::UMHttpReturn(TMessage &msg)
|
||||
else if( pos = strstr(tokenPtr, "exp:") ){
|
||||
sscanf( pos+4, "%d", &extm );
|
||||
}
|
||||
else if( pos = strstr(tokenPtr, "key:") ){
|
||||
apiKey = pos + 4;
|
||||
}
|
||||
tokenPtr=strtok(NULL,"|");
|
||||
}
|
||||
}
|
||||
@@ -2373,7 +2396,7 @@ void __fastcall TMainForm::UMHttpReturn(TMessage &msg)
|
||||
PostMessage(Handle, UM_WEBDEAD, -4, 0 );
|
||||
}
|
||||
}
|
||||
else if(g_uid==0 || uid>0){
|
||||
else if(g_uid==0 && uid>0){
|
||||
g_uid = uid;
|
||||
m_tExpire = extm;
|
||||
|
||||
@@ -2388,7 +2411,11 @@ void __fastcall TMainForm::UMHttpReturn(TMessage &msg)
|
||||
PostMessage(Handle, UM_WEBDEAD, -2, 0 );
|
||||
}
|
||||
else{
|
||||
SetExpireJS();
|
||||
SetExpireJS();
|
||||
u_sApiKey = apiKey;
|
||||
|
||||
if(AIForm)
|
||||
AIForm->OnLogin();
|
||||
}
|
||||
|
||||
if(bVerify){
|
||||
@@ -2459,9 +2486,13 @@ void __fastcall TMainForm::UMWebLogin(TMessage &msg)
|
||||
|
||||
|
||||
m_bWebLogon = false;
|
||||
if(!m_sActCode.Length())
|
||||
// if(!m_sActCode.Length())
|
||||
g_uid = 0;
|
||||
|
||||
u_sApiKey = "";
|
||||
if(AIForm)
|
||||
AIForm->OnLogout();
|
||||
|
||||
g_MinOnBet = 20; //缺省限红
|
||||
g_MaxOnBet = 50000;
|
||||
|
||||
@@ -3663,20 +3694,30 @@ void __fastcall TMainForm::OnSettingClick(TObject *Sender)
|
||||
|
||||
void __fastcall TMainForm::OnResetClick(TObject *Sender)
|
||||
{
|
||||
ResetForm = new TResetForm(NULL);
|
||||
TPoint pt = TPoint( m_panTopBar->Left + m_btnReset->Left
|
||||
+ (m_btnReset->Width - ResetForm->Width)/ 2
|
||||
, m_panWeb->Top);
|
||||
pt = ClientToScreen(pt);
|
||||
ResetForm->Left = pt.x;
|
||||
ResetForm->Top = pt.y;
|
||||
if(AIForm){
|
||||
AIForm->BringToFront();
|
||||
u_sApiKey = "";
|
||||
AIForm->OnLogout();
|
||||
}
|
||||
else{
|
||||
AIForm = new TAIForm(NULL);
|
||||
AIForm->Show();
|
||||
}
|
||||
|
||||
ResetForm->ShowModal();
|
||||
|
||||
delete ResetForm;
|
||||
ResetForm = NULL;
|
||||
|
||||
SetTableFocus();
|
||||
// ResetForm = new TResetForm(NULL);
|
||||
// TPoint pt = TPoint( m_panTopBar->Left + m_btnReset->Left
|
||||
// + (m_btnReset->Width - ResetForm->Width)/ 2
|
||||
// , m_panWeb->Top);
|
||||
// pt = ClientToScreen(pt);
|
||||
// ResetForm->Left = pt.x;
|
||||
// ResetForm->Top = pt.y;
|
||||
//
|
||||
// ResetForm->ShowModal();
|
||||
//
|
||||
// delete ResetForm;
|
||||
// ResetForm = NULL;
|
||||
//
|
||||
// SetTableFocus();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user