Restructure repository to include all source folders
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>
This commit is contained in:
139
Server/AdminTool/AdminToolClient/ModifyCharNameDlg.cpp
Normal file
139
Server/AdminTool/AdminToolClient/ModifyCharNameDlg.cpp
Normal file
@@ -0,0 +1,139 @@
|
||||
// ModifyCharNameDlg.cpp : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "AdminToolClient.h"
|
||||
#include "ModifyCharNameDlg.h"
|
||||
|
||||
#include "UserCharTreeView.h"
|
||||
#include "GlobalFunctions.h"
|
||||
#include "CharacterDoc.h"
|
||||
#include "PacketManager.h"
|
||||
#include "WindowMgr.h"
|
||||
|
||||
// CModifyCharNameDlg <20><>ȭ <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
|
||||
IMPLEMENT_DYNAMIC(CModifyCharNameDlg, CDialog)
|
||||
CModifyCharNameDlg::CModifyCharNameDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CModifyCharNameDlg::IDD, pParent)
|
||||
{
|
||||
m_lpParent = pParent;
|
||||
INSERT_WINDOW(IDD_MODIFYCHARNAMEDLG, this);
|
||||
}
|
||||
|
||||
CModifyCharNameDlg::~CModifyCharNameDlg()
|
||||
{
|
||||
ERASE_WINDOW(IDD_MODIFYCHARNAMEDLG);
|
||||
}
|
||||
|
||||
void CModifyCharNameDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CModifyCharNameDlg, CDialog)
|
||||
ON_BN_CLICKED(IDC_MODIFY_CHARNAME, OnBnClickedModifyName)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CModifyCharNameDlg <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
|
||||
BOOL CModifyCharNameDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
CUserCharTreeView* lpTreeView = static_cast<CUserCharTreeView*>(m_lpParent);
|
||||
|
||||
if(NULL != lpTreeView)
|
||||
{
|
||||
CTreeCtrl* lpTree = static_cast<CTreeCtrl*>(lpTreeView->GetDlgItem(IDC_CHARTREE));
|
||||
|
||||
if(NULL != lpTree)
|
||||
{
|
||||
HTREEITEM hItem = lpTree->GetSelectedItem();
|
||||
|
||||
CString strItemText = lpTree->GetItemText(hItem);
|
||||
|
||||
TCHAR szName[20], szTmp[256];
|
||||
_stscanf(strItemText, _T("%s %s"), szTmp, szName);
|
||||
|
||||
SetDlgItemText(IDC_CURRENT_CHARNAME, szName);
|
||||
}
|
||||
}
|
||||
|
||||
SetWindowText(GetLocalString("IDD_MODIFYCHARNAMEDLG"));
|
||||
|
||||
SetUIString(this->m_hWnd, IDC_NAMEMODIFY_01, "IDC_NAMEMODIFY_01");
|
||||
SetUIString(this->m_hWnd, IDC_NAMEMODIFY_02, "IDC_NAMEMODIFY_02");
|
||||
SetUIString(this->m_hWnd, IDC_NAMEMODIFY_03, "IDC_NAMEMODIFY_03");
|
||||
SetUIString(this->m_hWnd, IDC_OVERLAP_TEST, "IDC_OVERLAP_TEST");
|
||||
SetUIString(this->m_hWnd, IDC_MODIFY_CHARNAME, "IDC_MODIFY_CHARNAME");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CModifyCharNameDlg::OnBnClickedModifyName()
|
||||
{
|
||||
CString strName;
|
||||
GetDlgItemText(IDC_CURRENT_CHARNAME, strName);
|
||||
|
||||
CUserCharTreeView* lpTreeView = static_cast<CUserCharTreeView*>(m_lpParent);
|
||||
CTreeCtrl* lpTree = static_cast<CTreeCtrl*>(lpTreeView->GetDlgItem(IDC_CHARTREE));
|
||||
|
||||
if(NULL != lpTree)
|
||||
{
|
||||
HTREEITEM hItem, hParentItem, hPParentItem;
|
||||
|
||||
hItem = lpTree->GetSelectedItem(); // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
hParentItem = lpTree->GetParentItem(hItem); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
hPParentItem = lpTree->GetParentItem(hParentItem); // UID <20><><EFBFBD><EFBFBD>
|
||||
|
||||
if((NULL != hItem) && (NULL != hParentItem) && (NULL != hPParentItem))
|
||||
{
|
||||
CString strSrvName = lpTree->GetItemText(hParentItem);
|
||||
CString strUID = lpTree->GetItemText(hPParentItem);
|
||||
CString strCID = lpTree->GetItemText(hItem);
|
||||
|
||||
unsigned long dwServerGroup = 0;
|
||||
TCHAR szTmp[100];
|
||||
unsigned long dwUID, dwCID;
|
||||
CString strCharacterName;
|
||||
|
||||
if(CCharacterDoc::GetInstance().GetServerIndex(strSrvName, dwServerGroup))
|
||||
{
|
||||
_stscanf(strUID, _T("%d %s"), &dwUID, szTmp);
|
||||
_stscanf(strCID, _T("%d %s"), &dwCID, szTmp);
|
||||
|
||||
GetDlgItemText(IDC_NEW_CHARNAME, strCharacterName);
|
||||
if(20 > strCharacterName.GetLength())
|
||||
{
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
CPacketMgr::GetInstance()->SendPktChangeName(
|
||||
dwUID, dwCID, dwServerGroup, lpTreeView->m_dwWndKey, strCharacterName.GetBuffer());
|
||||
}
|
||||
else
|
||||
{
|
||||
Report(GetLocalString("MSG_0108"), CAUTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CModifyCharNameDlg::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
if((WM_KEYDOWN == pMsg->message) && (VK_RETURN == pMsg->wParam))
|
||||
{
|
||||
if(pMsg->hwnd == GetDlgItem(IDC_NEW_CHARNAME)->m_hWnd)
|
||||
{
|
||||
OnBnClickedModifyName();
|
||||
}
|
||||
}
|
||||
|
||||
return CDialog::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
void CModifyCharNameDlg::OnOK()
|
||||
{
|
||||
//CDialog::OnOK();
|
||||
}
|
||||
Reference in New Issue
Block a user