655 lines
20 KiB
C++
655 lines
20 KiB
C++
#include "stdafx.h"
|
|
#include "shellapi.h"
|
|
#include "SUISecurityWnd.h"
|
|
#include "SGameManager.h"
|
|
//#include "SGameMessageUI.h"
|
|
|
|
#include "KUIControlEdit.h"
|
|
#include "KUIControlStatic.h"
|
|
#include "KUIControlButton.h"
|
|
|
|
#include <toolkit/nsl.h>
|
|
#include <toolkit/nslreg.h>
|
|
|
|
#include "SStringDB.h"
|
|
#include "SGameOption.h"
|
|
|
|
namespace
|
|
{
|
|
const char* g_szPassword_edit1 = "password_edit1";
|
|
const char* g_szPassword_edit2 = "password_edit2";
|
|
const char* g_szPassword_edit3 = "password_edit3";
|
|
|
|
const char* g_szStaticMsg = "static_msg";
|
|
const char* g_szStaticMsg1 = "static_msg1";
|
|
const char* g_szStaticMsg2 = "static_msg2";
|
|
const char* g_szStaticMsg3 = "static_msg3";
|
|
|
|
const char* g_szButtonOk = "button_ok";
|
|
const char* g_szButtonCancel = "button_cancel";
|
|
const char* g_szButtonHelp = "button_help";
|
|
|
|
const char* g_szSpecialChar = "[^a-zA-Z0-9]";
|
|
|
|
};
|
|
|
|
using namespace UIControl;
|
|
|
|
SUISecurityWnd::SUISecurityWnd( SGameManager* pGameManager ) : SUIWnd( pGameManager )
|
|
{
|
|
}
|
|
|
|
SUISecurityWnd::~SUISecurityWnd()
|
|
{
|
|
ControlInfoMgr* pControlInfoMgr = NULL;
|
|
bool res = m_vControlInfo.get_first_value( pControlInfoMgr );
|
|
while ( res )
|
|
{
|
|
if ( pControlInfoMgr != NULL )
|
|
{
|
|
SAFE_DELETE( pControlInfoMgr );
|
|
}
|
|
res = m_vControlInfo.get_next_value( pControlInfoMgr );
|
|
}
|
|
|
|
m_vControlInfo.clear();
|
|
}
|
|
|
|
bool SUISecurityWnd::InitControls( KPoint kPos )
|
|
{
|
|
ControlInfoMgr* pControlInfoMgr = NULL;
|
|
bool res = m_vControlInfo.get_first_value( pControlInfoMgr );
|
|
while ( res )
|
|
{
|
|
iter_controlinfo it_control = pControlInfoMgr->vControlInfo.begin();
|
|
for( ; it_control != pControlInfoMgr->vControlInfo.end(); ++it_control )
|
|
{
|
|
InitializeControl( (*it_control) );
|
|
}
|
|
|
|
res = m_vControlInfo.get_next_value( pControlInfoMgr );
|
|
}
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
void SUISecurityWnd::AddControlInfo( UIControl::ControlInfo* pControlInfo )
|
|
{
|
|
if( pControlInfo == NULL ) return;
|
|
|
|
ControlInfoMgr* pControlInfoMgr = NULL;
|
|
if( m_vControlInfo.lookup( pControlInfo->controlID, pControlInfoMgr ) )
|
|
{
|
|
pControlInfoMgr->vControlInfo.push_back( pControlInfo );
|
|
}
|
|
else
|
|
{
|
|
ControlInfoMgr* pNewMgr = new ControlInfoMgr;
|
|
pNewMgr->vControlInfo.push_back( pControlInfo );
|
|
m_vControlInfo.add( pControlInfo->controlID, pNewMgr );
|
|
}
|
|
}
|
|
|
|
ControlInfoMgr* SUISecurityWnd::GetControlMgr( CONTROL_ID controlid )
|
|
{
|
|
ControlInfoMgr* pControlInfoMgr = NULL;
|
|
m_vControlInfo.lookup( controlid, pControlInfoMgr );
|
|
|
|
return pControlInfoMgr;
|
|
}
|
|
|
|
void SUISecurityWnd::InitializeControl( ControlInfo* pControl )
|
|
{
|
|
if( pControl == NULL ) return;
|
|
|
|
switch( pControl->controlID )
|
|
{
|
|
case CONTROL_ID::CONTROL_ID_STATIC:
|
|
{
|
|
ControlStatic* pControlStatic = (ControlStatic*)pControl;
|
|
KUIControlStatic* pStaticMsg = dynamicCast<KUIControlStatic*>(GetChild( pControlStatic->controlName ));
|
|
if( pStaticMsg )
|
|
{
|
|
if( pControlStatic->caption_name != NULL )
|
|
pStaticMsg->SetCaption( pControlStatic->caption_name );
|
|
}
|
|
}
|
|
break;
|
|
case CONTROL_ID::CONTROL_ID_EDIT:
|
|
{
|
|
ControlEdit* pControlEdit = (ControlEdit*)pControl;
|
|
KUIControlEdit* pEdit = dynamicCast<KUIControlEdit*>(GetChild( pControlEdit->controlName ));
|
|
if( pEdit )
|
|
{
|
|
pEdit->SetLimitation( pControlEdit->limit_text, pControlEdit->buffer_limit );
|
|
pEdit->SetPassword( pControlEdit->password );
|
|
|
|
// if( pControlEdit->bFirstFocus ) pEdit->SetFocus( true );
|
|
// else pEdit->SetFocus( false );
|
|
}
|
|
}
|
|
break;
|
|
case CONTROL_ID::CONTROL_ID_BUTTON:
|
|
{
|
|
ControlButton* pControlButton = (ControlButton*)pControl;
|
|
KUIControlButton* pButton = dynamicCast<KUIControlButton*>(GetChild( pControlButton->controlName ));
|
|
if( pButton )
|
|
{
|
|
if( pControlButton->caption_name != NULL )
|
|
pButton->SetCaption( pControlButton->caption_name );
|
|
|
|
pControlButton->bEnable ? pButton->Enable() : pButton->Disable();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
bool SUISecurityWnd::InitData( bool bReload )
|
|
{
|
|
return SUIWnd::InitData( bReload );
|
|
}
|
|
|
|
void SUISecurityWnd::Process( DWORD dwTime )
|
|
{
|
|
SUIWnd::Process( dwTime );
|
|
}
|
|
|
|
void SUISecurityWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
ControlInfoMgr* pControlInfoMgr = NULL;
|
|
bool res = m_vControlInfo.get_first_value( pControlInfoMgr );
|
|
while ( res )
|
|
{
|
|
if( pControlInfoMgr )
|
|
{
|
|
iter_controlinfo it_ctrl = pControlInfoMgr->vControlInfo.begin();
|
|
for( ; it_ctrl != pControlInfoMgr->vControlInfo.end(); ++it_ctrl )
|
|
{
|
|
switch( (*it_ctrl)->controlID )
|
|
{
|
|
case CONTROL_ID::CONTROL_ID_EDIT:
|
|
{
|
|
KUIControlEdit* pEdit = dynamicCast<KUIControlEdit*>(GetChild( (*it_ctrl)->controlName ));
|
|
if( pEdit )
|
|
{
|
|
pEdit->SetText( "" );
|
|
|
|
ControlEdit* pControlEdit = (ControlEdit*)(*it_ctrl);
|
|
if( bOpen && pControlEdit->bFirstFocus )
|
|
pEdit->SetFocus( true );
|
|
else
|
|
pEdit->SetFocus( false );
|
|
}
|
|
}
|
|
break;
|
|
case CONTROL_ID::CONTROL_ID_BUTTON:
|
|
{
|
|
KUIControlButton* pButton = dynamicCast<KUIControlButton*>(GetChild( (*it_ctrl)->controlName ));
|
|
if( pButton )
|
|
{
|
|
ControlButton* pControlButton = (ControlButton*)(*it_ctrl);
|
|
pControlButton->bEnable ? pButton->Enable() : pButton->Disable();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
res = m_vControlInfo.get_next_value( pControlInfoMgr );
|
|
}
|
|
|
|
SUIWnd::OnNotifyUIWindowOpen( bOpen, bLimitWnd );
|
|
}
|
|
|
|
DWORD SUISecurityWnd::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
return SUIWnd::OnMouseMessage( dwMessage, x, y );
|
|
}
|
|
|
|
void SUISecurityWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
SUIWnd::ProcMsgAtStatic( pMsg );
|
|
}
|
|
|
|
void SUISecurityWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( strcmp( lpszControlID, "button_ok" ) == 0 || ::_stricmp( lpszControlID, "IDOK" ) == 0 )
|
|
{
|
|
KUIControlButton* pButton = dynamicCast<KUIControlButton*>(GetChild( g_szButtonOk ));
|
|
if( pButton && pButton->IsDisable() == false )
|
|
{
|
|
OnBnClickedButtonOk();
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, false, true ) );
|
|
}
|
|
}
|
|
else if( strcmp( lpszControlID, "button_cancel" ) == 0 || ::_stricmp( lpszControlID, "IDCANCEL" ) == 0 )
|
|
{
|
|
KUIControlButton* pButton = dynamicCast<KUIControlButton*>(GetChild( g_szButtonCancel ));
|
|
if( pButton && pButton->IsDisable() )
|
|
return;
|
|
|
|
ControlInfoMgr* pControlMgr = GetControlMgr( CONTROL_ID_EDIT );
|
|
if( pControlMgr )
|
|
{
|
|
iter_controlinfo it_ctrl = pControlMgr->vControlInfo.begin();
|
|
for( ; it_ctrl != pControlMgr->vControlInfo.end(); ++it_ctrl )
|
|
{
|
|
ControlEdit* pControlEdit = (ControlEdit*)(*it_ctrl);
|
|
KUIControlEdit* pEdit = dynamicCast<KUIControlEdit*>(GetChild( pControlEdit->controlName ));
|
|
if( pEdit ) pEdit->SetText( "" );
|
|
}
|
|
}
|
|
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, false, true ) );
|
|
}
|
|
else if( strcmp( lpszControlID, "button_help" ) == 0 )
|
|
{
|
|
KUIControlButton* pButton = dynamicCast<KUIControlButton*>(GetChild( g_szButtonHelp ));
|
|
if( pButton && pButton->IsDisable() == false )
|
|
{
|
|
OnBnClickedButtonHelp();
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KEDIT_CHANGE:
|
|
{
|
|
/* bool bEnable = true;
|
|
|
|
ControlInfoMgr* pControlMgr = GetControlMgr( CONTROL_ID_EDIT );
|
|
if( pControlMgr )
|
|
{
|
|
iter_controlinfo it_ctrl = pControlMgr->vControlInfo.begin();
|
|
for( ; it_ctrl != pControlMgr->vControlInfo.end(); ++it_ctrl )
|
|
{
|
|
ControlEdit* pControlEdit = (ControlEdit*)(*it_ctrl);
|
|
KUIControlEdit* pEdit = dynamicCast<KUIControlEdit*>(GetChild( pControlEdit->controlName ));
|
|
if( pEdit )
|
|
{
|
|
if( strcmp( pEdit->GetText(), "" ) == 0 )
|
|
{
|
|
bEnable = false;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
KUIControlButton* pButton = dynamicCast<KUIControlButton*>(GetChild( g_szButtonOk ));
|
|
if( pButton )
|
|
{
|
|
bEnable ? pButton->Enable() : pButton->Disable();
|
|
}*/
|
|
}
|
|
break;
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
bool SUISecurityWnd::FindSpecialChar( const char* string )
|
|
{
|
|
if( string == NULL ) return false;
|
|
|
|
if( nsl::regex::match( g_szSpecialChar, string ) )
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//보안 설정
|
|
SUISecuritySettingWnd::SUISecuritySettingWnd( SGameManager* pGameManager ) : SUISecurityWnd( pGameManager )
|
|
{
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg, GetStringDB().GetString( 6564 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg1, GetStringDB().GetString( 6563 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg2, GetStringDB().GetString( 6559 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg3, GetStringDB().GetString( 6569 ) ) );
|
|
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit1, 18, true, true, true ) );
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit2, 18, true, true, false ) );
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit3, 18, true, true, false ) );
|
|
|
|
}
|
|
|
|
SUISecuritySettingWnd::~SUISecuritySettingWnd()
|
|
{
|
|
}
|
|
|
|
void SUISecuritySettingWnd::OnBnClickedButtonOk()
|
|
{
|
|
KUIControlEdit* pPassWord1 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit1 ));
|
|
KUIControlEdit* pPassWord2 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit2 ));
|
|
KUIControlEdit* pPassWord3 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit3 ));
|
|
|
|
if( pPassWord1 && pPassWord2 && pPassWord3 )
|
|
{
|
|
SIMSG_UI_PASSWORD_COMPARE::COMPARE_RESULT result = SIMSG_UI_PASSWORD_COMPARE::FAILED_MATCH_FROM_CLIENT;
|
|
|
|
// sonador 3.8.1 empty password 오류 수정
|
|
std::string strPassword1 = pPassWord2->GetText();
|
|
std::string strPassword2 = pPassWord3->GetText();
|
|
|
|
if( !strPassword1.empty() && !strPassword2.empty() && strcmp( strPassword1.c_str(), strPassword2.c_str() ) == 0 )
|
|
result = SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT;
|
|
|
|
if( result == SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT )
|
|
{
|
|
if( FindSpecialChar( pPassWord1->GetText() ) ||
|
|
FindSpecialChar( pPassWord2->GetText() ) )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
}
|
|
|
|
SIMSG_UI_PASSWORD_COMPARE msg( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, result );
|
|
msg.password1 = pPassWord1->GetText();
|
|
msg.password2 = pPassWord2->GetText();
|
|
|
|
m_pGameManager->InterfaceMsg( &msg );
|
|
}
|
|
else
|
|
{
|
|
assert( false );
|
|
}
|
|
}
|
|
|
|
void SUISecuritySettingWnd::OnBnClickedButtonCancel()
|
|
{
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//보안 삭제
|
|
/*
|
|
//보안 삭제
|
|
class SUISecurityClearWnd : public SUISecurityWnd
|
|
{
|
|
public:
|
|
virtual void OnBnClickedButtonOk();
|
|
virtual void OnBnClickedButtonCancel();
|
|
public:
|
|
SUISecurityClearWnd( SGameManager* pGameManager );
|
|
virtual ~SUISecurityClearWnd();
|
|
};
|
|
|
|
*/
|
|
|
|
SUISecurityClearWnd::SUISecurityClearWnd( SGameManager* pGameManager ) : SUISecurityWnd( pGameManager )
|
|
{
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg, GetStringDB().GetString( 6564 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg1, GetStringDB().GetString( 6563 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg2, GetStringDB().GetString( 6559 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg3, GetStringDB().GetString( 6569 ) ) );
|
|
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit1, 18, true, true, true ) );
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit2, 18, true, true, false ) );
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit3, 18, true, true, false ) );
|
|
|
|
}
|
|
|
|
SUISecurityClearWnd::~SUISecurityClearWnd()
|
|
{
|
|
}
|
|
|
|
void SUISecurityClearWnd::OnBnClickedButtonOk()
|
|
{
|
|
KUIControlEdit* pPassWord1 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit1 ));
|
|
KUIControlEdit* pPassWord2 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit2 ));
|
|
KUIControlEdit* pPassWord3 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit3 ));
|
|
|
|
if( pPassWord1 && pPassWord2 && pPassWord3 )
|
|
{
|
|
SIMSG_UI_PASSWORD_COMPARE::COMPARE_RESULT result = SIMSG_UI_PASSWORD_COMPARE::FAILED_MATCH_FROM_CLIENT;
|
|
|
|
// sonador 3.8.1 empty password 오류 수정
|
|
std::string strPassword1 = pPassWord2->GetText();
|
|
std::string strPassword2 = pPassWord3->GetText();
|
|
|
|
if( !strPassword1.empty() && !strPassword2.empty() && strcmp( strPassword1.c_str(), strPassword2.c_str() ) == 0 )
|
|
result = SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT;
|
|
|
|
if( result == SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT )
|
|
{
|
|
if( FindSpecialChar( pPassWord1->GetText() ) ||
|
|
FindSpecialChar( pPassWord2->GetText() ) )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
}
|
|
|
|
SIMSG_UI_PASSWORD_COMPARE msg( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, result );
|
|
msg.password1 = pPassWord1->GetText();
|
|
msg.password2 = pPassWord2->GetText();
|
|
|
|
m_pGameManager->InterfaceMsg( &msg );
|
|
}
|
|
else
|
|
{
|
|
assert( false );
|
|
}
|
|
}
|
|
|
|
void SUISecurityClearWnd::OnBnClickedButtonCancel()
|
|
{
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//보안 설정 변경
|
|
SUISecuritySettingModifyWnd::SUISecuritySettingModifyWnd( SGameManager* pGameManager ) : SUISecurityWnd( pGameManager )
|
|
{
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg, GetStringDB().GetString( 1306 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg1, GetStringDB().GetString( 6561 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg2, GetStringDB().GetString( 6562 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg3, GetStringDB().GetString( 6560 ) ) );
|
|
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit1, 18, true, true, true ) );
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit2, 18, true, true, false ) );
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit3, 18, true, true, false ) );
|
|
|
|
// AddControlInfo( new ControlButton( g_szButtonOk, GetStringDB().GetString( 6159 ), true ) );
|
|
// AddControlInfo( new ControlButton( g_szButtonCancel, GetStringDB().GetString( 6109 ), true ) );
|
|
}
|
|
|
|
SUISecuritySettingModifyWnd::~SUISecuritySettingModifyWnd()
|
|
{
|
|
}
|
|
|
|
void SUISecuritySettingModifyWnd::OnBnClickedButtonOk()
|
|
{
|
|
KUIControlEdit* pPassWord1 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit1 ));
|
|
KUIControlEdit* pPassWord2 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit2 ));
|
|
KUIControlEdit* pPassWord3 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit3 ));
|
|
|
|
if( pPassWord1 && pPassWord2 && pPassWord3 )
|
|
{
|
|
SIMSG_UI_PASSWORD_COMPARE::COMPARE_RESULT result = SIMSG_UI_PASSWORD_COMPARE::FAILED_MATCH_FROM_CLIENT;
|
|
|
|
std::string strPassword1 = pPassWord2->GetText();
|
|
std::string strPassword2 = pPassWord3->GetText();
|
|
|
|
if( !strPassword1.empty() && !strPassword2.empty() && strcmp( strPassword1.c_str(), strPassword2.c_str() ) == 0 )
|
|
result = SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT;
|
|
|
|
if( result == SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT )
|
|
{
|
|
if( FindSpecialChar( pPassWord1->GetText() ) ||
|
|
FindSpecialChar( pPassWord3->GetText() ) )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
}
|
|
|
|
|
|
SIMSG_UI_PASSWORD_COMPARE msg( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, result );
|
|
msg.password1 = pPassWord1->GetText();
|
|
msg.password2 = pPassWord3->GetText();
|
|
|
|
m_pGameManager->InterfaceMsg( &msg );
|
|
}
|
|
else
|
|
{
|
|
assert( false );
|
|
}
|
|
}
|
|
|
|
void SUISecuritySettingModifyWnd::OnBnClickedButtonCancel()
|
|
{
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//캐리터 보안
|
|
SUISecurityCharacterWnd::SUISecurityCharacterWnd( SGameManager* pGameManager ) : SUISecurityWnd( pGameManager )
|
|
{
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg2, GetStringDB().GetString( 6559 ) ) );
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg3, GetStringDB().GetString( 6560 ) ) );
|
|
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit2, 18, true, true, true ) );
|
|
//AddControlInfo( new ControlEdit( g_szPassword_edit3, 6, true, true, false ) );
|
|
|
|
// AddControlInfo( new ControlButton( g_szButtonOk, NULL, true ) );
|
|
// AddControlInfo( new ControlButton( g_szButtonCancel, NULL, true ) );
|
|
}
|
|
|
|
SUISecurityCharacterWnd::~SUISecurityCharacterWnd()
|
|
{
|
|
}
|
|
|
|
void SUISecurityCharacterWnd::OnBnClickedButtonOk()
|
|
{
|
|
KUIControlEdit* pPassWord2 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit2 ));
|
|
KUIControlEdit* pPassWord3 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit3 ));
|
|
|
|
if( pPassWord2 && pPassWord3 )
|
|
{
|
|
SIMSG_UI_PASSWORD_COMPARE::COMPARE_RESULT result = SIMSG_UI_PASSWORD_COMPARE::FAILED_MATCH_FROM_CLIENT;
|
|
if( strcmp( pPassWord2->GetText(), pPassWord3->GetText() ) == 0 )
|
|
result = SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT;
|
|
|
|
if( result == SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT )
|
|
{
|
|
if( FindSpecialChar( pPassWord2->GetText() ) ||
|
|
FindSpecialChar( pPassWord3->GetText() ) )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
}
|
|
|
|
SIMSG_UI_PASSWORD_COMPARE msg( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, result );
|
|
msg.password1 = pPassWord2->GetText();
|
|
msg.password2 = pPassWord3->GetText();
|
|
msg.mode = GetMode();
|
|
|
|
m_pGameManager->InterfaceMsg( &msg );
|
|
}
|
|
// 보안비밀번호 관리 방식 변경에 따른 업데이트 2009.08.17 sfreer
|
|
else if( pPassWord2 )
|
|
{
|
|
SIMSG_UI_PASSWORD_COMPARE::COMPARE_RESULT result = SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT;
|
|
|
|
|
|
// 보안비밀번호에 특수문자 가능하게 하기 위한 처리 2009.08.20 sfreer
|
|
/*if( FindSpecialChar( pPassWord2->GetText() ) )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
else */if( strlen(pPassWord2->GetText()) == 0 )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
|
|
SIMSG_UI_PASSWORD_COMPARE msg( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, result );
|
|
msg.password1 = pPassWord2->GetText();
|
|
msg.password2 = pPassWord2->GetText();
|
|
msg.mode = GetMode();
|
|
|
|
m_pGameManager->InterfaceMsg( &msg );
|
|
|
|
}
|
|
else
|
|
{
|
|
assert( false );
|
|
}
|
|
}
|
|
|
|
void SUISecurityCharacterWnd::OnBnClickedButtonCancel()
|
|
{
|
|
}
|
|
|
|
void SUISecurityCharacterWnd::OnBnClickedButtonHelp()
|
|
{
|
|
static int button_help_delay = 0;
|
|
if( GetSafeTickCount() - button_help_delay > 3000)
|
|
{
|
|
button_help_delay = GetSafeTickCount();
|
|
//if( GetLocaleOption().GetValueString("SECURITY_URL", "")
|
|
ShellExecute( NULL, NULL, "iexplore.exe", GetLocaleOption().GetValueString("SECURITY_URL", ""), NULL, SW_SHOWMAXIMIZED );
|
|
}
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////
|
|
//창고 보안
|
|
SUISecurityStorageWnd::SUISecurityStorageWnd( SGameManager* pGameManager ) : SUISecurityWnd( pGameManager )
|
|
{
|
|
// AddControlInfo( new ControlStatic( g_szStaticMsg2, GetStringDB().GetString( 6559 ) ) );
|
|
|
|
AddControlInfo( new ControlEdit( g_szPassword_edit2, 18, true, true, true ) );
|
|
|
|
// AddControlInfo( new ControlButton( g_szButtonOk, NULL, true ) );
|
|
// AddControlInfo( new ControlButton( g_szButtonCancel, NULL, true ) );
|
|
}
|
|
|
|
SUISecurityStorageWnd::~SUISecurityStorageWnd()
|
|
{
|
|
}
|
|
|
|
void SUISecurityStorageWnd::OnBnClickedButtonOk()
|
|
{
|
|
KUIControlEdit* pPassWord2 = dynamicCast<KUIControlEdit*>(GetChild( g_szPassword_edit2 ));
|
|
|
|
if( pPassWord2 )
|
|
{
|
|
SIMSG_UI_PASSWORD_COMPARE::COMPARE_RESULT result = SIMSG_UI_PASSWORD_COMPARE::SUCCESS_FROM_CLIENT;
|
|
|
|
// 보안비밀번호에 특수문자 가능하게 하기 위한 처리 2009.08.20 sfreer
|
|
/*if( FindSpecialChar( pPassWord2->GetText() ) )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
else */if( strlen(pPassWord2->GetText()) == 0 )
|
|
{
|
|
result = SIMSG_UI_PASSWORD_COMPARE::FAILED_SPECIALCHAR_FROM_CLIENT;
|
|
}
|
|
|
|
SIMSG_UI_PASSWORD_COMPARE msg( (SIMSG_TOGGLE_UIWINDOW::_UIWINDOW_TYPE)m_nWindowID, result );
|
|
|
|
msg.password1 = pPassWord2->GetText();
|
|
msg.mode = GetMode();
|
|
|
|
m_pGameManager->InterfaceMsg( &msg );
|
|
}
|
|
}
|
|
|
|
void SUISecurityStorageWnd::OnBnClickedButtonCancel()
|
|
{
|
|
}
|
|
|
|
void SUISecurityStorageWnd::OnBnClickedButtonHelp()
|
|
{
|
|
static int button_help_delay = 0;
|
|
if( GetSafeTickCount() - button_help_delay > 3000)
|
|
{
|
|
button_help_delay = GetSafeTickCount();
|
|
//if( GetLocaleOption().GetValueString("SECURITY_URL", "")
|
|
ShellExecute( NULL, NULL, "iexplore.exe", GetLocaleOption().GetValueString("SECURITY_URL", ""), NULL, SW_SHOWMAXIMIZED );
|
|
}
|
|
} |