Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
105 lines
2.3 KiB
C++
105 lines
2.3 KiB
C++
// LoginDlg.cpp : 구현 파일입니다.
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "MonitoringTool.h"
|
|
#include "LoginDlg.h"
|
|
#include "ChatServerEventHandler.h"
|
|
#include "ManagerServerEventHandler.h"
|
|
#include "GlobalFunc.h"
|
|
|
|
#include <Network/Packet/ChatToolPacketCmd.h>
|
|
#include <Network/Packet/ManagePacketCmd.h>
|
|
|
|
|
|
// CLoginDlg 대화 상자입니다.
|
|
|
|
IMPLEMENT_DYNAMIC(CLoginDlg, CDialog)
|
|
CLoginDlg::CLoginDlg(AUTH_TYPE cAuthType, CWnd* pParent /*=NULL*/)
|
|
: CDialog(CLoginDlg::IDD, pParent)
|
|
, m_cAuthType(cAuthType)
|
|
{
|
|
theApp.RegisterWindow(IDD_LOGINDLG, static_cast<CWnd*>(this));
|
|
}
|
|
|
|
CLoginDlg::~CLoginDlg()
|
|
{
|
|
theApp.RemoveWindow(IDD_LOGINDLG);
|
|
}
|
|
|
|
void CLoginDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CLoginDlg, CDialog)
|
|
ON_BN_CLICKED(IDC_LOGIN_BTN, OnBnClickedLoginBtn)
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
// CLoginDlg 메시지 처리기입니다.
|
|
|
|
BOOL CLoginDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
CString strWindowTitle = _T("UNKNOWN");
|
|
if (CHAT_SERVER == m_cAuthType)
|
|
{
|
|
strWindowTitle = GetMyINIString("LOCAL_STRING", "STRING_041");;
|
|
}
|
|
else if(MANAGER_SERVER == m_cAuthType)
|
|
{
|
|
strWindowTitle = GetMyINIString("LOCAL_STRING", "STRING_042");
|
|
}
|
|
|
|
SetWindowText(strWindowTitle);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
/// \brief 인증 성공시 호출하여 다이얼로그 소멸
|
|
/// \note 외부 클래스에서 인증성공이 확인되면 호출
|
|
void CLoginDlg::OnOK()
|
|
{
|
|
CDialog::OnOK();
|
|
}
|
|
|
|
void CLoginDlg::OnCancel()
|
|
{
|
|
CDialog::OnCancel();
|
|
}
|
|
|
|
void CLoginDlg::OnBnClickedLoginBtn()
|
|
{
|
|
char szID[ChatToolPkt::MAX_USER_ID], szPass[ChatToolPkt::MAX_PASSWORD];
|
|
|
|
if ((0 != GetDlgItemText(IDC_LOGIN_ID_EDIT, szID, ChatToolPkt::MAX_USER_ID))
|
|
&& (0 != GetDlgItemText(IDC_LOGIN_PASS_EDIT, szPass, ChatToolPkt::MAX_PASSWORD)))
|
|
{
|
|
if (m_cAuthType == CHAT_SERVER)
|
|
{
|
|
ClientNet::CChatServerEventHandler::SendAuthPkt(szID, szPass);
|
|
}
|
|
else if(m_cAuthType == MANAGER_SERVER)
|
|
{
|
|
ClientNet::CManagerServerEventHandler* lpHandler = theApp.GetManagerHandler();
|
|
|
|
if(0 != lpHandler)
|
|
{
|
|
ServerManage::UserInfo userInfo;
|
|
|
|
_tcsncpy(userInfo.szID, szID, ServerManage::UserInfo::ID_LEN);
|
|
_tcsncpy(userInfo.szPassword, szPass, ServerManage::UserInfo::PASS_LEN);
|
|
|
|
ClientNet::CManagerServerEventHandler::SendUserInfo(lpHandler, &userInfo, 1,
|
|
ServerManage::CMD::AuthUser, 0);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
theApp.ReportResult(GetMyINIString("LOCAL_STRING", "STRING_036"));
|
|
}
|
|
} |