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:
284
Server/AdminTool/AdminToolClient/CharQuestPage.cpp
Normal file
284
Server/AdminTool/AdminToolClient/CharQuestPage.cpp
Normal file
@@ -0,0 +1,284 @@
|
||||
// CharQuestPage.cpp : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "AdminToolClient.h"
|
||||
#include "CharQuestPage.h"
|
||||
#include "GlobalFunctions.h"
|
||||
#include "PacketManager.h"
|
||||
#include "ListCtrlSortClass.h"
|
||||
#include <Utility/Math/Math.h>
|
||||
|
||||
#include <ToolQuestList.h>
|
||||
#include <Character/ModifyCharacter.h>
|
||||
#include ".\charquestpage.h"
|
||||
|
||||
// CCharQuestPage <20><>ȭ <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
|
||||
IMPLEMENT_DYNAMIC(CCharQuestPage, CPropertyPage)
|
||||
CCharQuestPage::CCharQuestPage()
|
||||
: CPropertyPage(CCharQuestPage::IDD)
|
||||
, m_bSortListAsc(false)
|
||||
{
|
||||
}
|
||||
|
||||
CCharQuestPage::~CCharQuestPage()
|
||||
{
|
||||
}
|
||||
|
||||
void CCharQuestPage::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CPropertyPage::DoDataExchange(pDX);
|
||||
DDX_Control(pDX, IDC_CHARINGQUESTLIST, m_ctrlCharIngQuestList);
|
||||
DDX_Control(pDX, IDC_CHARFINISHEDQUESTLIST, m_ctrlCharFinishedQuestList);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCharQuestPage, CPropertyPage)
|
||||
ON_BN_CLICKED(IDC_INGQUEST_RESET, OnBnClickedIngquestReset)
|
||||
ON_BN_CLICKED(IDC_SEL_INGQUEST_DEL, OnBnClickedSelIngquestDel)
|
||||
ON_BN_CLICKED(IDC_SEL_ENDQUEST_DEL, OnBnClickedSelEndquestDel)
|
||||
ON_NOTIFY(LVN_COLUMNCLICK, IDC_CHARINGQUESTLIST, OnLvnColumnclickCharingquestlist)
|
||||
ON_NOTIFY(LVN_COLUMNCLICK, IDC_CHARFINISHEDQUESTLIST, OnLvnColumnclickCharfinishedquestlist)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CCharQuestPage <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
|
||||
BOOL CCharQuestPage::OnInitDialog()
|
||||
{
|
||||
CPropertyPage::OnInitDialog();
|
||||
|
||||
m_ctrlCharIngQuestList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_FLATSB);
|
||||
m_ctrlCharIngQuestList.InsertColumn(0, _T("QID"), LVCFMT_LEFT, 50);
|
||||
m_ctrlCharIngQuestList.InsertColumn(1, GetLocalString("QUEST_NAME"), LVCFMT_LEFT, 170);
|
||||
m_ctrlCharIngQuestList.InsertColumn(2, GetLocalString("QUEST_LEVEL"), LVCFMT_LEFT, 100);
|
||||
m_ctrlCharIngQuestList.InsertColumn(3, GetLocalString("QUEST_PHASE"), LVCFMT_LEFT, 100);
|
||||
|
||||
m_ctrlCharFinishedQuestList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_FLATSB);
|
||||
m_ctrlCharFinishedQuestList.InsertColumn(0, _T("QID"), LVCFMT_LEFT, 50);
|
||||
m_ctrlCharFinishedQuestList.InsertColumn(1, GetLocalString("QUEST_NAME"), LVCFMT_LEFT, 170);
|
||||
|
||||
SetUIString(this->m_hWnd, IDC_QUESTPAGE_01, "IDC_QUESTPAGE_01");
|
||||
SetUIString(this->m_hWnd, IDC_QUESTPAGE_02, "IDC_QUESTPAGE_02");
|
||||
SetUIString(this->m_hWnd, IDC_SEL_INGQUEST_DEL, "IDC_SEL_INGQUEST_DEL");
|
||||
SetUIString(this->m_hWnd, IDC_INGQUEST_RESET, "IDC_INGQUEST_RESET");
|
||||
SetUIString(this->m_hWnd, IDC_SEL_ENDQUEST_DEL, "IDC_SEL_ENDQUEST_DEL");
|
||||
SetUIString(this->m_hWnd, IDC_ENDQUEST_RESET, "IDC_ENDQUEST_RESET");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool CCharQuestPage::SetQuestPageData(unsigned int dwDocKey, CModifyCharacter* lpModifyCharacter)
|
||||
{
|
||||
if((NULL != lpModifyCharacter) && (dwDocKey != 0))
|
||||
{
|
||||
m_lpModifyCharacter = lpModifyCharacter;
|
||||
m_dwDocKey = dwDocKey;
|
||||
|
||||
GetDlgItem(IDC_SEL_INGQUEST_DEL)->EnableWindow(true);
|
||||
//GetDlgItem(IDC_INGQUEST_RESET)->EnableWindow(true);
|
||||
GetDlgItem(IDC_SEL_ENDQUEST_DEL)->EnableWindow(true);
|
||||
//GetDlgItem(IDC_ENDQUEST_RESET)->EnableWindow(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void CCharQuestPage::SetQuestPage(CModifyCharacter* lpModifyCharacter)
|
||||
{
|
||||
m_ctrlCharIngQuestList.DeleteAllItems();
|
||||
m_ctrlCharFinishedQuestList.DeleteAllItems();
|
||||
|
||||
if(NULL == lpModifyCharacter)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CString strForFormat;
|
||||
|
||||
Quest::ExecutingQuest* lpExeQuest = lpModifyCharacter->GetExecutingQuest();
|
||||
unsigned short* lpHisQuest = lpModifyCharacter->GetHistoryQuest();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>
|
||||
for (int nIndex = 0; nIndex < Quest::MAX_EXECUTING_QUEST; ++nIndex)
|
||||
{
|
||||
if (NULL != lpExeQuest[nIndex].m_QuestNode)
|
||||
{
|
||||
LPQuestNode lpQuestNode = g_QuestList.GetQuest(lpExeQuest[nIndex].m_QuestNode->m_wQuestID);
|
||||
|
||||
if (NULL != lpQuestNode)
|
||||
{
|
||||
strForFormat.Format(_T("0x%04X"), lpExeQuest[nIndex].m_QuestNode->m_wQuestID);
|
||||
m_ctrlCharIngQuestList.InsertItem(0, strForFormat);
|
||||
|
||||
strForFormat.Format(_T("%s"), lpQuestNode->m_strQuestTitle);
|
||||
m_ctrlCharIngQuestList.SetItemText(0, 1, strForFormat);
|
||||
|
||||
strForFormat.Format(_T("%s"), lpQuestNode->m_strQuestLevel);
|
||||
m_ctrlCharIngQuestList.SetItemText(0, 2, strForFormat);
|
||||
|
||||
strForFormat.Format(_T("%d/%d"), lpExeQuest[nIndex].m_cPhase, lpQuestNode->m_wMaxPhase);
|
||||
m_ctrlCharIngQuestList.SetItemText(0, 3, strForFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
Report(GetLocalString("MSG_0183"), FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <20>Ϸ<EFBFBD><CFB7><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>
|
||||
for (int nIndex = 0; nIndex < Quest::MAX_HISTORY_QUEST; ++nIndex)
|
||||
{
|
||||
if (0 != lpHisQuest[nIndex])
|
||||
{
|
||||
LPQuestNode lpHistoryQuestNode = g_QuestList.GetQuest(lpHisQuest[nIndex]);
|
||||
|
||||
if (NULL != lpHistoryQuestNode)
|
||||
{
|
||||
strForFormat.Format(_T("0x%04X"), lpHisQuest[nIndex]);
|
||||
m_ctrlCharFinishedQuestList.InsertItem(0, strForFormat);
|
||||
|
||||
strForFormat.Format(_T("%s"), lpHistoryQuestNode->m_strQuestTitle);
|
||||
m_ctrlCharFinishedQuestList.SetItemText(0, 1, strForFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
Report(GetLocalString("MSG_0183"), FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCharQuestPage::OnBnClickedIngquestReset()
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD>Ʈ <20>ʱ<EFBFBD>ȭ
|
||||
}
|
||||
|
||||
void CCharQuestPage::OnBnClickedSelIngquestDel()
|
||||
{
|
||||
if (1 == m_ctrlCharIngQuestList.GetSelectedCount())
|
||||
{
|
||||
char szQID[16];
|
||||
int nIndex = m_ctrlCharIngQuestList.GetNextItem(-1, LVIS_SELECTED);
|
||||
m_ctrlCharIngQuestList.GetItemText(nIndex, 0, szQID, 16);
|
||||
|
||||
|
||||
//unsigned long ulQID = 0;
|
||||
//int i = 0;
|
||||
//int k = strlen(szQID);
|
||||
|
||||
//unsigned short sQID = 0;
|
||||
|
||||
//for(i = 0; i < k; ++i)
|
||||
//{
|
||||
// if(szQID[i] == '0' && (szQID[i + 1] == 'x' || szQID[i + 1] == 'X'))
|
||||
// {
|
||||
// ++i;
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// switch(tolower(szQID[i]))
|
||||
// {
|
||||
// case 'a':
|
||||
// case 'b':
|
||||
// case 'c':
|
||||
// case 'd':
|
||||
// case 'e':
|
||||
// case 'f':
|
||||
// sQID = (sQID * 16) + (10 + tolower(szQID[i]) - 'a');
|
||||
// break;
|
||||
// default:
|
||||
// sQID = (sQID * 16) + (szQID[i] - '0');
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
CPacketMgr::GetInstance()->SendCancelExecuteQuest(m_dwDocKey,
|
||||
m_lpModifyCharacter->GetServerGroup(), m_lpModifyCharacter->GetCID(),
|
||||
(unsigned short)Math::Convert::StrToHex16(szQID));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Report(GetLocalString("MSG_0184"), CAUTION);
|
||||
}
|
||||
}
|
||||
|
||||
void CCharQuestPage::OnBnClickedSelEndquestDel()
|
||||
{
|
||||
if (1 == m_ctrlCharFinishedQuestList.GetSelectedCount())
|
||||
{
|
||||
char szQID[16];
|
||||
int nIndex = m_ctrlCharFinishedQuestList.GetNextItem(-1, LVIS_SELECTED);
|
||||
m_ctrlCharFinishedQuestList.GetItemText(nIndex, 0, szQID, 16);
|
||||
|
||||
CPacketMgr::GetInstance()->SendDeleteHistoryQuest(m_dwDocKey,
|
||||
m_lpModifyCharacter->GetServerGroup(), m_lpModifyCharacter->GetCID(),
|
||||
(unsigned short)Math::Convert::StrToHex16(szQID));
|
||||
}
|
||||
else
|
||||
{
|
||||
Report(GetLocalString("MSG_0184"), CAUTION);
|
||||
}
|
||||
}
|
||||
|
||||
void CCharQuestPage::SortListWndItem(CListCtrl* lpListCtrl, const int iCol)
|
||||
{
|
||||
CListCtrlSortClass SortClass(lpListCtrl,iCol);
|
||||
|
||||
switch(m_iSortListItem)
|
||||
{
|
||||
case SORT_TYPE::QID:
|
||||
SortClass.Sort(m_bSortListAsc, CListCtrlSortClass::SortDataType::dtSTRINGNOCASE);
|
||||
break;
|
||||
case SORT_TYPE::TITLE:
|
||||
SortClass.Sort(m_bSortListAsc, CListCtrlSortClass::SortDataType::dtSTRINGNOCASE);
|
||||
break;
|
||||
case SORT_TYPE::PHASE:
|
||||
SortClass.Sort(m_bSortListAsc, CListCtrlSortClass::SortDataType::dtSTRING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CCharQuestPage::OnLvnColumnclickCharingquestlist(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
{
|
||||
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
|
||||
|
||||
if(pNMLV->iSubItem == m_iSortListItem)
|
||||
{
|
||||
m_bSortListAsc = !m_bSortListAsc;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_iSortListItem = pNMLV->iSubItem;
|
||||
m_bSortListAsc = true;
|
||||
}
|
||||
|
||||
SortListWndItem(&m_ctrlCharIngQuestList, m_iSortListItem);
|
||||
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CCharQuestPage::OnLvnColumnclickCharfinishedquestlist(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
{
|
||||
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
|
||||
|
||||
if(pNMLV->iSubItem == m_iSortListItem)
|
||||
{
|
||||
m_bSortListAsc = !m_bSortListAsc;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_iSortListItem = pNMLV->iSubItem;
|
||||
m_bSortListAsc = true;
|
||||
}
|
||||
|
||||
SortListWndItem(&m_ctrlCharFinishedQuestList, m_iSortListItem);
|
||||
|
||||
*pResult = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user