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:
2025-11-29 20:17:20 +09:00
parent 5d3cd64a25
commit dd97ddec92
11602 changed files with 1446576 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# 이곳에 변경사항을 기록합니다.
2004-04-23
존 이동 관련 로그를 추가하였습니다.
2004-05-21
리소스 언어 타입 한국어에서 중립언어로 설정.
2004-08-18
리밸런싱 대비해서 속성표시와 임시인벤토리 추가.
2004-09-15
아이템 상세 속성 보기에 시즌 레코드 추가.
2005-02-23
리스트 박스 클립보드로 저장할 수 있도록 수정.
셋업파일에 CLIPPING = 클립보드로 저장 추가.

View File

@@ -0,0 +1,296 @@
// CharacterInfoDlg.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "PrintLog.h"
#include "GAMELOGAnalyzer.h"
#include "CharacterInfoDlg.h"
#include "ItemInfoSheet.h"
#include "InfoDlg.h"
#include <BaseLibrary/Utility/Math/Math.h>
#include "GlobalFunctions.h"
// CCharacterInfoDlg 대화 상자입니다.
IMPLEMENT_DYNAMIC(CCharacterInfoDlg, CDialog)
CCharacterInfoDlg::CCharacterInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCharacterInfoDlg::IDD, pParent)
, m_LastPosX(_T(""))
, m_LastPosY(_T(""))
, m_LastPosZ(_T(""))
, m_SavePosX(_T(""))
, m_SavePosY(_T(""))
, m_SavePosZ(_T(""))
{
}
CCharacterInfoDlg::~CCharacterInfoDlg()
{
}
void CCharacterInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_CHARACTER_STATUS_LIST, m_CharacterStatus);
DDX_Text(pDX, IDC_LAST_POSX, m_LastPosX);
DDX_Text(pDX, IDC_LAST_POSY, m_LastPosY);
DDX_Text(pDX, IDC_LAST_POSZ, m_LastPosZ);
DDX_Text(pDX, IDC_SAVE_POSX, m_SavePosX);
DDX_Text(pDX, IDC_SAVE_POSY, m_SavePosY);
DDX_Text(pDX, IDC_SAVE_POSZ, m_SavePosZ);
}
BEGIN_MESSAGE_MAP(CCharacterInfoDlg, CDialog)
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_EXPORT_BUTTON, OnBnClickedItemInfo)
ON_BN_CLICKED(IDC_SHOW_QUICKSLOT, OnBnClickedShowQuickslot)
ON_BN_CLICKED(IDC_SHOW_SKILLSLOT, OnBnClickedShowSkillslot)
END_MESSAGE_MAP()
// CCharacterInfoDlg 메시지 처리기입니다.
void CCharacterInfoDlg::PostNcDestroy()
{
// TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
CDialog::PostNcDestroy();
delete this;
}
void CCharacterInfoDlg::OnClose()
{
// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
CDialog::OnClose();
DestroyWindow();
}
bool CCharacterInfoDlg::Initialize(const GAMELOG::sLogBase* lpLogBase)
{
using namespace GAMELOG;
m_dwCID = lpLogBase->m_dwCID;
m_dwUID = lpLogBase->m_dwUID;
m_time = lpLogBase->m_time;
switch(lpLogBase->m_cCmd)
{
case CMD::CHAR_LOGIN:
case CMD::CHAR_LOGOUT:
case CMD::CHAR_DBUPDATE:
{
const sCharLoginOut* pCharLoginOut = static_cast<const sCharLoginOut*>(lpLogBase);
std::copy(&pCharLoginOut->m_usDataSize[0],
&pCharLoginOut->m_usDataSize[DBUpdateData::MAX_UPDATE_DB],
m_usUpdateInfo);
size_t nSize = std::accumulate(&m_usUpdateInfo[0], &m_usUpdateInfo[DBUpdateData::MAX_UPDATE_DB], 0);
memcpy(m_szCharacterInfo, reinterpret_cast<const char*>(&pCharLoginOut[1]), nSize);
m_usDepositSize = pCharLoginOut->m_usDepositData;
memcpy(m_szDepositData, reinterpret_cast<const char*>(&pCharLoginOut[1]) + nSize, m_usDepositSize);
m_dwDepositMoney = pCharLoginOut->m_dwDepositMoney;
} break;
default: return false;
}
StatusUpdate();
PositionUpdate();
UpdateData(FALSE);
return true;
}
void CCharacterInfoDlg::StatusUpdate()
{
m_CharacterStatus.DeleteAllItems();
CHAR_INFOST* pCharInfoSt = reinterpret_cast<CHAR_INFOST*>(m_szCharacterInfo
+ std::accumulate(&m_usUpdateInfo[0], &m_usUpdateInfo[DBUpdateData::STATUS_UPDATE], 0));
struct tm* pTm = localtime(&m_time);
char szNameCIDTime[MAX_PATH];
_snprintf(szNameCIDTime, MAX_PATH - 1, "[ UID: %10u ][ %4d/%02d/%02d %02d:%02d:%02d ]",
m_dwUID, pTm->tm_year + 1900, pTm->tm_mon + 1, pTm->tm_mday,
pTm->tm_hour, pTm->tm_min, pTm->tm_sec);
szNameCIDTime[MAX_PATH - 1] = 0;
SetWindowText(szNameCIDTime);
char szExp[64];
Math::Convert::Hex64ToStr(szExp, pCharInfoSt->Exp);
const int MAX_ROW = 22;
const int MAX_BUFFER = 32;
static const char szCharInfoField[MAX_ROW][MAX_BUFFER] =
{
"CID", "Name", "Sex", "Hair", "Face", "Race", "Class", "Fame", "Mileage", "Guild",
"Party", "Level", "Gold", "IP", "STR", "DEX", "CON", "INT", "WIS", "HP", "MP", "EXP"
};
std::string szMoney = GetMoneyString(pCharInfoSt->Gold);
CString nValue[MAX_ROW];
nValue[0].Format("%d", pCharInfoSt->CID); nValue[1].Format("%s", pCharInfoSt->Name);
nValue[2].Format("%d", pCharInfoSt->Sex); nValue[3].Format("%d", pCharInfoSt->Hair);
nValue[4].Format("%d", pCharInfoSt->Face); nValue[5].Format("%d", pCharInfoSt->Race);
nValue[6].Format("%d", pCharInfoSt->Class); nValue[7].Format("%d", pCharInfoSt->Fame);
nValue[8].Format("%d", pCharInfoSt->Mileage); nValue[9].Format("0x%08X", pCharInfoSt->GID);
nValue[10].Format("%d", pCharInfoSt->PID); nValue[11].Format("%d", pCharInfoSt->Level);
nValue[12].Format("%s", szMoney.c_str()); nValue[13].Format("%d", pCharInfoSt->IP);
nValue[14].Format("%d", pCharInfoSt->STR); nValue[15].Format("%d", pCharInfoSt->DEX);
nValue[16].Format("%d", pCharInfoSt->CON); nValue[17].Format("%d", pCharInfoSt->INT);
nValue[18].Format("%d", pCharInfoSt->WIS); nValue[19].Format("%d", pCharInfoSt->HP);
nValue[20].Format("%d", pCharInfoSt->MP); nValue[21].Format("0x%s", szExp);
for(int nCount = 0; nCount < MAX_ROW; ++nCount)
{
m_CharacterStatus.InsertItem(nCount, szCharInfoField[nCount]);
m_CharacterStatus.SetItemText(nCount, 1, nValue[nCount]);
}
}
void CCharacterInfoDlg::PositionUpdate()
{
CHAR_POS* pCharPos = reinterpret_cast<CHAR_POS*>(m_szCharacterInfo
+ std::accumulate(&m_usUpdateInfo[0], &m_usUpdateInfo[DBUpdateData::POSITION_UPDATE], 0));
if(sizeof(CHAR_POS) != m_usUpdateInfo[DBUpdateData::POSITION_UPDATE])
{
return;
}
m_LastPosX.Format("%f", pCharPos->LastPoint.fPointX);
m_LastPosY.Format("%f", pCharPos->LastPoint.fPointY);
m_LastPosZ.Format("%f", pCharPos->LastPoint.fPointZ);
m_SavePosX.Format("%f", pCharPos->SavePoint.fPointX);
m_SavePosY.Format("%f", pCharPos->SavePoint.fPointY);
m_SavePosZ.Format("%f", pCharPos->SavePoint.fPointZ);
}
void CCharacterInfoDlg::OnBnClickedItemInfo()
{
CItemInfoSheet sheet(GetMyINIString("STRING_FOR_LOCALIZE", "CHAR_ITEM_INFO"));
sheet.Initialize(m_szCharacterInfo, m_usUpdateInfo, m_szDepositData, m_usDepositSize, m_dwDepositMoney);
sheet.DoModal();
}
void CCharacterInfoDlg::OnBnClickedShowQuickslot()
{
CString title(GetMyINIString("STRING_FOR_LOCALIZE", "QUICK_SLOT_INFO"));
CString quickSlot;
QUICK* pCharQuickSlot = reinterpret_cast<QUICK*>(m_szCharacterInfo
+ std::accumulate(&m_usUpdateInfo[0], &m_usUpdateInfo[DBUpdateData::QUICKSLOT_UPDATE], 0));
if(sizeof(QUICK) != m_usUpdateInfo[DBUpdateData::QUICKSLOT_UPDATE])
{
MessageBox(GetMyINIString("STRING_FOR_LOCALIZE", "ERR_003"));
return;
}
for(int nIndex = 0; nIndex < QUICK::MAX_QUICK_NUM; ++nIndex)
{
quickSlot.AppendFormat("[ SLOT %2d ] ", nIndex);
if(0 == pCharQuickSlot->Slots[nIndex].wID)
{
quickSlot.AppendFormat("EMPTY SLOT");
}
else
{
switch(pCharQuickSlot->Slots[nIndex].nType)
{
case QUICKSLOT::NONE:
quickSlot.AppendFormat("Unknown Type: ");
break;
case QUICKSLOT::ITEM:
quickSlot.AppendFormat("SkillType ID: %d", pCharQuickSlot->Slots[nIndex].wID);
break;
case QUICKSLOT::SKILL:
quickSlot.AppendFormat("SkillType ID: 0x%04x LockCount: %d Level: %d",
pCharQuickSlot->Slots[nIndex].wID,
pCharQuickSlot->Slots[nIndex].nSkillLockCount,
pCharQuickSlot->Slots[nIndex].nSkillLevel);
};
}
quickSlot.AppendFormat("\r\n");
}
CInfoDlg quickInfoDlg(title, quickSlot);
quickInfoDlg.DoModal();
}
void CCharacterInfoDlg::OnBnClickedShowSkillslot()
{
CString title(GetMyINIString("STRING_FOR_LOCALIZE", "SKILL_SLOT_INFO"));
CString skillSlot;
SKILL* pCharSKILLSlot = reinterpret_cast<SKILL*>(m_szCharacterInfo
+ std::accumulate(&m_usUpdateInfo[0], &m_usUpdateInfo[DBUpdateData::SKILL_UPDATE], 0));
if(sizeof(SKILL) != m_usUpdateInfo[DBUpdateData::SKILL_UPDATE])
{
MessageBox(GetMyINIString("STRING_FOR_LOCALIZE", "ERR_004"));
return;
}
for(int nIndex = 0; nIndex < SKILL::MAX_SLOT_NUM; ++nIndex)
{
skillSlot.AppendFormat("[ SLOT %2d ] ", nIndex);
if(0 == pCharSKILLSlot->SSlot[nIndex].SKILLINFO.wSkill)
{
skillSlot.AppendFormat("EMPTY SLOT");
}
else
{
skillSlot.AppendFormat("SkillType ID: 0x%04x LockCount: %d Level: %d",
pCharSKILLSlot->SSlot[nIndex].SKILLINFO.wSkill,
pCharSKILLSlot->SSlot[nIndex].SKILLINFO.cLockCount,
pCharSKILLSlot->SSlot[nIndex].SKILLINFO.cSkillLevel);
}
skillSlot.AppendFormat("\r\n");
}
CInfoDlg skillInfoDlg(title, skillSlot);
skillInfoDlg.DoModal();
}
BOOL CCharacterInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_CharacterStatus.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_FLATSB);
m_CharacterStatus.InsertColumn(0, GetMyINIString("STRING_FOR_LOCALIZE", "ITEM"), LVCFMT_LEFT, 50);
m_CharacterStatus.InsertColumn(1, GetMyINIString("STRING_FOR_LOCALIZE", "VALUE"), LVCFMT_LEFT, 140);
SetDlgItemText(IDC_CHARACTERINFO_GROUP, GetMyINIString("STRING_FOR_LOCALIZE", "CHAR_INFO"));
SetDlgItemText(IDC_EXPORT_BUTTON, GetMyINIString("STRING_FOR_LOCALIZE", "SHOW_ITEM_INFO"));
SetDlgItemText(IDC_SHOW_QUICKSLOT, GetMyINIString("STRING_FOR_LOCALIZE", "SHOW_QSLOT_INFO"));
SetDlgItemText(IDC_SHOW_SKILLSLOT, GetMyINIString("STRING_FOR_LOCALIZE", "SHOW_SKILLSLOT_INFO"));
return TRUE;
}

View File

@@ -0,0 +1,57 @@
#pragma once
#include "Resource.h"
#include <RylGameLibrary/Log/LogCommands.h>
#include "afxcmn.h"
// CCharacterInfoDlg 대화 상자입니다.
class CCharacterInfoDlg : public CDialog
{
DECLARE_DYNAMIC(CCharacterInfoDlg)
public:
CCharacterInfoDlg(CWnd* pParent = NULL); // 표준 생성자입니다.
virtual ~CCharacterInfoDlg();
// 대화 상자 데이터입니다.
enum { IDD = IDD_CHARACTERINFODLG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
virtual void PostNcDestroy();
DECLARE_MESSAGE_MAP()
CListCtrl m_CharacterStatus;
CString m_LastPosX;
CString m_LastPosY;
CString m_LastPosZ;
CString m_SavePosX;
CString m_SavePosY;
CString m_SavePosZ;
unsigned short m_usUpdateInfo[DBUpdateData::MAX_UPDATE_DB];
char m_szCharacterInfo[DBUpdateData::MAX_DBUPDATE_SIZE];
char m_szDepositData[DBUpdateData::MAX_DBUPDATE_SIZE * 2];
unsigned short m_usDepositSize;
unsigned long m_dwDepositMoney;
DWORD m_dwCID;
DWORD m_dwUID;
time_t m_time;
void StatusUpdate();
void PositionUpdate();
public:
bool Initialize(const GAMELOG::sLogBase* lpLogBase);
afx_msg void OnClose();
afx_msg void OnBnClickedItemInfo();
afx_msg void OnBnClickedShowQuickslot();
afx_msg void OnBnClickedShowSkillslot();
virtual BOOL OnInitDialog();
};

View File

@@ -0,0 +1,425 @@
// CheckComboBox.cpp
//
// Written by Magnus Egelberg (magnus.egelberg@lundalogik.se)
//
// Copyright (C) 1999, Lundalogik AB, Sweden. All rights reserved.
//
//
#include "stdafx.h"
//#include "CheckCombo.h"
#include "CheckComboBox.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
static WNDPROC m_pWndProc = 0;
static CCheckComboBox *m_pComboBox = 0;
BEGIN_MESSAGE_MAP(CCheckComboBox, CComboBox)
//{{AFX_MSG_MAP(CCheckComboBox)
ON_MESSAGE(WM_CTLCOLORLISTBOX, OnCtlColorListBox)
ON_MESSAGE(WM_GETTEXT, OnGetText)
ON_MESSAGE(WM_GETTEXTLENGTH, OnGetTextLength)
ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropDown)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//
// The subclassed COMBOLBOX message handler
//
extern "C" LRESULT FAR PASCAL ComboBoxListBoxProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
switch (nMsg) {
case WM_RBUTTONDOWN: {
// If you want to select all/unselect all using the
// right button, remove this ifdef. Personally, I don't really like it
#if FALSE
if (m_pComboBox != 0) {
INT nCount = m_pComboBox->GetCount();
INT nSelCount = 0;
for (INT i = 0; i < nCount; i++) {
if (m_pComboBox->GetCheck(i))
nSelCount++;
}
m_pComboBox->SelectAll(nSelCount != nCount);
// Make sure to invalidate this window as well
InvalidateRect(hWnd, 0, FALSE);
m_pComboBox->GetParent()->SendMessage(WM_COMMAND, MAKELONG(GetWindowLong(m_pComboBox->m_hWnd, GWL_ID), CBN_SELCHANGE), (LPARAM)m_pComboBox->m_hWnd);
}
#endif
break;
}
// Make the combobox always return -1 as the current selection. This
// causes the lpDrawItemStruct->itemID in DrawItem() to be -1
// when the always-visible-portion of the combo is drawn
case LB_GETCURSEL: {
return -1;
}
case WM_CHAR: {
if (wParam == VK_SPACE) {
// Get the current selection
INT nIndex = CallWindowProcA(m_pWndProc, hWnd, LB_GETCURSEL, wParam, lParam);
CRect rcItem;
SendMessage(hWnd, LB_GETITEMRECT, nIndex, (LONG)(VOID *)&rcItem);
InvalidateRect(hWnd, rcItem, FALSE);
// Invert the check mark
m_pComboBox->SetCheck(nIndex, !m_pComboBox->GetCheck(nIndex));
// Notify that selection has changed
m_pComboBox->GetParent()->SendMessage(WM_COMMAND, MAKELONG(GetWindowLong(m_pComboBox->m_hWnd, GWL_ID), CBN_SELCHANGE), (LPARAM)m_pComboBox->m_hWnd);
return 0;
}
break;
}
case WM_LBUTTONDOWN: {
CRect rcClient;
GetClientRect(hWnd, rcClient);
CPoint pt;
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
if (PtInRect(rcClient, pt)) {
INT nItemHeight = SendMessage(hWnd, LB_GETITEMHEIGHT, 0, 0);
INT nTopIndex = SendMessage(hWnd, LB_GETTOPINDEX, 0, 0);
// Compute which index to check/uncheck
INT nIndex = nTopIndex + pt.y / nItemHeight;
CRect rcItem;
SendMessage(hWnd, LB_GETITEMRECT, nIndex, (LONG)(VOID *)&rcItem);
if (PtInRect(rcItem, pt)) {
// Invalidate this window
InvalidateRect(hWnd, rcItem, FALSE);
m_pComboBox->SetCheck(nIndex, !m_pComboBox->GetCheck(nIndex));
// Notify that selection has changed
m_pComboBox->GetParent()->SendMessage(WM_COMMAND, MAKELONG(GetWindowLong(m_pComboBox->m_hWnd, GWL_ID), CBN_SELCHANGE), (LPARAM)m_pComboBox->m_hWnd);
}
}
// Do the default handling now (such as close the popup
// window when clicked outside)
break;
}
case WM_LBUTTONUP: {
// Don't do anything here. This causes the combobox popup
// windows to remain open after a selection has been made
return 0;
}
}
return CallWindowProc(m_pWndProc, hWnd, nMsg, wParam, lParam);
}
CCheckComboBox::CCheckComboBox()
{
m_hListBox = 0;
m_bTextUpdated = FALSE;
m_bItemHeightSet = FALSE;
}
CCheckComboBox::~CCheckComboBox()
{
}
BOOL CCheckComboBox::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
{
// Remove the CBS_SIMPLE and CBS_DROPDOWN styles and add the one I'm designed for
dwStyle &= ~0xF;
dwStyle |= CBS_DROPDOWNLIST;
// Make sure to use the CBS_OWNERDRAWVARIABLE style
dwStyle |= CBS_OWNERDRAWVARIABLE;
// Use default strings. We need the itemdata to store checkmarks
dwStyle |= CBS_HASSTRINGS;
return CComboBox::Create(dwStyle, rect, pParentWnd, nID);
}
LRESULT CCheckComboBox::OnCtlColorListBox(WPARAM wParam, LPARAM lParam)
{
// If the listbox hasn't been subclassed yet, do so...
if (m_hListBox == 0) {
HWND hWnd = (HWND)lParam;
if (hWnd != 0 && hWnd != m_hWnd) {
// Save the listbox handle
m_hListBox = hWnd;
// Do the subclassing
m_pWndProc = (WNDPROC)GetWindowLong(m_hListBox, GWL_WNDPROC);
SetWindowLong(m_hListBox, GWL_WNDPROC, (LONG)ComboBoxListBoxProc);
}
}
return DefWindowProc(WM_CTLCOLORLISTBOX, wParam, lParam);
}
void CCheckComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
HDC dc = lpDrawItemStruct->hDC;
CRect rcBitmap = lpDrawItemStruct->rcItem;
CRect rcText = lpDrawItemStruct->rcItem;
CString strText;
// 0 - No check, 1 - Empty check, 2 - Checked
INT nCheck = 0;
// Check if we are drawing the static portion of the combobox
if ((LONG)lpDrawItemStruct->itemID < 0) {
// Make sure the m_strText member is updated
RecalcText();
// Get the text
strText = m_strText;
// Don't draw any boxes on this item
nCheck = 0;
}
// Otherwise it is one of the items
else {
GetLBText(lpDrawItemStruct->itemID, strText);
nCheck = 1 + (GetItemData(lpDrawItemStruct->itemID) != 0);
TEXTMETRIC metrics;
GetTextMetrics(dc, &metrics);
rcBitmap.left = 0;
rcBitmap.right = rcBitmap.left + metrics.tmHeight + metrics.tmExternalLeading + 6;
rcBitmap.top += 1;
rcBitmap.bottom -= 1;
rcText.left = rcBitmap.right;
}
if (nCheck > 0) {
SetBkColor(dc, GetSysColor(COLOR_WINDOW));
SetTextColor(dc, GetSysColor(COLOR_WINDOWTEXT));
UINT nState = DFCS_BUTTONCHECK;
if (nCheck > 1)
nState |= DFCS_CHECKED;
// Draw the checkmark using DrawFrameControl
DrawFrameControl(dc, rcBitmap, DFC_BUTTON, nState);
}
if (lpDrawItemStruct->itemState & ODS_SELECTED) {
SetBkColor(dc, GetSysColor(COLOR_HIGHLIGHT));
SetTextColor(dc, GetSysColor(COLOR_HIGHLIGHTTEXT));
}
else {
SetBkColor(dc, GetSysColor(COLOR_WINDOW));
SetTextColor(dc, GetSysColor(COLOR_WINDOWTEXT));
}
// Erase and draw
ExtTextOut(dc, 0, 0, ETO_OPAQUE, &rcText, 0, 0, 0);
DrawText(dc, ' ' + strText, strText.GetLength() + 1, &rcText, DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS);
if ((lpDrawItemStruct->itemState & (ODS_FOCUS|ODS_SELECTED)) == (ODS_FOCUS|ODS_SELECTED))
DrawFocusRect(dc, &rcText);
}
void CCheckComboBox::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
CClientDC dc(this);
CFont *pFont = dc.SelectObject(GetFont());
if (pFont != 0) {
TEXTMETRIC metrics;
dc.GetTextMetrics(&metrics);
lpMeasureItemStruct->itemHeight = metrics.tmHeight + metrics.tmExternalLeading;
// An extra height of 2 looks good I think.
// Otherwise the list looks a bit crowded...
lpMeasureItemStruct->itemHeight += 2;
// This is needed since the WM_MEASUREITEM message is sent before
// MFC hooks everything up if used in i dialog. So adjust the
// static portion of the combo box now
if (!m_bItemHeightSet) {
m_bItemHeightSet = TRUE;
SetItemHeight(-1, lpMeasureItemStruct->itemHeight);
}
dc.SelectObject(pFont);
}
}
//
// Make sure the combobox window handle is updated since
// there may be many CCheckComboBox windows active
//
void CCheckComboBox::OnDropDown()
{
m_pComboBox = this;
}
//
// Selects/unselects all items in the list
//
void CCheckComboBox::SelectAll(BOOL bCheck)
{
INT nCount = GetCount();
for (INT i = 0; i < nCount; i++)
SetCheck(i, bCheck);
}
//
// By adding this message handler, we may use CWnd::GetText()
//
LRESULT CCheckComboBox::OnGetText(WPARAM wParam, LPARAM lParam)
{
// Make sure the text is updated
RecalcText();
if (lParam == 0)
return 0;
// Copy the 'fake' window text
lstrcpyn((LPSTR)lParam, m_strText, (INT)wParam);
return m_strText.GetLength();
}
//
// By adding this message handler, we may use CWnd::GetTextLength()
//
LRESULT CCheckComboBox::OnGetTextLength(WPARAM, LPARAM)
{
// Make sure the text is updated
RecalcText();
return m_strText.GetLength();
}
//
// This routine steps thru all the items and builds
// a string containing the checked items
//
void CCheckComboBox::RecalcText()
{
if (!m_bTextUpdated) {
CString strText;
// Get the list count
INT nCount = GetCount();
// Get the list separator
TCHAR szBuffer[10] = {0};
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, szBuffer, sizeof(szBuffer));
CString strSeparator = szBuffer;
// If none found, the the ';'
if (strSeparator.GetLength() == 0)
strSeparator = ';';
// Trim extra spaces
strSeparator.TrimRight();
// And one...
strSeparator += ' ';
for (INT i = 0; i < nCount; i++) {
if (GetItemData(i)) {
CString strItem;
GetLBText(i, strItem);
if (!strText.IsEmpty())
strText += strSeparator;
strText += strItem;
}
}
// Set the text
m_strText = strText;
m_bTextUpdated = TRUE;
}
}
INT CCheckComboBox::SetCheck(INT nIndex, BOOL bFlag)
{
INT nResult = SetItemData(nIndex, bFlag);
if (nResult < 0)
return nResult;
// Signal that the text need updating
m_bTextUpdated = FALSE;
// Redraw the window
Invalidate(FALSE);
return nResult;
}
BOOL CCheckComboBox::GetCheck(INT nIndex)
{
return GetItemData(nIndex);
}

View File

@@ -0,0 +1,63 @@
#if !defined(AFX_CHECKCOMBOBOX_H__66750D93_95DB_11D3_9325_444553540000__INCLUDED_)
#define AFX_CHECKCOMBOBOX_H__66750D93_95DB_11D3_9325_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CCheckComboBox : public CComboBox
{
public:
CCheckComboBox();
virtual ~CCheckComboBox();
BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
// Selects all/unselects the specified item
INT SetCheck(INT nIndex, BOOL bFlag);
// Returns checked state
BOOL GetCheck(INT nIndex);
// Selects all/unselects all
void SelectAll(BOOL bCheck = TRUE);
protected:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCheckComboBox)
protected:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
//}}AFX_VIRTUAL
//{{AFX_MSG(CCheckComboBox)
afx_msg LRESULT OnCtlColorListBox(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnGetTextLength(WPARAM wParam, LPARAM lParam);
afx_msg void OnDropDown();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
protected:
// Routine to update the text
void RecalcText();
// The subclassed COMBOLBOX window (notice the 'L')
HWND m_hListBox;
// The string containing the text to display
CString m_strText;
BOOL m_bTextUpdated;
// A flag used in MeasureItem, see comments there
BOOL m_bItemHeightSet;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHECKCOMBOBOX_H__66750D93_95DB_11D3_9325_444553540000__INCLUDED_)

View File

@@ -0,0 +1,253 @@
// CClipboard Class
// ----------------
// Written by David Terracino <davet@lycosemail.com>
//
// This code is released into the public domain, because
// it's silly easy. If you want to use and expand it, go
// ahead; fine by me. If you do expand this class's
// functionality, please consider sending it back up to
// the MFC Programmer's Sourcebook at www.codeguru.com.
//
// And as always, please give credit where credit is
// due. Don't remove my name from the source.
///////////////////////////////////////////////////////////////////////////////
// Modified by Hans Dietrich hdietrich2@hotmail.com
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Clipboard.h"
///////////////////////////////////////////////////////////////////////////////
// GetText - Retrieves text from the clipboard
///////////////////////////////////////////////////////////////////////////////
//
// Parameters:
//
// Return Values:
// CString - not empty if text was successfully copied from clipboard
//
///////////////////////////////////////////////////////////////////////////////
CString CClipboard::GetText()
{
CString str;
str = _T("");
// First, open the clipboard. OpenClipboard() takes one
// parameter, the handle of the window that will temporarily
// be it's owner. If NULL is passed, the current process
// is assumed.
if (::OpenClipboard(NULL))
{
// Request a pointer to the text on the clipboard.
HGLOBAL hGlobal = ::GetClipboardData(CF_TEXT);
// If there was no text on the clipboard, we have
// been returned a NULL handle.
if (hGlobal)
{
// Now we have a global memory handle to the text
// stored on the clipboard. We have to lock this global
// handle so that we have access to it.
LPSTR lpszData = (LPSTR) ::GlobalLock(hGlobal);
if (lpszData)
{
str = lpszData;
// Now, simply unlock the global memory pointer
// and close the clipboard.
::GlobalUnlock(hGlobal);
}
}
::CloseClipboard();
}
return str;
}
///////////////////////////////////////////////////////////////////////////////
// GetText - Retrieves text from the clipboard
///////////////////////////////////////////////////////////////////////////////
//
// Parameters:
// lpszBuffer - pointer to a string where the text is to be put
// nBufSize - allocated length of lpszBuffer
//
// Return Values:
// TRUE - Text was successfully retrieved
// FALSE - No text returned
//
///////////////////////////////////////////////////////////////////////////////
BOOL CClipboard::GetText(LPSTR lpszBuffer, int nBufSize)
{
ASSERT(lpszBuffer);
if (lpszBuffer == NULL)
return FALSE;
if (nBufSize == 0)
return FALSE;
lpszBuffer[0] = 0;
BOOL bSuccess = FALSE;
// First, open the clipboard. OpenClipboard() takes one
// parameter, the handle of the window that will temporarily
// be it's owner. If NULL is passed, the current process
// is assumed.
if (::OpenClipboard(NULL))
{
// Request a pointer to the text on the clipboard.
HGLOBAL hGlobal = ::GetClipboardData(CF_TEXT);
// If there was no text on the clipboard, we have
// been returned a NULL handle.
if (hGlobal)
{
// Now we have a global memory handle to the text
// stored on the clipboard. We have to lock this global
// handle so that we have access to it.
LPSTR lpszData = (LPSTR) ::GlobalLock(hGlobal);
if (lpszData)
{
// Now get the size of the text on the clipboard.
DWORD nSize = ::GlobalSize(hGlobal);
// Make sure the text on the clipboard is not longer
// that the buffer that was allocated for it. If it was
// snip the text on the clipboard so that it fits.
if (nSize >= (UINT)nBufSize)
nSize = nBufSize - 1;
// Now, copy the text into the return buffer. Note that
// there will be at least one nul at the end
ZeroMemory(lpszBuffer, nBufSize);
CopyMemory(lpszBuffer, lpszData, nSize);
// Now, simply unlock the global memory pointer
// and close the clipboard.
::GlobalUnlock(hGlobal);
bSuccess = TRUE;
}
}
::CloseClipboard();
}
return bSuccess;
}
///////////////////////////////////////////////////////////////////////////////
// GetTextLength - Retrieves length of text on the clipboard
///////////////////////////////////////////////////////////////////////////////
//
// Parameters:
//
// Return Values:
// > 0 - Text length was successfully returned.
// 0 - No text on the clipboard
//
///////////////////////////////////////////////////////////////////////////////
DWORD CClipboard::GetTextLength()
{
DWORD nSize = 0; // Size of clipboard data
// First, open the clipboard. OpenClipboard() takes one
// parameter, the handle of the window that will temporarily
// be it's owner. If NULL is passed, the current process
// is assumed.
if (::OpenClipboard(NULL))
{
// Request a pointer to the text on the clipboard.
HGLOBAL hGlobal = ::GetClipboardData(CF_TEXT);
// If there was no text on the clipboard, we have
// been returned a NULL handle.
if (hGlobal)
{
// Now we have a global memory handle to the text
// stored on the clipboard. We have to lock this global
// handle so that we have access to it.
LPSTR lpszData = (LPSTR) ::GlobalLock(hGlobal);
if (lpszData)
{
// Now get the size of the text on the clipboard.
nSize = ::GlobalSize(hGlobal);
// Now, simply unlock the global memory pointer
// and close the clipboard.
::GlobalUnlock(hGlobal);
}
}
::CloseClipboard();
}
return nSize;
}
///////////////////////////////////////////////////////////////////////////////
// SetText - Places text on the clipboard
///////////////////////////////////////////////////////////////////////////////
//
// Parameters:
// lpszBuffer - pointer to a string to put on the clipboard
//
// Return Values:
// TRUE - Text was successfully copied onto clipboard
// FALSE - Text not copied
//
///////////////////////////////////////////////////////////////////////////////
BOOL CClipboard::SetText(LPCTSTR lpszBuffer)
{
BOOL bSuccess = FALSE;
// First, open the clipboard. OpenClipboard() takes one
// parameter, the handle of the window that will temporarily
// be it's owner. If NULL is passed, the current process
// is assumed. After opening, empty the clipboard so we
// can put our text on it.
if (::OpenClipboard(NULL))
{
::EmptyClipboard();
// Get the size of the string in the buffer that was
// passed into the function, so we know how much global
// memory to allocate for the string.
int nSize = lstrlen(lpszBuffer);
// Allocate the memory for the string.
HGLOBAL hGlobal = ::GlobalAlloc(GMEM_ZEROINIT, nSize+1);
// If we got any error during the memory allocation,
// we have been returned a NULL handle.
if (hGlobal)
{
// Now we have a global memory handle to the text
// stored on the clipboard. We have to lock this global
// handle so that we have access to it.
LPSTR lpszData = (LPSTR) ::GlobalLock(hGlobal);
if (lpszData)
{
// Now, copy the text from the buffer into the allocated
// global memory pointer
lstrcpy(lpszData, lpszBuffer);
// Now, simply unlock the global memory pointer,
// set the clipboard data type and pointer,
// and close the clipboard.
::GlobalUnlock(hGlobal);
::SetClipboardData(CF_TEXT, hGlobal);
bSuccess = TRUE;
}
}
::CloseClipboard();
}
return bSuccess;
}

View File

@@ -0,0 +1,29 @@
// CClipboard Class
// ----------------
// Written by David Terracino <davet@lycosemail.com>
//
// This code is released into the public domain, because
// it's silly easy. If you want to use and expand it, go
// ahead; fine by me. If you do expand this class's
// functionality, please consider sending it back up to
// the MFC Programmer's Sourcebook at www.codeguru.com.
//
// And as always, please give credit where credit is
// due. Don't remove my name from the source.
///////////////////////////////////////////////////////////////////////////////
// Modified by Hans Dietrich hdietrich2@hotmail.com
///////////////////////////////////////////////////////////////////////////////
#ifndef CCLIPBOARD_H
#define CCLIPBOARD_H
class CClipboard
{
public:
static CString GetText();
static BOOL GetText(LPSTR lpszBuffer, int nBufSize);
static DWORD GetTextLength();
static BOOL SetText(LPCTSTR lpszBuffer);
};
#endif

View File

@@ -0,0 +1,315 @@
// ColorPickerCB.cpp
//
// http://www.codeguru.com/combobox//combo_color_picker3.shtml
//
// (c) 1998 James R. Twine
//
// Based On Code That Was Found On www.codeguru.com, And Was
// ?1997 Baldvin Hansson
//
///////////////////////////////////////////////////////////////////////////////
// Modified by Hans Dietrich hdietrich2@hotmail.com
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ColorPickerCB.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// NOTE - following table must be kept in sync with XListBox.cpp
SColorAndName CColorPickerCB::ms_pColors[CCB_MAX_COLORS] =
{
SColorAndName( RGB( 0x00, 0x00, 0x00 ), "Black" ),
SColorAndName( RGB( 0xFF, 0xFF, 0xFF ), "White" ),
SColorAndName( RGB( 0x80, 0x00, 0x00 ), "Maroon" ),
SColorAndName( RGB( 0x00, 0x80, 0x00 ), "Green" ),
SColorAndName( RGB( 0x80, 0x80, 0x00 ), "Olive" ),
SColorAndName( RGB( 0x00, 0x00, 0x80 ), "Navy" ),
SColorAndName( RGB( 0x80, 0x00, 0x80 ), "Purple" ),
SColorAndName( RGB( 0x00, 0x80, 0x80 ), "Teal" ),
SColorAndName( RGB( 0xC0, 0xC0, 0xC0 ), "Silver" ),
SColorAndName( RGB( 0x80, 0x80, 0x80 ), "Gray" ),
SColorAndName( RGB( 0xFF, 0x00, 0x00 ), "Red" ),
SColorAndName( RGB( 0x00, 0xFF, 0x00 ), "Lime" ),
SColorAndName( RGB( 0xFF, 0xFF, 0x00 ), "Yellow" ),
SColorAndName( RGB( 0x00, 0x00, 0xFF ), "Blue" ),
SColorAndName( RGB( 0xFF, 0x00, 0xFF ), "Fuchsia" ),
SColorAndName( RGB( 0x00, 0xFF, 0xFF ), "Aqua" )
};
CColorPickerCB::CColorPickerCB()
{
}
CColorPickerCB::~CColorPickerCB()
{
}
BEGIN_MESSAGE_MAP(CColorPickerCB, CComboBox)
//{{AFX_MSG_MAP(CColorPickerCB)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CColorPickerCB message handlers
int CColorPickerCB::OnCreate(LPCREATESTRUCT pCStruct)
{
if (CComboBox::OnCreate(pCStruct) == -1) // If Create Failed
return -1; // Return Failure
Initialize(); // Initialize Contents
SetCurSel(0); // Select First Item By Default
return 0; // Done!
}
void CColorPickerCB::PreSubclassWindow()
{
Initialize(); // Initialize Contents
CComboBox::PreSubclassWindow(); // Subclass Control
SetCurSel(0); // Select First Item By Default
}
void CColorPickerCB::Initialize()
{
int iAddedItem = -1;
ResetContent();
for (int iColor = 0; iColor < CCB_MAX_COLORS; iColor++) // For All Colors
{
iAddedItem = AddString( ms_pColors[iColor].m_cColor); // Set Color Name/Text
if (iAddedItem == CB_ERRSPACE) // If Not Added
break; // Stop
else // If Added Successfully
SetItemData(iAddedItem, ms_pColors[iColor].m_crColor); // Set Color RGB Value
}
}
void CColorPickerCB::DrawItem(LPDRAWITEMSTRUCT pDIStruct)
{
CDC dcContext;
CRect rItemRect(pDIStruct -> rcItem);
CRect rBlockRect(rItemRect);
CRect rTextRect(rBlockRect);
int iColorWidth = (rBlockRect.Width() * 5)/ 12;
int iItem = pDIStruct -> itemID;
int iState = pDIStruct -> itemState;
CBrush brFrameBrush;
COLORREF crColor = 0;
COLORREF crNormal = GetSysColor(COLOR_WINDOW);
COLORREF crSelected = GetSysColor(COLOR_HIGHLIGHT);
COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);
if (!dcContext.Attach(pDIStruct -> hDC)) // Attach CDC Object
return; // Stop If Attach Failed
brFrameBrush.CreateStockObject(BLACK_BRUSH); // Create Black Brush
if (iState & ODS_SELECTED) // If Selected
{ // Set Selected Attributes
dcContext.SetTextColor((0x00FFFFFF & ~(crText))); // Set Inverted Text Color (With Mask)
dcContext.SetBkColor(crSelected); // Set BG To Highlight Color
dcContext.FillSolidRect(&rBlockRect, crSelected); // Erase Item
}
else // If Not Selected
{ // Set Standard Attributes
dcContext.SetTextColor(crText); // Set Text Color
dcContext.SetBkColor(crNormal); // Set BG Color
dcContext.FillSolidRect(&rBlockRect, crNormal); // Erase Item
}
if (iState & ODS_FOCUS) // If Item Has The Focus
dcContext.DrawFocusRect(&rItemRect); // Draw Focus Rect
//
// Calculate Text Area
//
rTextRect.left += iColorWidth + 2; // Set Start Of Text
rTextRect.top += 2; // Offset A Bit
//
// Calculate Color Block Area
//
rBlockRect.DeflateRect(CSize(2, 2)); // Reduce Color Block Size
rBlockRect.right = iColorWidth; // Set Width Of Color Block
//
// Draw Color Text And Block
//
if (iItem != -1) // If Not An Empty Item
{
CString sColor;
GetLBText(iItem, sColor); // Get Color Text
if (iState & ODS_DISABLED) // If Disabled
{
crColor = GetSysColor(COLOR_INACTIVECAPTIONTEXT);
dcContext.SetTextColor(crColor); // Set Text Color
}
else // If Normal
crColor = GetItemData(iItem); // Get Color Value
dcContext.SetBkMode(TRANSPARENT); // Transparent Background
dcContext.TextOut(rTextRect.left, rTextRect.top, sColor); // Draw Color Name
dcContext.FillSolidRect(&rBlockRect, crColor); // Draw Color
dcContext.FrameRect(&rBlockRect, &brFrameBrush); // Draw Frame
}
dcContext.Detach(); // Detach DC From Object
}
COLORREF CColorPickerCB::GetSelectedColorValue()
{
int iSelectedItem = GetCurSel(); // Get Selected Item
if (iSelectedItem == CB_ERR) // If Nothing Selected
return (RGB(0, 0, 0)); // Return Black
return (GetItemData(iSelectedItem)); // Return Selected Color
}
UINT CColorPickerCB::GetSelectedColorIndex()
{
UINT nSelectedItem = GetCurSel(); // Get Selected Item
if (nSelectedItem == CB_ERR) // If Nothing Selected
return 0;
else
return nSelectedItem;
}
CString CColorPickerCB::GetSelectedColorName()
{
int iSelectedItem = GetCurSel(); // Get Selected Item
if (iSelectedItem == CB_ERR) // If Nothing Selected
return (m_sColorName = "afxEmptyString"); // Return Nothing (Not "Black!")
GetLBText(iSelectedItem, m_sColorName); // Store Name Of Color
return m_sColorName; // Return Selected Color Name
}
void CColorPickerCB::SetSelectedColorValue(COLORREF crClr)
{
int iItems = GetCount();
for (int iItem = 0; iItem < iItems; iItem++)
{
if (crClr == GetItemData(iItem)) // If Match Found
SetCurSel(iItem); // Select It
}
}
void CColorPickerCB::SetSelectedColorIndex(UINT nIndex)
{
ASSERT(nIndex >= 0 && nIndex <= 15);
SetCurSel(nIndex);
}
void CColorPickerCB::SetSelectedColorName(LPCTSTR cpColor)
{
int iItems = GetCount();
CString sColorName;
for (int iItem = 0; iItem < iItems; iItem++)
{
GetLBText(iItem, sColorName); // Get Color Name
if (!sColorName.CompareNoCase(cpColor)) // If Match Found
SetCurSel(iItem); // Select It
}
}
BOOL CColorPickerCB::RemoveColor(LPCTSTR cpColor)
{
int iItems = GetCount();
CString sColor;
BOOL bRemoved = FALSE;
for (int iItem = 0; iItem < iItems; iItem++)
{
GetLBText(iItem, sColor); // Get Color Name
if (!sColor.CompareNoCase(cpColor)) // If Match Found
{
DeleteString(iItem); // Remove It
bRemoved = TRUE; // Set Flag
break; // Stop Checking
}
}
return bRemoved; // Done!
}
BOOL CColorPickerCB::RemoveColor(COLORREF crClr)
{
int iItems = GetCount();
BOOL bRemoved = FALSE;
for (int iItem = 0; iItem < iItems; iItem++)
{
if (crClr == GetItemData(iItem)) // If Desired Color Found
{
DeleteString(iItem); // Remove It
bRemoved = TRUE; // Set Flag
break; // Stop Checking
}
}
return bRemoved; // Done!
}
int CColorPickerCB::AddColor(LPCTSTR cpName, COLORREF crColor)
{
int iItem = -1;
iItem = InsertString(-1, cpName); // Insert String
if (iItem != LB_ERR) // If Insert Good
SetItemData(iItem, crColor); // Set Color Value
return iItem; // Done! Return Location
}
void DDX_ColorPicker(CDataExchange* pDX, int nIDC_, COLORREF& crColor)
{
HWND hWndCtrl = pDX->PrepareCtrl(nIDC_);
ASSERT(hWndCtrl);
CColorPickerCB* pPicker = (CColorPickerCB*) CWnd::FromHandle(hWndCtrl);
ASSERT(pPicker);
if (!pDX->m_bSaveAndValidate)
{
pPicker->SetSelectedColorValue(crColor);
}
else
{
crColor = pPicker->GetSelectedColorValue();
}
}
void DDX_ColorPicker(CDataExchange* pDX, int nIDC_, CString& strName)
{
HWND hWndCtrl = pDX->PrepareCtrl(nIDC_);
ASSERT(hWndCtrl);
CColorPickerCB* pPicker = (CColorPickerCB*) CWnd::FromHandle(hWndCtrl);
ASSERT(pPicker);
if (!pDX->m_bSaveAndValidate)
{
pPicker->SetSelectedColorName(strName);
}
else
{
strName = pPicker->GetSelectedColorName();
}
}

View File

@@ -0,0 +1,99 @@
// ColorPickerCB.h
//
// http://www.codeguru.com/combobox//combo_color_picker3.shtml
//
// (c) 1998 James R. Twine
//
// Based On Code That Was Found On www.codeguru.com, And Was
// © 1997 Baldvin Hansson
//
///////////////////////////////////////////////////////////////////////////////
// Modified by Hans Dietrich hdietrich2@hotmail.com
///////////////////////////////////////////////////////////////////////////////
#ifndef COLORPICKERCB_H
#define COLORPICKERCB_H
#define CCB_MAX_COLORS 16 // Colors In List
#define CCB_MAX_COLOR_NAME 16 // Max Chars For Color Name - 1
//
// Internal Structure For Color/Name Storage...
//
struct SColorAndName
{
SColorAndName()
{
ZeroMemory(this, sizeof(SColorAndName)); // Init Structure
};
SColorAndName(COLORREF crColor, LPCTSTR cpColor)
{
ZeroMemory(this, sizeof(SColorAndName)); // Init Structure
m_crColor = crColor; // Set Color RGB Value
strncpy(m_cColor, cpColor, CCB_MAX_COLOR_NAME); // Set Color Name
};
COLORREF m_crColor; // Actual Color RGB Value
char m_cColor[CCB_MAX_COLOR_NAME]; // Actual Name For Color
};
// Gets/sets color value from/to COLORREF member variable
void DDX_ColorPicker(CDataExchange* pDX_, int nIDC_, COLORREF& crColor_);
// Gets/sets color name from/to CString member variable
void DDX_ColorPicker(CDataExchange* pDX_, int nIDC_, CString& strName_);
class CColorPickerCB : public CComboBox
{
// Construction
public:
CColorPickerCB();
virtual ~CColorPickerCB();
// Attributes
private:
CString m_sColorName; // Name Of Selected Color
private:
void Initialize(void); // Initialize Control/Colors
public:
static
SColorAndName ms_pColors[CCB_MAX_COLORS]; // Array Of Colors And Names
COLORREF GetSelectedColorValue(void); // Get Selected Color Value
UINT GetSelectedColorIndex(void); // Get Selected Color Index
CString GetSelectedColorName( void ); // Get Selected Color Name
void SetSelectedColorValue(COLORREF crClr); // Set Selected Color Value
void SetSelectedColorIndex(UINT nIndex); // Set Selected Color Index
void SetSelectedColorName(LPCTSTR cpColor); // Set Selected Color Name
BOOL RemoveColor(LPCTSTR cpColor); // Remove Color From List
BOOL RemoveColor(COLORREF crClr); // Remove Color From List
int AddColor(LPCTSTR cpNam, COLORREF crClr); // Insert A New Color
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColorPickerCB)
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
// Implementation
public:
// Generated message map functions
protected:
//{{AFX_MSG(CColorPickerCB)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif //COLORPICKERCB_H

View File

@@ -0,0 +1,78 @@
// GameLogAnalyzer.cpp : 응용 프로그램에 대한 클래스 동작을 정의합니다.
//
#include "stdafx.h"
#include "GameLogAnalyzer.h"
#include "GameLogAnalyzerDlg.h"
#include <Item/ItemMgr.h>
#include <Log/ServerLog.h>
#include "GlobalFunctions.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CGameLogAnalyzerApp
BEGIN_MESSAGE_MAP(CGameLogAnalyzerApp, CWinApp)
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
// CGameLogAnalyzerApp 생성
CGameLogAnalyzerApp::CGameLogAnalyzerApp()
{
// TODO: 여기에 생성 코드를 추가합니다.
// InitInstance에 모든 중요한 초기화 작업을 배치합니다.
}
// 유일한 CGameLogAnalyzerApp 개체입니다.
CGameLogAnalyzerApp theApp;
// CGameLogAnalyzerApp 초기화
BOOL CGameLogAnalyzerApp::InitInstance()
{
// 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을
// 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControls()가 필요합니다.
// InitCommonControls()를 사용하지 않으면 창을 만들 수 없습니다.
InitCommonControls();
CWinApp::InitInstance();
AfxEnableControlContainer();
g_Log.Disable(0xFFFFFFFF);
g_SessionLog.Disable(0xFFFFFFFF);
if(!Item::CItemMgr::GetInstance().LoadItemProtoType("./Script/Game/ItemScript.txt"))
{
MessageBox(NULL, GetMyINIString("STRING_FOR_LOCALIZE", "ERR_001"), NULL, NULL);
return FALSE;
}
CGameLogAnalyzerDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if(nResponse == IDOK)
{
// TODO: 여기에 대화 상자가 확인을 눌러 없어지는 경우 처리할
// 코드를 배치합니다.
}
else if(nResponse == IDCANCEL)
{
// TODO: 여기에 대화 상자가 취소를 눌러 없어지는 경우 처리할
// 코드를 배치합니다.
}
// 대화 상자가 닫혔으므로 응용 프로그램의 메시지 펌프를 시작하지 않고
// 응용 프로그램을 끝낼 수 있도록 FALSE를 반환합니다.
return FALSE;
}

View File

@@ -0,0 +1,31 @@
// GameLogAnalyzer.h : PROJECT_NAME 응용 프로그램에 대한 주 헤더 파일입니다.
//
#pragma once
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // 주 기호
// CGameLogAnalyzerApp:
// 이 클래스의 구현에 대해서는 GameLogAnalyzer.cpp을 참조하십시오.
//
class CGameLogAnalyzerApp : public CWinApp
{
public:
CGameLogAnalyzerApp();
// 재정의
public:
virtual BOOL InitInstance();
// 구현
DECLARE_MESSAGE_MAP()
};
extern CGameLogAnalyzerApp theApp;

View File

@@ -0,0 +1,394 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// 중립 resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
#ifdef _WIN32
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(949)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOGEX 0, 0, 210, 55
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "GameLogAnalyzer Info"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
ICON 128,IDC_STATIC,15,14,20,20
LTEXT "GameLogAnalyzer Version 2160.01",IDC_STATIC,42,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (c) 2002",IDC_STATIC,42,25,119,8
DEFPUSHBUTTON "OK",IDOK,153,36,50,12,WS_GROUP
END
IDD_GAMELOGANALYZER_DIALOG DIALOGEX 0, 0, 768, 559
STYLE DS_SETFONT | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE |
WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "GameLogAnalyzer"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
PUSHBUTTON "",IDC_READ_FILE_SELECT_BUTTON,669,7,95,15,BS_FLAT
CONTROL "",IDC_DATETIMEPICKER2,"SysDateTimePick32",
DTS_RIGHTALIGN | DTS_UPDOWN | DTS_APPCANPARSE |
WS_TABSTOP,65,42,128,14,WS_EX_RIGHT
CONTROL "",IDC_DATETIMEPICKER3,"SysDateTimePick32",
DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP,65,59,128,14,
WS_EX_RIGHT
PUSHBUTTON "",IDC_BUTTON3,57,76,65,14,BS_FLAT
PUSHBUTTON "",IDC_BUTTON2,126,76,65,14,BS_FLAT
EDITTEXT IDC_EDIT2,218,42,36,14,ES_CENTER | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT3,218,58,36,14,ES_CENTER | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT4,218,72,36,14,ES_CENTER | ES_AUTOHSCROLL
EDITTEXT IDC_EDIT5,218,88,36,14,ES_CENTER | ES_AUTOHSCROLL
COMBOBOX IDC_CATEGORY_TYPE_CB,256,41,142,407,CBS_DROPDOWNLIST |
CBS_OWNERDRAWFIXED | CBS_SORT | CBS_HASSTRINGS |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Default",IDC_DEFAULT_BTN,256,59,58,14,BS_FLAT
COMBOBOX IDC_SEARCH_TYPE_COMBO,398,41,51,94,CBS_DROPDOWNLIST |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_SEARCH_VALUE_EDIT,449,41,106,15,ES_AUTOHSCROLL
PUSHBUTTON "",IDC_SEARCH_BUTTON,556,41,54,15,BS_FLAT
CONTROL "",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,618,
44,86,10
PUSHBUTTON "",IDC_EXTRACTMULTIFILE,556,60,142,15,BS_FLAT | NOT
WS_TABSTOP
LISTBOX IDC_RESULT_LIST,4,107,760,430,LBS_OWNERDRAWFIXED |
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL |
NOT WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,
WS_EX_STATICEDGE
COMBOBOX IDC_VIEW_NUM_COMBO,293,543,50,91,CBS_DROPDOWNLIST |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "UID",IDC_SHOW_UID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
61,544,28,10
CONTROL "CID",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
92,544,28,10
CONTROL "Time",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
123,544,32,10
CONTROL "Position",IDC_CHECK4,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,159,544,48,10
CTEXT "",IDC_LOGFILENAME_STATIC,4,7,73,15,SS_CENTERIMAGE |
SS_SUNKEN
EDITTEXT IDC_READFILENAME,79,7,586,15,ES_READONLY | NOT
WS_TABSTOP
PUSHBUTTON "Previous",IDC_PREV_BUTTON,574,542,42,13,BS_FLAT
PUSHBUTTON "Next",IDC_NEXT_BUTTON,619,542,42,13,BS_FLAT
CTEXT "한 페이지 개수",IDC_STATIC,227,542,64,13,SS_CENTERIMAGE |
SS_SUNKEN
EDITTEXT IDC_EDIT1,364,542,207,13,ES_CENTER | ES_AUTOHSCROLL |
ES_READONLY,WS_EX_RIGHT
CTEXT "",IDC_SEARCHSTARTDATE_STATIC,12,42,52,13,SS_CENTERIMAGE |
SS_SUNKEN
CTEXT "",IDC_SEARCHENDDATE_STATIC,12,59,52,13,SS_CENTERIMAGE |
SS_SUNKEN
CTEXT "X",IDC_STATIC,195,42,22,14,SS_CENTERIMAGE | SS_SUNKEN
CTEXT "Y",IDC_STATIC,195,58,22,14,SS_CENTERIMAGE | SS_SUNKEN
CTEXT "Z",IDC_STATIC,195,72,22,14,SS_CENTERIMAGE | SS_SUNKEN
CTEXT "",IDC_RADIUS_STATIC,195,88,22,14,SS_CENTERIMAGE |
SS_SUNKEN
LTEXT "",IDC_SEARCHTYPE_STATIC,256,30,88,8
LTEXT "",IDC_SEARCHCONDITION_STATIC,401,30,44,8
LTEXT "",IDC_SEARCHVALUE_STATIC,449,30,102,8
CTEXT "표시항목",IDC_STATIC,4,542,51,13,SS_CENTERIMAGE |
SS_SUNKEN
LTEXT "",IDC_SEARCHTIME_STATIC,12,30,173,8
LTEXT "",IDC_SEARCHCOORDINATES_STATIC,195,30,56,8
EDITTEXT IDC_GOPAGE_EDIT,670,541,45,14,ES_RIGHT | ES_AUTOHSCROLL |
ES_NUMBER
PUSHBUTTON "Go Page",IDC_GOPAGE_BTN,715,542,49,13,BS_FLAT
PUSHBUTTON "",IDC_CONVERT_TO_TEXT,556,78,142,15,BS_FLAT
END
IDD_CHARACTERINFODLG DIALOGEX 0, 0, 265, 298
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP |
WS_CAPTION | WS_SYSMENU
CAPTION "Character Info"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
PUSHBUTTON "",IDC_EXPORT_BUTTON,166,16,95,14,BS_FLAT
CONTROL "",IDC_CHARACTER_STATUS_LIST,"SysListView32",LVS_REPORT |
LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,9,16,147,206
EDITTEXT IDC_LAST_POSX,75,246,50,12,ES_AUTOHSCROLL | ES_READONLY |
NOT WS_BORDER,WS_EX_STATICEDGE
GROUPBOX "Position",IDC_STATIC,4,232,257,59
CTEXT "Last Pos X",IDC_STATIC,14,246,59,11,SS_CENTERIMAGE |
SS_SUNKEN
CTEXT "Last Pos Y",IDC_STATIC,14,260,59,11,SS_CENTERIMAGE |
SS_SUNKEN
CTEXT "Last Pos Z",IDC_STATIC,14,274,59,11,SS_CENTERIMAGE |
SS_SUNKEN
EDITTEXT IDC_LAST_POSY,75,260,50,12,ES_AUTOHSCROLL | ES_READONLY |
NOT WS_BORDER,WS_EX_STATICEDGE
EDITTEXT IDC_LAST_POSZ,75,274,50,12,ES_AUTOHSCROLL | ES_READONLY |
NOT WS_BORDER,WS_EX_STATICEDGE
CTEXT "Save Pos X",IDC_STATIC,141,246,59,11,SS_CENTERIMAGE |
SS_SUNKEN
CTEXT "Save Pos Y",IDC_STATIC,141,260,59,11,SS_CENTERIMAGE |
SS_SUNKEN
CTEXT "Save Pos Z",IDC_STATIC,141,274,59,11,SS_CENTERIMAGE |
SS_SUNKEN
EDITTEXT IDC_SAVE_POSX,202,246,50,12,ES_AUTOHSCROLL | ES_READONLY |
NOT WS_BORDER,WS_EX_STATICEDGE
EDITTEXT IDC_SAVE_POSY,202,260,50,12,ES_AUTOHSCROLL | ES_READONLY |
NOT WS_BORDER,WS_EX_STATICEDGE
EDITTEXT IDC_SAVE_POSZ,202,274,50,12,ES_AUTOHSCROLL | ES_READONLY |
NOT WS_BORDER,WS_EX_STATICEDGE
PUSHBUTTON "",IDC_SHOW_QUICKSLOT,166,39,95,14,BS_FLAT
PUSHBUTTON "",IDC_SHOW_SKILLSLOT,166,62,95,14,BS_FLAT
GROUPBOX "",IDC_CHARACTERINFO_GROUP,4,4,157,223,BS_FLAT
END
IDD_ITEMINFO_PAGE DIALOGEX 0, 0, 653, 298
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "ItemInfo"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
EDITTEXT IDC_ITEMINFOEDIT,7,7,180,284,ES_MULTILINE |
ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL
LISTBOX IDC_ITEM_LIST,192,19,454,272,LBS_NOINTEGRALHEIGHT |
LBS_EXTENDEDSEL | LBS_DISABLENOSCROLL | WS_VSCROLL |
WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "Copy",IDC_BUTTON1,521,7,125,11
END
IDD_DETAIL_INFO DIALOGEX 0, 0, 329, 293
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "Detail Info"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,211,273,111,13,BS_FLAT
EDITTEXT IDC_EDIT1,7,7,315,263,ES_MULTILINE | ES_AUTOHSCROLL |
ES_READONLY | WS_VSCROLL
END
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "041203b5"
BEGIN
VALUE "CompanyName", "(c) Youxiland"
VALUE "FileDescription", "Youxiland Inner Tool"
VALUE "FileVersion", "1.0.0.1"
VALUE "InternalName", "GameLogAnalyzer.exe"
VALUE "LegalCopyright", "(c) Youxiland. All rights reserved."
VALUE "OriginalFilename", "GameLogAnalyzer.exe"
VALUE "ProductName", "GameLogAnalyzer"
VALUE "ProductVersion", "1.0.0.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x412, 949
END
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 203
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_GAMELOGANALYZER_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 764
TOPMARGIN, 7
BOTTOMMARGIN, 555
END
IDD_CHARACTERINFODLG, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 261
TOPMARGIN, 4
BOTTOMMARGIN, 291
END
IDD_ITEMINFO_PAGE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 646
TOPMARGIN, 7
BOTTOMMARGIN, 291
END
IDD_DETAIL_INFO, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 322
TOPMARGIN, 7
BOTTOMMARGIN, 286
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// RT_MANIFEST
//
IDR_MANIFEST RT_MANIFEST "res\\GameLogAnalyzer.manifest"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_RESULT_LISTBOX MENU
BEGIN
POPUP "RESULT_LISTBOX(&R)"
BEGIN
MENUITEM "Export to File(&F)", ID_RESULT_EXPORTTOFILE
MENUITEM "Export to Clipboard(&C)", ID_RESULT_EXPORTTOCLIPBOARD
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON "res\\GameLogAnalyzer.ico"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_ABOUTBOX "GameLogAnalyzer Info(&A)..."
IDS_EQUIP_INFO "Equip"
IDS_INVEN_INFO "Inventory"
IDS_EXCHANGE_INFO "Excange"
IDS_EXTRA_INFO "Extra"
IDS_DEPOSIT_INFO "Deposit"
IDS_TEMPINVEN_INFO "TempInventory"
END
#endif // 중립 resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// 한국어 resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
#ifdef _WIN32
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
#pragma code_page(949)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)\r\n"
"LANGUAGE 18, 1\r\n"
"#pragma code_page(949)\r\n"
"#include ""res\\GameLogAnalyzer.rc2"" // Microsoft Visual C++에서 편집되지 않은 리소스\r\n"
"#include ""afxres.rc"" // 표준 구성 요소\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // 한국어 resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
LANGUAGE 18, 1
#pragma code_page(949)
#include "res\GameLogAnalyzer.rc2" // Microsoft Visual C++에서 편집되지 않은 리소스
#include "afxres.rc" // 표준 구성 요소
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,316 @@
<?xml version="1.0" encoding="ks_c_5601-1987"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="GameLogAnalyzer"
ProjectGUID="{2AE1E39A-09B9-4B6F-967F-4BDADA98381C}"
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../DBToolExecutable/$(ConfigurationName)"
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../;./;../../RylServerProject/;../../RylServerProject/BaseLibrary;../../RylServerProject/RylGameLibrary;../../RylServerProject/RylServerLibrary"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;__WIN32__"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
TreatWChar_tAsBuiltInType="TRUE"
UsePrecompiledHeader="2"
AssemblerOutput="2"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="FALSE"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../DBToolExecutable/$(ConfigurationName)"
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="1"
UseOfATL="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="../;./;../../RylServerProject/;../../RylServerProject/BaseLibrary;../../RylServerProject/RylGameLibrary;../../RylServerProject/RylServerLibrary"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;__WIN32__"
StringPooling="TRUE"
MinimalRebuild="FALSE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
TreatWChar_tAsBuiltInType="TRUE"
UsePrecompiledHeader="2"
AssemblerOutput="2"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="FALSE"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Controls"
Filter="">
<Filter
Name="CustomControl"
Filter="">
<Filter
Name="XListBox"
Filter="">
<File
RelativePath=".\Clipboard.cpp">
</File>
<File
RelativePath=".\Clipboard.h">
</File>
<File
RelativePath=".\ColorPickerCB.cpp">
</File>
<File
RelativePath=".\ColorPickerCB.h">
</File>
<File
RelativePath=".\XListBox.cpp">
</File>
<File
RelativePath=".\XListBox.h">
</File>
</Filter>
<Filter
Name="CheckComboBox"
Filter="">
<File
RelativePath=".\CheckComboBox.cpp">
</File>
<File
RelativePath=".\CheckComboBox.h">
</File>
</Filter>
</Filter>
<Filter
Name="PropertySheet"
Filter="">
<File
RelativePath="ItemInfoSheet.cpp">
</File>
<File
RelativePath="ItemInfoSheet.h">
</File>
<Filter
Name="Pages"
Filter="">
<File
RelativePath="ItemInfoPage.cpp">
</File>
<File
RelativePath="ItemInfoPage.h">
</File>
</Filter>
</Filter>
<Filter
Name="Dialog"
Filter="">
<File
RelativePath="CharacterInfoDlg.cpp">
</File>
<File
RelativePath="CharacterInfoDlg.h">
</File>
<File
RelativePath="GameLogAnalyzerDlg.cpp">
</File>
<File
RelativePath="GameLogAnalyzerDlg.h">
</File>
<File
RelativePath="InfoDlg.cpp">
</File>
<File
RelativePath="InfoDlg.h">
</File>
<File
RelativePath="ItemInfoDlg.cpp">
</File>
<File
RelativePath="ItemInfoDlg.h">
</File>
</Filter>
</Filter>
<Filter
Name="Utility"
Filter="">
<File
RelativePath=".\GlobalFunctions.cpp">
</File>
<File
RelativePath=".\GlobalFunctions.h">
</File>
</Filter>
<Filter
Name="Resource"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest">
<File
RelativePath=".\ChangeLog.txt">
</File>
<File
RelativePath="res\GameLogAnalyzer.ico">
</File>
<File
RelativePath="res\GameLogAnalyzer.manifest">
</File>
<File
RelativePath="GameLogAnalyzer.rc">
</File>
<File
RelativePath="res\GameLogAnalyzer.rc2">
</File>
<File
RelativePath=".\GameLogAnalyzerSetupFile.ini">
</File>
</Filter>
<File
RelativePath="GameLogAnalyzer.cpp">
</File>
<File
RelativePath="GameLogAnalyzer.h">
</File>
<File
RelativePath="LogAnalyzer.cpp">
</File>
<File
RelativePath="LogAnalyzer.h">
</File>
<File
RelativePath="LogItemContainer.cpp">
</File>
<File
RelativePath="LogItemContainer.h">
</File>
<File
RelativePath="PrintDetailLog.cpp">
</File>
<File
RelativePath="PrintLog.h">
</File>
<File
RelativePath="PrintSimpleLog.cpp">
</File>
<File
RelativePath="ReadMe.txt">
</File>
<File
RelativePath="Resource.h">
</File>
<File
RelativePath="SearchClass.cpp">
</File>
<File
RelativePath="SearchClass.h">
</File>
<File
RelativePath="stdafx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
</File>
<File
RelativePath="stdafx.h">
</File>
</Files>
<Globals>
<Global
Name="RESOURCE_FILE"
Value="GameLogAnalyzer.rc"/>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,722 @@
// GameLogAnalyzerDlg.cpp : 구현 파일
//
#include "stdafx.h"
#include "GameLogAnalyzer.h"
#include "GameLogAnalyzerDlg.h"
#include "CharacterInfoDlg.h"
#include "ItemInfoSheet.h"
#include "SearchClass.h"
#include <RylGameLibrary/Log/ParseLog.h>
#include <set>
#include <string>
#include "GlobalFunctions.h"
#include "Clipboard.h"
#include ".\gameloganalyzerdlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// 응용 프로그램 정보에 사용되는 CAboutDlg 대화 상자입니다.
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// 대화 상자 데이터
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원
// 구현
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// CGameLogAnalyzerDlg 대화 상자
CGameLogAnalyzerDlg::CGameLogAnalyzerDlg(CWnd* pParent /*=NULL*/)
: CDialog(CGameLogAnalyzerDlg::IDD, pParent)
, m_SearchValue(_T(""))
, m_FileName(_T(""))
, m_Page(_T(""))
, m_bShowUID(TRUE)
, m_bShowCID(TRUE)
, m_bShowTime(TRUE)
, m_bShowPosition(FALSE)
, m_bSearchInResult(FALSE)
, m_XPos(_T("0"))
, m_YPos(_T("0"))
, m_ZPos(_T("0"))
, m_Radius(_T("0"))
, m_dwGoPageIndex(1)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CGameLogAnalyzerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_SEARCH_TYPE_COMBO, m_ctrlSearchTypeCb);
DDX_Control(pDX, IDC_VIEW_NUM_COMBO, m_ListNum);
DDX_Text(pDX, IDC_READFILENAME, m_FileName);
DDX_Text(pDX, IDC_SEARCH_VALUE_EDIT, m_SearchValue);
DDX_Text(pDX, IDC_EDIT1, m_Page);
DDX_Check(pDX, IDC_SHOW_UID, m_bShowUID);
DDX_Check(pDX, IDC_CHECK2, m_bShowCID);
DDX_Check(pDX, IDC_CHECK3, m_bShowTime);
DDX_Check(pDX, IDC_CHECK4, m_bShowPosition);
DDX_Check(pDX, IDC_CHECK5, m_bSearchInResult);
DDX_Control(pDX, IDC_DATETIMEPICKER2, m_SearchStartDate);
DDX_Control(pDX, IDC_DATETIMEPICKER3, m_SearchStopDate);
DDX_Text(pDX, IDC_EDIT2, m_XPos);
DDX_Text(pDX, IDC_EDIT3, m_YPos);
DDX_Text(pDX, IDC_EDIT4, m_ZPos);
DDX_Text(pDX, IDC_EDIT5, m_Radius);
DDX_Control(pDX, IDC_RESULT_LIST, m_ListBox);
DDX_Text(pDX, IDC_GOPAGE_EDIT, m_dwGoPageIndex);
DDV_MinMaxUInt(pDX, m_dwGoPageIndex, 1, UINT_MAX);
DDX_Control(pDX, IDC_CATEGORY_TYPE_CB, m_ctrlCategoryTypeCb);
}
BEGIN_MESSAGE_MAP(CGameLogAnalyzerDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_READ_FILE_SELECT_BUTTON, OnBnClickedFileSelect)
ON_BN_CLICKED(IDC_SEARCH_BUTTON, OnBnClickedSearch)
ON_LBN_DBLCLK(IDC_RESULT_LIST, OnLbnDblclkResultList)
ON_BN_CLICKED(IDC_PREV_BUTTON, OnBnClickedPrevButton)
ON_BN_CLICKED(IDC_NEXT_BUTTON, OnBnClickedNextButton)
ON_BN_CLICKED(IDC_BUTTON2, OnBnPositionResetClicked)
ON_BN_CLICKED(IDC_BUTTON3, OnBnTimeResetClicked)
ON_WM_CLOSE()
ON_CBN_SELCHANGE(IDC_CATEGORY_TYPE_CB, OnCbnSelchangeCategoryTypeCombo)
ON_BN_CLICKED(IDC_EXTRACTMULTIFILE, OnBnClickedExtractmultifile)
ON_WM_CONTEXTMENU()
ON_COMMAND(ID_RESULT_EXPORTTOFILE, OnResultExporttofile)
ON_BN_CLICKED(IDC_GOPAGE_BTN, OnBnClickedGopageBtn)
ON_BN_CLICKED(IDC_DEFAULT_BTN, OnBnClickedDefaultBtn)
ON_BN_CLICKED(IDC_CONVERT_TO_TEXT, OnBnClickedConvertToText)
ON_COMMAND(ID_RESULT_EXPORTTOCLIPBOARD, OnResultExportToClipboard)
END_MESSAGE_MAP()
// CGameLogAnalyzerDlg 메시지 처리기
BOOL CGameLogAnalyzerDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// 시스템 메뉴에 "정보..." 메뉴 항목을 추가합니다.
// IDM_ABOUTBOX는 시스템 명령 범위에 있어야 합니다.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// 이 대화 상자의 아이콘을 설정합니다. 응용 프로그램의 주 창이 대화 상자가 아닐 경우에는
// 프레임워크가 이 작업을 자동으로 수행합니다.
SetIcon(m_hIcon, TRUE); // 큰 아이콘을 설정합니다.
SetIcon(m_hIcon, FALSE); // 작은 아이콘을 설정합니다.
// TODO: 여기에 추가 초기화 작업을 추가합니다.
SetDlgItemText(IDC_LOGFILENAME_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "LOG_FILE_NAME"));
SetDlgItemText(IDC_READ_FILE_SELECT_BUTTON, GetMyINIString("STRING_FOR_LOCALIZE", "FILE_SELECT"));
SetDlgItemText(IDC_SEARCHTIME_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_TIME"));
SetDlgItemText(IDC_SEARCHCOORDINATES_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_COORDINATES"));
SetDlgItemText(IDC_SEARCHTYPE_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_TYPE"));
SetDlgItemText(IDC_SEARCHCONDITION_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_CONDITION"));
SetDlgItemText(IDC_SEARCHVALUE_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_VALUE"));
SetDlgItemText(IDC_EXTRACTMULTIFILE, GetMyINIString("STRING_FOR_LOCALIZE", "EXTRACT_MULTIFILE"));
SetDlgItemText(IDC_SEARCH_BUTTON, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH"));
SetDlgItemText(IDC_CHECK5, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_IN_RESULT"));
SetDlgItemText(IDC_SEARCHSTARTDATE_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_START_DATE"));
SetDlgItemText(IDC_SEARCHENDDATE_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "SEARCH_END_DATE"));
SetDlgItemText(IDC_BUTTON3, GetMyINIString("STRING_FOR_LOCALIZE", "RESET_TIME"));
SetDlgItemText(IDC_BUTTON2, GetMyINIString("STRING_FOR_LOCALIZE", "RESET_CORORDINATES"));
SetDlgItemText(IDC_RADIUS_STATIC, GetMyINIString("STRING_FOR_LOCALIZE", "RADIUS"));
SetDlgItemText(IDC_CONVERT_TO_TEXT, GetMyINIString("STRING_FOR_LOCALIZE", "CONVERT_TO_TEXT"));
m_LogAnalyzer.Initialize(m_hWnd, m_ctrlSearchTypeCb, m_ctrlCategoryTypeCb);
for(int nIdx = 0; nIdx < m_ctrlCategoryTypeCb.GetCount(); ++nIdx)
{
m_ctrlCategoryTypeCb.SetCheck(nIdx, false);
}
m_ctrlCategoryTypeCb.SetCheck(0, true); // 기본 선택은 ALL
m_ListNum.InsertString(0, "5000");
m_ListNum.InsertString(1, "1000");
m_ListNum.InsertString(2, "500");
m_ListNum.InsertString(3, "100");
m_ListNum.SetCurSel(0);
m_SearchStartDate.SetFormat(GetMyINIString("STRING_FOR_LOCALIZE", "FORMAT_001"));
m_SearchStopDate.SetFormat(GetMyINIString("STRING_FOR_LOCALIZE", "FORMAT_001"));
CTime startTime(2002, 10, 21, 0, 0, 0);
m_SearchStartDate.SetTime(&startTime);
return TRUE;
}
void CGameLogAnalyzerDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// 대화 상자에 최소화 단추를 추가할 경우 아이콘을 그리려면
// 아래 코드가 필요합니다. 문서/뷰 모델을 사용하는 MFC 응용 프로그램의 경우에는
// 프레임워크에서 이 작업을 자동으로 수행합니다.
void CGameLogAnalyzerDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // 그리기를 위한 디바이스 컨텍스트
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 클라이언트 사각형에서 아이콘을 가운데에 맞춥니다.
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 아이콘을 그립니다.
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// 사용자가 최소화된 창을 끄는 동안에 커서가 표시되도록 시스템에서
// 이 함수를 호출합니다.
HCURSOR CGameLogAnalyzerDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
void CGameLogAnalyzerDlg::OnBnClickedFileSelect()
{
if (!m_LogAnalyzer.Open())
MessageBox(GetMyINIString("STRING_FOR_LOCALIZE", "ERR_002"));
m_ListBox.ResetContent();
m_FileName = m_LogAnalyzer.GetFileName();
UpdateData(false);
}
void CGameLogAnalyzerDlg::OnCbnSelchangeCategoryTypeCombo()
{
/*
UpdateData(true);
CTime startTime, stopTime;
m_SearchStartDate.GetTime(startTime); m_SearchStopDate.GetTime(stopTime);
if (!m_LogAnalyzer.Category(m_ctrlCategoryTypeCb, startTime, stopTime,
CRegion(m_Radius, m_XPos, m_YPos, m_ZPos), m_bSearchInResult))
{
MessageBox(GetMyINIString("STRING_FOR_LOCALIZE", "ERR_005"));
return;
}
m_LogAnalyzer.SetShowMode(m_bShowUID, m_bShowCID, m_bShowTime, m_bShowPosition);
CString ShowNum;
m_ListNum.GetLBText(m_ListNum.GetCurSel(), ShowNum);
m_LogAnalyzer.Show(m_ListBox, atoi(ShowNum), m_Page);
m_ListBox.SetFocus();
UpdateData(false);
*/
}
void CGameLogAnalyzerDlg::OnBnClickedSearch()
{
UpdateData(true);
CString SearchType;
m_ctrlSearchTypeCb.GetLBText(m_ctrlSearchTypeCb.GetCurSel(), SearchType);
CTime startTime, stopTime;
m_SearchStartDate.GetTime(startTime);
m_SearchStopDate.GetTime(stopTime);
if (!m_LogAnalyzer.Search(m_ctrlCategoryTypeCb,
SearchType, m_SearchValue, startTime, stopTime,
CRegion(m_Radius, m_XPos, m_YPos, m_ZPos), m_bSearchInResult))
{
MessageBox(GetMyINIString("STRING_FOR_LOCALIZE", "ERR_005"));
return;
}
m_LogAnalyzer.SetShowMode(m_bShowUID, m_bShowCID, m_bShowTime, m_bShowPosition);
CString ShowNum;
m_ListNum.GetLBText(m_ListNum.GetCurSel(), ShowNum);
m_LogAnalyzer.Show(m_ListBox, atoi(ShowNum), m_Page);
UpdateData(false);
}
void CGameLogAnalyzerDlg::OnLbnDblclkResultList()
{
UpdateData(true);
int nSel = m_ListBox.GetCurSel();
if(nSel < 0)
{
return;
}
if(false == m_LogAnalyzer.ShowDetail(nSel))
{
MessageBox(GetMyINIString("STRING_FOR_LOCALIZE", "ERR_006"));
}
UpdateData(FALSE);
}
void CGameLogAnalyzerDlg::OnBnClickedGopageBtn()
{
UpdateData(true);
if(m_dwGoPageIndex > 0)
{
m_LogAnalyzer.SetShowMode(m_bShowUID, m_bShowCID, m_bShowTime, m_bShowPosition);
CString ShowNum;
m_ListNum.GetLBText(m_ListNum.GetCurSel(), ShowNum);
m_LogAnalyzer.MovePage(m_ListBox, atoi(ShowNum), m_Page, m_dwGoPageIndex);
UpdateData(false);
}
}
void CGameLogAnalyzerDlg::OnBnClickedPrevButton()
{
UpdateData(true);
m_LogAnalyzer.SetShowMode(m_bShowUID, m_bShowCID, m_bShowTime, m_bShowPosition);
CString ShowNum;
m_ListNum.GetLBText(m_ListNum.GetCurSel(), ShowNum);
m_LogAnalyzer.Prev(m_ListBox, atoi(ShowNum), m_Page);
UpdateData(false);
}
void CGameLogAnalyzerDlg::OnBnClickedNextButton()
{
UpdateData(true);
m_LogAnalyzer.SetShowMode(m_bShowUID, m_bShowCID, m_bShowTime, m_bShowPosition);
CString ShowNum;
m_ListNum.GetLBText(m_ListNum.GetCurSel(), ShowNum);
m_LogAnalyzer.Next(m_ListBox, atoi(ShowNum), m_Page);
UpdateData(false);
}
void CGameLogAnalyzerDlg::OnBnPositionResetClicked()
{
m_XPos = "0";
m_YPos = "0";
m_ZPos = "0";
m_Radius = "0";
UpdateData(false);
}
void CGameLogAnalyzerDlg::OnBnTimeResetClicked()
{
CTime startTime(2002, 10, 21, 0, 0, 0), stopTime;
m_SearchStartDate.SetTime(&startTime);
m_SearchStopDate.SetTime(&CTime::GetCurrentTime());
}
void CGameLogAnalyzerDlg::OnClose()
{
CDialog::OnClose();
}
void WriteLog(CParseLog::LogPtrArray& ResultArray, CFile& writeFile)
{
CParseLog::LogPtrArray::iterator first = ResultArray.begin();
CParseLog::LogPtrArray::iterator last = ResultArray.end();
for(; first != last; ++first)
{
GAMELOG::sLogBase* lpLogBase = *first;
writeFile.Write(lpLogBase, lpLogBase->GetSize());
}
}
void CGameLogAnalyzerDlg::OnBnClickedExtractmultifile()
{
UpdateData(true);
OPENFILENAME openfile;
OPENFILENAME savefile;
char szOpenFileName[MAX_PATH * MAX_PATH] = "";
char szSaveFileName[MAX_PATH] = "";
memset(&openfile, 0, sizeof(OPENFILENAME));
memset(&savefile, 0, sizeof(OPENFILENAME));
openfile.lStructSize = sizeof(OPENFILENAME);
openfile.hwndOwner = m_hWnd;
openfile.lpstrFilter = "Log and ziped files\0*.log;*.zip\0All files\0*.*\0";
openfile.lpstrFile = szOpenFileName;
openfile.nMaxFile = MAX_PATH * MAX_PATH;
openfile.Flags = OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_LONGNAMES | OFN_EXPLORER;
savefile.lStructSize = sizeof(OPENFILENAME);
savefile.hwndOwner = m_hWnd;
savefile.lpstrFilter = "Log FIles\0*.log\0";
savefile.lpstrFile = szSaveFileName;
savefile.nMaxFile = MAX_PATH;
savefile.Flags = OFN_SHOWHELP | OFN_LONGNAMES | OFN_EXPLORER;
CParseLog ParseLog;
CParseLog::LogPtrArray ResultArray;
CString SearchType;
CTime startTime, stopTime;
UpdateData();
m_ctrlSearchTypeCb.GetLBText(m_ctrlSearchTypeCb.GetCurSel(), SearchType);
m_SearchStartDate.GetTime(startTime);
m_SearchStopDate.GetTime(stopTime);
if(GetOpenFileName(&openfile))
{
if(GetSaveFileName(&savefile))
{
CFile writeData;
CFileException fileException;
strncat(szSaveFileName, ".log", MAX_PATH);
if (!writeData.Open(szSaveFileName,
CFile::modeCreate | CFile::modeReadWrite, &fileException))
{
TRACE("Can't open file %s, error = %u\n", szSaveFileName, fileException.m_cause );
}
const char* szAnalyzeFileName = szOpenFileName;
if(*(szAnalyzeFileName + strlen(szAnalyzeFileName) + 1) == 0)
{
// 파일이 한개
ParseLog.LoadFile(szAnalyzeFileName);
// 검색한 후, 검색 결과를 파일로 저장.
if(CLogAnalyzer::Search(ParseLog, ResultArray,
m_ctrlCategoryTypeCb, SearchType, m_SearchValue,
startTime, stopTime, CRegion(m_Radius, m_XPos, m_YPos, m_ZPos), false))
{
WriteLog(ResultArray, writeData);
ResultArray.clear();
}
}
else
{
// 파일이 여러개.
std::string szPath(szOpenFileName);
std::set<std::string> AnalyzeFileSet;
for (;;)
{
szAnalyzeFileName = szAnalyzeFileName + strlen(szAnalyzeFileName) + 1;
if(*szAnalyzeFileName == 0)
{
break;
}
AnalyzeFileSet.insert(szAnalyzeFileName);
}
std::set<std::string>::iterator
pos = AnalyzeFileSet.begin(),
end = AnalyzeFileSet.end();
std::string szPathName;
szPathName.reserve(MAX_PATH * 2);
for(;pos != end; ++pos)
{
szPathName.assign(szPath);
szPathName.append("\\");
szPathName.append(*pos);
ParseLog.LoadFile(szPathName.c_str());
// 검색한 후, 검색 결과를 파일로 저장.
if(CLogAnalyzer::Search(ParseLog, ResultArray,
m_ctrlCategoryTypeCb, SearchType, m_SearchValue,
startTime, stopTime, CRegion(m_Radius, m_XPos, m_YPos, m_ZPos), false))
{
WriteLog(ResultArray, writeData);
ResultArray.clear();
}
}
}
MessageBox(GetMyINIString("STRING_FOR_LOCALIZE", "ERR_007"));
}
}
}
void CGameLogAnalyzerDlg::OnOK()
{
//CDialog::OnOK();
}
void CGameLogAnalyzerDlg::OnCancel()
{
CDialog::OnCancel();
}
void CGameLogAnalyzerDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
if(pWnd->GetSafeHwnd() == m_ListBox.GetSafeHwnd()
&& m_ListBox.GetSelCount() != 0)
{
CMenu muTemp, *pContextMenu;
muTemp.LoadMenu(IDR_RESULT_LISTBOX);
pContextMenu = muTemp.GetSubMenu(0);
pContextMenu->TrackPopupMenu(TPM_LEFTALIGN, point.x, point.y, this);
}
}
void CGameLogAnalyzerDlg::OnResultExporttofile()
{
// 다이얼로그 열어 출력 파일 이름 받기.
OPENFILENAME OpenFile;
char szFileNameBuffer[MAX_PATH];
char szFileTitle[MAX_PATH];
memset(&OpenFile, 0, sizeof(OPENFILENAME));
OpenFile.lStructSize = sizeof(OPENFILENAME);
OpenFile.hwndOwner = NULL;
OpenFile.lpstrFilter = "LogFIle\0*.log\0";
OpenFile.nMaxFile = MAX_PATH;
OpenFile.nMaxFileTitle = MAX_PATH;
OpenFile.lpstrInitialDir = (LPSTR)NULL;
OpenFile.Flags = OFN_SHOWHELP | OFN_OVERWRITEPROMPT;
OpenFile.lpstrFile = szFileNameBuffer;
OpenFile.lpstrFileTitle = szFileTitle;
ZeroMemory(szFileNameBuffer, MAX_PATH);
ZeroMemory(szFileTitle, MAX_PATH);
if(GetSaveFileName(&OpenFile))
{
if(0 == strstr(szFileNameBuffer, ".log"))
{
strncat(szFileNameBuffer, ".log", MAX_PATH);
}
CFile WriteFile(szFileNameBuffer, CFile::modeWrite | CFile::modeCreate);
CString ShowNum;
m_ListNum.GetLBText(m_ListNum.GetCurSel(), ShowNum);
int nItemNum = atoi(ShowNum);
LPINT lpItemIndex = new INT[nItemNum];
nItemNum = m_ListBox.GetSelItems(nItemNum, lpItemIndex);
if(LB_ERR != nItemNum)
{
LPINT begin = lpItemIndex;
LPINT end = lpItemIndex + nItemNum;
CString Result;
for(;begin != end; ++begin)
{
m_ListBox.GetText(*begin, Result);
Result += "\r\n";
WriteFile.Write(Result, Result.GetLength());
}
}
WriteFile.Close();
delete [] lpItemIndex;
char szPath[MAX_PATH];
char szFileNameWithPath[MAX_PATH];
UINT nResult = GetWindowsDirectory(szPath, MAX_PATH);
if(0 != nResult && nResult <= MAX_PATH)
{
_snprintf(szFileNameWithPath, MAX_PATH, "%s\\NotePad.exe %s", szPath, szFileNameBuffer);
WinExec(szFileNameWithPath, SW_SHOW);
}
}
}
BOOL CGameLogAnalyzerDlg::PreTranslateMessage(MSG* pMsg)
{
if((WM_KEYDOWN == pMsg->message) && (VK_RETURN == pMsg->wParam))
{
if(GetFocus() == GetDlgItem(IDC_SEARCH_VALUE_EDIT)->GetFocus())
{
OnBnClickedSearch();
}
else if(GetFocus() == GetDlgItem(IDC_GOPAGE_EDIT)->GetFocus())
{
OnBnClickedGopageBtn();
}
}
return CDialog::PreTranslateMessage(pMsg);
}
void CGameLogAnalyzerDlg::OnBnClickedDefaultBtn()
{
CString strALL;
for(int nIndex = 0; nIndex < m_ctrlCategoryTypeCb.GetCount(); ++nIndex)
{
m_ctrlCategoryTypeCb.GetLBText(nIndex, strALL);
if (!strALL.Compare(_T("ALL")))
{
m_ctrlCategoryTypeCb.SetCheck(nIndex, true);
}
else
{
m_ctrlCategoryTypeCb.SetCheck(nIndex, false);
}
}
}
void CGameLogAnalyzerDlg::OnBnClickedConvertToText()
{
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
// 다이얼로그 열어 출력 파일 이름 받기.
OPENFILENAME OpenFile;
char szFileNameBuffer[MAX_PATH];
char szFileTitle[MAX_PATH];
memset(&OpenFile, 0, sizeof(OPENFILENAME));
OpenFile.lStructSize = sizeof(OPENFILENAME);
OpenFile.hwndOwner = NULL;
OpenFile.lpstrFilter = "LogFIle\0*.log\0";
OpenFile.nMaxFile = MAX_PATH;
OpenFile.nMaxFileTitle = MAX_PATH;
OpenFile.lpstrInitialDir = (LPSTR)NULL;
OpenFile.Flags = OFN_SHOWHELP | OFN_OVERWRITEPROMPT;
OpenFile.lpstrFile = szFileNameBuffer;
OpenFile.lpstrFileTitle = szFileTitle;
ZeroMemory(szFileNameBuffer, MAX_PATH);
ZeroMemory(szFileTitle, MAX_PATH);
if(GetSaveFileName(&OpenFile))
{
if(0 == strstr(szFileNameBuffer, ".log"))
{
strncat(szFileNameBuffer, ".log", MAX_PATH);
}
m_LogAnalyzer.WriteTextLog(szFileNameBuffer);
}
MessageBox("Convert Success", "Convert");
}
void CGameLogAnalyzerDlg::OnResultExportToClipboard()
{
// TODO: 여기에 명령 처리기 코드를 추가합니다.
CString ShowNum;
m_ListNum.GetLBText(m_ListNum.GetCurSel(), ShowNum);
int nItemNum = atoi(ShowNum);
LPINT lpItemIndex = new INT[nItemNum];
if (0 != lpItemIndex)
{
nItemNum = m_ListBox.GetSelItems(nItemNum, lpItemIndex);
if(LB_ERR != nItemNum)
{
LPINT begin = lpItemIndex;
LPINT end = lpItemIndex + nItemNum;
CString TotalResult;
CString Result;
for(;begin != end; ++begin)
{
m_ListBox.GetText(*begin, Result);
TotalResult += Result;
TotalResult += "\r\n";
}
CClipboard::SetText(TotalResult);
}
delete [] lpItemIndex;
}
}

View File

@@ -0,0 +1,87 @@
// GameLogAnalyzerDlg.h : 헤더 파일
//
#pragma once
#include "afxwin.h"
#include "LogAnalyzer.h"
#include "afxdtctl.h"
#include "XListBox.h"
#include "CheckComboBox.h"
// CGameLogAnalyzerDlg 대화 상자
class CGameLogAnalyzerDlg : public CDialog
{
// 생성
public:
CGameLogAnalyzerDlg(CWnd* pParent = NULL); // 표준 생성자
// 대화 상자 데이터
enum { IDD = IDD_GAMELOGANALYZER_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원
// 구현
protected:
HICON m_hIcon;
// 메시지 맵 함수를 생성했습니다.
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual void OnOK();
virtual void OnCancel();
DECLARE_MESSAGE_MAP()
private:
unsigned int m_dwGoPageIndex;
CString m_XPos;
CString m_YPos;
CString m_ZPos;
CString m_Radius;
CString m_SearchValue;
CString m_FileName;
CString m_Page;
CDateTimeCtrl m_SearchStartDate;
CDateTimeCtrl m_SearchStopDate;
CComboBox m_ctrlSearchTypeCb;
CComboBox m_ListNum;
CCheckComboBox m_ctrlCategoryTypeCb;
CLogAnalyzer m_LogAnalyzer;
BOOL m_bShowUID;
BOOL m_bShowCID;
BOOL m_bShowTime;
BOOL m_bShowPosition;
BOOL m_bSearchInResult;
CFont m_ListBoxFont;
CXListBox m_ListBox;
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg void OnBnClickedFileSelect();
afx_msg void OnBnClickedSearch();
afx_msg void OnLbnDblclkResultList();
afx_msg void OnBnClickedPrevButton();
afx_msg void OnBnClickedNextButton();
afx_msg void OnBnPositionResetClicked();
afx_msg void OnBnTimeResetClicked();
afx_msg void OnClose();
afx_msg void OnCbnSelchangeCategoryTypeCombo();
afx_msg void OnBnClickedExtractmultifile();
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnResultExporttofile();
afx_msg void OnBnClickedGopageBtn();
afx_msg void OnBnClickedDefaultBtn();
afx_msg void OnBnClickedConvertToText();
public:
afx_msg void OnResultExportToClipboard();
};

View File

@@ -0,0 +1,235 @@
// Edit by zun (KOREA): 2005-02-23
[STRING_FOR_LOCALIZE]
// Format string : Never edit token and number!
FORMAT_001 = yyyy'년 'MM'월 'dd'일 'HH'시 'mm'분'
FORMAT_002 = 현재 페이지: %7d / 전체 페이지 수: %7d
FORMAT_003 = %d탭의 아이템입니다.
FORMAT_004 = 로그인 했습니다 - Race[%d] IP: %15s(%5u)
FORMAT_005 = 로그아웃 했습니다 - IP: %15s(%5u)
FORMAT_006 = 캐릭터를 생성했습니다 - IP: %15s(%5u)
FORMAT_007 = 캐릭터를 삭제했습니다 - IP: %15s(%5u)
FORMAT_008 = DB세션이 끊어져서 로그에 캐릭터 정보를 업데이트합니다.
FORMAT_009 = 캐릭터가 레벨업했습니다 - LV: %3u, IP: %3u
FORMAT_010 = 현재 위치를 저장했습니다 - 좌표: %5d,%5d,%5d
FORMAT_011 = 캐릭터가 죽었습니다 - LV: %u, 공격자CID:%10u, 마지막 경험치:%I64u, 현재경험치:%I64u, 깎인 경험치:%I64u
FORMAT_012 = 캐릭터가 리스폰하였습니다 - 좌표:%5d,%5d,%5d, 마지막 경험치:%I64u, 현재경험치:%I64u, 깎인 경험치:%I64u
FORMAT_013 = 아이템 이동 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치: %s -> %s, 내구도(갯수): %u
FORMAT_014 = 아이템 스왑 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치: %s -> %s, 내구도(갯수): %u UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치: %s -> %s, 내구도(갯수): %u
FORMAT_015 = 아이템 사용 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치: %s, 현재 개수: %u개
FORMAT_016 = 아이템 나누기 - UID:0x%016I64X, 종류ID:%5u, 이름: %s (%s 의 아이템을 %s로 %u개 나눔)
FORMAT_017 = 돈 집기 - %u Gold를 얻었습니다.
FORMAT_018 = 아이템 집기 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 놓은 위치: %s, 내구도(개수):%u
FORMAT_019 = 아이템 집기 실패 - 위치: %s에서 집기를 실패했습니다.
FORMAT_020 = 돈 버리기 - %u Gold를 버렸습니다.
FORMAT_021 = 아이템 떨구기 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치: %s, 내구도(개수):%u
FORMAT_022 = 아이템 떨구기 실패 - 위치: %s에서 떨구기를 실패했습니다.
FORMAT_023 = 아이템 판매 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치: %s, 구매자CID:%10u, 얻은금액:%u, 아이템 가격:%u
FORMAT_024 = 아이템 판매 - %s위치의 아이템을 팔 수 없습니다. 얻은 금액:%u
FORMAT_025 = 아이템 구매 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치:%s, 판매자CID:%10u, 지불금액:%u, 아이템 가격:%u
FORMAT_026 = 아이템 구매 실패 - 위치:%s, 지불 시도 금액:%u
FORMAT_027 = 아이템 구매 (공헌메달) : UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치:%s, 판매자CID:%10u, 지불한 마일리지:%u, 아이템 가격:%u
FORMAT_028 = 아이템 교환 전 - 교환 상대:%10u, 올려논 금액:%u
FORMAT_029 = 아이템 교환 후 - 교환 상대:%10u, 얻은 금액:%u
FORMAT_030 = 아이템 소켓 박기 : 보석(UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치:%s)으로 UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치:%s의 아이템을 업그레이드합니다.
FORMAT_031 = 아이템 수리 - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 내구도:%u -> %u, 소모 금액:%u
FORMAT_032 = 손바꾸기(무기바꾸기) - 손:%u
FORMAT_033 = 돈 이동 발생 - (%s, %uGold) -> (%s, %uGold)
FORMAT_034 = 아이템 업그레이드 - 이름: %s, 종류ID: %u의 아이템을 %u단계로 업그레이드하였습니다.
FORMAT_035 = 아이템 업그레이드 실패로 고철이 되었습니다.
FORMAT_036 = 아이템 업그레이드 실패
FORMAT_037 = 노점상 열기 - 이름: '%s'인 노점상을 열었습니다.
FORMAT_038 = 노점상 닫기 - 이름: '%s'인 노점상을 닫습니다.
FORMAT_039 = 노점상 %s - CID:%d손님이 %s하셨습니다.
FORMAT_040 = 노점상 아이템 %s - 이름: %s, 종류ID:%u, UID:%s, %s의 아이템을 %s에 개당%u원으로 %s (%s:%u)
FORMAT_041 = 길드 결성 %s - GID:%10u, 길드마스터CID:%10u, 결성금액:%10u
FORMAT_042 = 길드 가입 %s - GID:%10u, 가입한CID:%10u, 멤버레벨:%s
FORMAT_043 = 길드 탈퇴 %s - GID:%10u, 탈퇴승인자CID:%10u, 탈퇴자CID:%10u
FORMAT_044 = 길드원 등급 변경 %s - GID:%10u, 변경자CID:%10u, 대상멤버:%10u, 멤버레벨:%s
FORMAT_045 = 길드원 권한 변경 %s - GID:%10u, 변경자CID:%10u
FORMAT_046 = 길드 레벨 변경 %s - GID:%10u, 변경자CID:%10u, 변경후 길드레벨:%10u, 길드창고금액:%10u -> %10u
FORMAT_047 = 길드 마크 변경 %s - GID:%10u, 변경자CID:%10u, 길드창고금액:%10u -> %10u
FORMAT_048 = 길드 금고 변경 %s - GID:%10u, 변경자CID:%10u, 변경 금액:%10I64d, 길드창고금액:%10u -> %10u
FORMAT_049 = 길드 소멸 %s - GID:%10u, 소멸위치(파일:%s, 라인:%d)
FORMAT_050 = 돈 이동 발생 - (%s, %uGold) -> (%s, %uGold), 이동 금액: %uGold, 목적: %s
FORMAT_051 = (알수 없는 위치: %u)
FORMAT_052 = (위치: %u)
FORMAT_053 = (퀵슬롯: %u)
FORMAT_054 = (스킬슬롯: %u)
FORMAT_055 = (임시공간: %u)
FORMAT_056 = (기타: %s)
FORMAT_057 = (인벤토리: %u, %u, %u)
FORMAT_058 = (교환: %u, %u, %u)
FORMAT_059 = (창고: %u, %u, %u)
FORMAT_060 = (노점상: %u, %u, %u)
FORMAT_061 = (장비: %s)
FORMAT_062 = (알 수 없는 장비 위치: %u)
FORMAT_063 = ItemUID: 0x%s 아이템명: %24s TypeID: %5d 좌표: (%2d,%2d,%2d) 사이즈: (%2d, %2d) %s: %2d
FORMAT_064 = %15s - UID: 0x%s 이름: %24s TypeID: %5d %s : %d
FORMAT_065 = 이동하려는 존 : %2u / 이동하려는 채널 : %2u
FORMAT_066 = (임시인벤토리: %u)
FORMAT_067 = 옵션이식에 성공하였습니다 - 변경 전 옵션 (%s:%4u) -> 변경 후 옵션 (%s:%4u) / 소모 금액 (%10u)
FORMAT_068 = 옵션이식에 실패했습니다
FORMAT_069 = 아이템 보상 - 변경 전 (%s) -> 변경 후(%s) / 보상 골드:%10u / 소모 골드:%10u
FORMAT_070 = 아이템 보상 실패
FORMAT_071 = 아이템 구매 (스킬북 티켓) - UID:0x%016I64X, 종류ID:%5u, 이름: %s, 위치:%s, 판매자CID:%10u
FORMAT_072 = 아이템 구매 실패 (스킬북 티켓)
FORMAT_073 = 아이템 업그레이드 - 이름: %s, 종류ID: %u의 아이템이 %u단계에서 %u단계로 되었습니다.
FORMAT_074 = 몬스터 사망 : CID:0x%08X(Lv:%3u) %2d개 아이템 떨굼
FORMAT_075 = 전투로 얻은 명성 : EnemyCID:%010u, OurPartyUID:%010u, 과거 명성치:%8u, 현재 명성치:%8u, 얻은 명성치:%8u, 과거 공헌매달:%8u, 현재 공헌매달:%8u, 얻은 공헌매달:%8u
FORMAT_076 = 전투로 잃은 명성 : EnemyCID:%010u, OurPartyUID:%010u, 과거 명성치:%8u, 현재 명성치:%8u, 잃은 명성치:%8u
FORMAT_077 = 요새로 얻은 명성 : EnemyGID:%010u, 과거 명성치:%8u, 현재 명성치:%8u, 얻은 명성치:%8u
FORMAT_078 = 요새로 잃은 명성 : EnemyGID:%010u, 과거 명성치:%8u, 현재 명성치:%8u, 잃은 명성치:%8u
FORMAT_079 = 퀘스트 수행으로 얻은 보상 : QuestID:%10u, ItemUID:%016I64X, 경험치:%8u, 골드:%8u, 명성:%8u, 공헌메달:%8u
FORMAT_080 = 창고 보유 금액 : %u골드
// Dialog's item caption
LOG_FILE_NAME = 로그 파일 명
FILE_SELECT = 파일 선택
ITEM = 항목
VALUE =
SEARCH_TIME = 검색시간대
SEARCH_COORDINATES = 검색좌표
SEARCH_TYPE = 검색종류
SEARCH_CONDITION = 검색조건
SEARCH_VALUE = 검색값
EXTRACT_MULTIFILE = 검색결과를 로그파일로 추출
SEARCH = 검색
SEARCH_IN_RESULT = 결과 내 검색
SEARCH_START_DATE = 검색 시작일
SEARCH_END_DATE = 검색 종료일
RESET_TIME = 시간 리셋
RESET_CORORDINATES = 좌표 리셋
RADIUS = 반경
CHAR_INFO = 캐릭터 정보
SHOW_ITEM_INFO = 아이템 정보 보기
SHOW_QSLOT_INFO = 퀵 슬롯 정보 보기
SHOW_SKILLSLOT_INFO = 스킬 슬롯 정보 보기
CONVERT_TO_TEXT = 검색결과를 텍스트파일로 추출
CLIPPING = 클립보드로 저장
// Inner string
ENTER = 입장
LEAVE = 퇴장
REGISTER = 등록
REMOVE = 제거
CHANGE_PRICE = 가격 변경
DURABILITY = 내구도
NUMS = 개수
UNKNOWN_NAME = 알려지지 않은 이름
UNKNOWN_POS = 알려지지 않은 위치
UNKNOWN_ITEM = 알려지지 않은 아이템
UNKNOWN_TYPE = 알려지지 않은 타입
UNKNOWN_MEMBER_LV = 알려지지 않은 멤버 레벨
REQUEST = 요청
RESULT = 결과
HELM = 투구
SHIRT = 셔츠
TUNIC = 튜닉
ARMOUR = 아머
GLOVE = 장갑
BOOTS = 부츠
NECKLACE = 목걸이
RINGR = 오른손 반지
RINGL = 왼손 반지
SHIELD_HAND1 = 방패1
SHIELD_HAND2 = 방패2
WEAPON_HAND1 = 무기1
WEAPON_HAND2 = 무기2
AVATA = 아바타
RIDE = 탈것
HEAD = 머리
BODY = 상체
PROTECT_ARM = 프로텍트암
PELVIS = 하체
ACCESSORY1 = 악세사리1
ACCESSORY2 = 악세사리2
ACCESSORY3 = 악세사리3
SKILL_ARM = 스킬암
TS_NONE = 0위치
TS_EQUIP = 장비
TS_INVEN = 인벤토리
TS_QSLOT = 퀵슬롯
TS_SSLOT = 스킬 슬롯
TS_TEMP = 임시 공간
TS_TEMPINVEN = 임시 인벤토리
TS_UPGRADE = 업그레이드
TS_EXCHANGE = 교환창
TS_DEPOSIT = 창고
TS_EXTRA = 기타 위치
// ExtraPosition Detail
UPGRADE_EQUIPMENT_POS = 제련 장비
UPGRADE_MATERIAL_POS = 제련 광물
HOLDITEM_POS = 들고 있는 아이템
KIT_MATERIAL_POS = 공성병기 제작 자재
CAMP_MATERIAL_POS = 진지 제작 자재
EMBLEM_JEWEL_POS1 = 상징물 업그레이드 보석1
EMBLEM_JEWEL_POS2 = 상징물 업그레이드 보석2
EMBLEM_JEWEL_POS3 = 상징물 업그레이드 보석3
EMBLEM_JEWEL_POS4 = 상징물 업그레이드 보석4
EMBLEM_JEWEL_POS5 = 상징물 업그레이드 보석5
EMBLEM_JEWEL_POS6 = 상징물 업그레이드 보석6
EMBLEM_JEWEL_POS7 = 상징물 업그레이드 보석7
EMBLEM_JEWEL_POS8 = 상징물 업그레이드 보석8
EMBLEM_JEWEL_POS9 = 상징물 업그레이드 보석9
GRAFT_ORIGINAL_POS = 옵션 이식 원본 장비
GRAFT_SACRIFICE_POS = 옵션 이식 제물 장비
GRAFT_RESULT_POS = 옵션 이식 결과 장비
COMPENSATION_POS = 보상 판매 대상
MOVE_GOLD_PURPOSE_00 = 돈 이동 (창고, 인벤, 등등사이의 이동)
MOVE_GOLD_PURPOSE_01 = 창고 이용료
MOVE_GOLD_PURPOSE_02 = 창고 탭 구매
MOVE_GOLD_PURPOSE_03 = 캐쉬백 아이템 사용
MOVE_GOLD_PURPOSE_04 = 퀘스트 보상
MOVE_GOLD_PURPOSE_05 = 퀘스트에서 돈 제거
MOVE_GOLD_PURPOSE_06 = 운영자가 임의로 지원
MOVE_GOLD_PURPOSE_07 = 배틀그라운드에서 창고로 입금
MOVE_GOLD_PURPOSE_08 = 능력치 재분배
GUILDRIGHTS_GUILD_MASTER = 길드 마스터
GUILDRIGHTS_MIDDLE_ADMIN = 중간 관리자
GUILDRIGHTS_COMMON = 일반 길드원
GUILDRIGHTS_LEAVE_WAIT = 탈퇴 대기자
GUILDRIGHTS_JOIN_WAIT = 가입 대기자
GUILDRIGHTS_PUT_STOREHOUSE = 길드 창고 물품 넣기
GUILDRIGHTS_GET_STOREHOUSE = 길드 창고 물품 빼기
GUILDRIGHTS_USE_SAFE = 길드 창고 출금/사용
GUILDRIGHTS_INVITE_MEMBER = 길드원 초대
GUILDRIGHTS_PERMIT_JOIN = 가입 허가
GUILDRIGHTS_CHANGE_PASSWORD = 길드 창고 비밀번호 변경
GUILDRIGHTS_SETUP_RELATION = 우호/적대 길드 설정 변경
GUILDRIGHTS_SETUP_RANK = 서열 정렬
GUILDRIGHTS_REGULATE_TEX = 점령지 세율조정
GUILDRIGHTS_KICK_MEMBER = 길드원 강제 축출
GUILDRIGHTS_BOARD_ADMIN = 길드 공지 작성 권한
GUILDRIGHTS_SETUP_MARK_N_LEVEL = 길드마크/길드규모 설정
GUILDRIGHTS_SETUP_MIDDLE = 중간관리자 임명/해임
GUILDRIGHTS_DIVIDE_GOLD = 창고 금 배분
GUILDRIGHTS_SETUP_POLICY = 길드 방침 변경
PICKUP_ITEM = 아이템 집기
DROP_ITEM = 아이템 버리기
SELL_ITEM = 아이템 팔기
BUY_ITEM = 아이템 사기
MEDAL_BUY_ITEM = 메달로 산 아이템
CHAR_ITEM_INFO = 캐릭터 아이템 정보
QUICK_SLOT_INFO = 퀵 슬롯 정보
SKILL_SLOT_INFO = 스킬 슬롯 정보
ITEM_DETAIL_INFO = 아이템 상세 정보
// Error message
ERR_001 = 아이템 스크립트를 로드할 수 없습니다.
ERR_002 = 파일 열기에 실패했습니다.
ERR_003 = 퀵 슬롯 정보가 없습니다.
ERR_004 = 스킬 슬롯 정보가 없습니다.
ERR_005 = 검색에 실패했습니다.
ERR_006 = 자세한 정보를 볼 수 없습니다.
ERR_007 = 파일 생성을 완료했습니다.
ERR_008 = 검색값을 입력한 후 추출하십시요.

View File

@@ -0,0 +1,53 @@
#include "stdafx.h"
#include "GlobalFunctions.h"
#include "Clipboard.h"
#include <Utility/Registry/RegFunctions.h>
class CLogAnalyzeSetup : public Registry::CSetupFile
{
public:
CLogAnalyzeSetup(const char* szFileName) : Registry::CSetupFile(szFileName) { }
static CLogAnalyzeSetup& GetInstance();
};
CLogAnalyzeSetup& CLogAnalyzeSetup::GetInstance()
{
static CLogAnalyzeSetup setup("./GameLogAnalyzerSetupFile.ini");
return setup;
}
// 리스트 컨트롤에서 선택한 내용을 엑셀 포맷으로 클립핑하기
// 매개변수 : ctrlList - 클립핑 할 리스트 컨트롤, nColCount - 컬럼 수
bool ClippingListBox(CListBox& ctrlList)
{
CString strBuffer;
strBuffer.Empty();
for(int nRow = 0; nRow < ctrlList.GetCount(); ++nRow)
{
CString strGetText;
ctrlList.GetText(nRow, strGetText);
strBuffer.AppendFormat(_T("%s"), strGetText);
strBuffer.AppendFormat(_T("\r\n"));
}
return CClipboard::SetText(strBuffer);
}
const char* GetMyINIString(const char* szSection, const char* szKey)
{
const char* szResult = CLogAnalyzeSetup::GetInstance().GetString(szSection, szKey, 0);
if(0 == szResult)
{
CString strErr;
strErr.Format("Setup string load failed! - key: %s", szKey);
AfxMessageBox(strErr, MB_ICONSTOP);
return "???";
}
return szResult;
}

View File

@@ -0,0 +1,9 @@
#ifndef _GAMELOGANALYZER_GLOBAL_FUNCTIONS_H_
#define _GAMELOGANALYZER_GLOBAL_FUNCTIONS_H_
bool ClippingListBox(CListBox& ctrlList); // 선택된 리스트박스 항목을 클립보드에 저장하기
const char* GetMyINIString(const char* szSection, const char* szKey);
#endif

View File

@@ -0,0 +1,53 @@
// InfoDlg.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "GameLogAnalyzer.h"
#include "InfoDlg.h"
// CInfoDlg 대화 상자입니다.
IMPLEMENT_DYNAMIC(CInfoDlg, CDialog)
CInfoDlg::CInfoDlg(const CString& szTitle, const CString& szDetail,
CWnd* pParent /*=NULL*/)
: CDialog(CInfoDlg::IDD, pParent), m_szTitle(szTitle), m_szDetail(szDetail)
{
}
CInfoDlg::~CInfoDlg()
{
}
void CInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT1, m_Info);
}
BEGIN_MESSAGE_MAP(CInfoDlg, CDialog)
END_MESSAGE_MAP()
// CInfoDlg 메시지 처리기입니다.
BOOL CInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 여기에 추가 초기화 작업을 추가합니다.
SetWindowText(m_szTitle);
m_InfoFont.CreatePointFont(90, "굴림체");
m_Info.SetFont(&m_InfoFont);
m_Info.SetWindowText(m_szDetail);
UpdateData(true);
return TRUE; // return TRUE unless you set the focus to a control
// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
}

View File

@@ -0,0 +1,32 @@
#pragma once
#include "afxwin.h"
// CInfoDlg 대화 상자입니다.
class CInfoDlg : public CDialog
{
DECLARE_DYNAMIC(CInfoDlg)
public:
CInfoDlg(const CString& szTitle, const CString& szDetail,
CWnd* pParent = NULL); // 표준 생성자입니다.
virtual ~CInfoDlg();
// 대화 상자 데이터입니다.
enum { IDD = IDD_DETAIL_INFO };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
DECLARE_MESSAGE_MAP()
CEdit m_Info;
CFont m_InfoFont;
const CString m_szDetail;
const CString m_szTitle;
public:
virtual BOOL OnInitDialog();
};

View File

@@ -0,0 +1,83 @@
// ItemInfoDlg.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "GameLogAnalyzer.h"
#include "ItemInfoDlg.h"
#include "PrintLog.h"
#include "GlobalFunctions.h"
// CItemInfoDlg 대화 상자입니다.
IMPLEMENT_DYNAMIC(CItemInfoDlg, CDialog)
CItemInfoDlg::CItemInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CItemInfoDlg::IDD, pParent)
{
}
CItemInfoDlg::~CItemInfoDlg()
{
}
void CItemInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_ITEM_LIST, m_ItemList);
DDX_Control(pDX, IDC_ITEMINFOEDIT, m_ItemInfo);
}
BEGIN_MESSAGE_MAP(CItemInfoDlg, CDialog)
ON_LBN_DBLCLK(IDC_ITEM_LIST, OnLbnDblclkItemList)
END_MESSAGE_MAP()
// CItemInfoDlg 메시지 처리기입니다.
bool CItemInfoDlg::Initialize(Item::CItemContainer* lpItemContainer)
{
m_lpItemContainer = lpItemContainer;
return true;
}
BOOL CItemInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: 여기에 추가 초기화 작업을 추가합니다.
m_Font.CreatePointFont(90, "굴림체");
SetFont(&m_Font);
m_ItemInfo.SetFont(&m_Font);
m_ItemList.SetFont(&m_Font);
if(m_lpItemContainer)
{
m_lpItemContainer->DumpItemInfo();
}
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
}
void CItemInfoDlg::OnLbnDblclkItemList()
{
int nIndex = m_ItemList.GetCurSel();
const Item::CItem* lpItem = static_cast<const Item::CItem*>(m_ItemList.GetItemDataPtr(nIndex));
if(NULL != lpItem)
{
CString ItemData = GetMyINIString("STRING_FOR_LOCALIZE", "ITEM_DETAIL_INFO");
GAMELOG::DetailInfo::ShowItemInfo(ItemData, lpItem);
}
}

View File

@@ -0,0 +1,35 @@
#pragma once
#include "afxwin.h"
#include <Item/Container/ItemContainer.h>
// CItemInfoDlg 대화 상자입니다.
class CItemInfoDlg : public CDialog
{
DECLARE_DYNAMIC(CItemInfoDlg)
public:
CItemInfoDlg(CWnd* pParent = NULL); // 표준 생성자입니다.
virtual ~CItemInfoDlg();
// 대화 상자 데이터입니다.
enum { IDD = IDD_ITEMINFO_PAGE };
bool Initialize(Item::CItemContainer* lpItemContainer);
CEdit& GetEditBox() { return m_ItemInfo; }
CListBox& GetListBox() { return m_ItemList; }
virtual BOOL OnInitDialog();
afx_msg void OnLbnDblclkItemList();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
DECLARE_MESSAGE_MAP()
CFont m_Font;
CEdit m_ItemInfo;
CListBox m_ItemList;
Item::CItemContainer* m_lpItemContainer;
};

View File

@@ -0,0 +1,92 @@
// ItemInfoPage.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "GameLogAnalyzer.h"
#include "ItemInfoPage.h"
#include "PrintLog.h"
#include "GlobalFunctions.h"
#include ".\iteminfopage.h"
// CItemInfoPage 대화 상자입니다.
IMPLEMENT_DYNAMIC(CItemInfoPage, CPropertyPage)
CItemInfoPage::CItemInfoPage()
: CPropertyPage(CItemInfoPage::IDD)
, m_lpItemContainer(NULL) , m_dwDepositMoney(0)
{
}
CItemInfoPage::~CItemInfoPage()
{
}
void CItemInfoPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
DDX_Control(pDX, IDC_ITEM_LIST, m_ItemList);
DDX_Control(pDX, IDC_ITEMINFOEDIT, m_ItemInfo);
}
BEGIN_MESSAGE_MAP(CItemInfoPage, CPropertyPage)
ON_LBN_DBLCLK(IDC_ITEM_LIST, OnLbnDblclkItemList)
ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
END_MESSAGE_MAP()
bool CItemInfoPage::Initialize(Item::CItemContainer* lpItemContainer, unsigned long dwDepositMoney)
{
m_lpItemContainer = lpItemContainer;
m_dwDepositMoney = dwDepositMoney;
return true;
}
// CItemInfoPage 메시지 처리기입니다.
BOOL CItemInfoPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_Font.CreatePointFont(90, "굴림체");
SetFont(&m_Font);
m_ItemInfo.SetFont(&m_Font);
m_ItemList.SetFont(&m_Font);
if(m_lpItemContainer)
{
m_lpItemContainer->DumpItemInfo();
}
if(m_dwDepositMoney)
{
m_lpItemContainer->DumpMoneyInfo(m_dwDepositMoney);
}
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
}
void CItemInfoPage::OnLbnDblclkItemList()
{
int nIndex = m_ItemList.GetCurSel();
const Item::CItem* lpItem =
static_cast<const Item::CItem*>(m_ItemList.GetItemDataPtr(nIndex));
if(NULL != lpItem)
{
CString ItemData = GetMyINIString("STRING_FOR_LOCALIZE", "ITEM_DETAIL_INFO");
GAMELOG::DetailInfo::ShowItemInfo(ItemData, lpItem);
}
}
void CItemInfoPage::OnBnClickedButton1()
{
ClippingListBox(m_ItemList);
}

View File

@@ -0,0 +1,42 @@
#pragma once
#include "afxwin.h"
#include <Item/Container/ItemContainer.h>
// CItemInfoPage 대화 상자입니다.
class CItemInfoPage : public CPropertyPage
{
DECLARE_DYNAMIC(CItemInfoPage)
public:
CItemInfoPage();
virtual ~CItemInfoPage();
// 대화 상자 데이터입니다.
enum { IDD = IDD_ITEMINFO_PAGE };
bool Initialize(Item::CItemContainer* lpItemContainer, unsigned long dwDepositMoney = 0);
CEdit& GetEditBox() { return m_ItemInfo; }
CListBox& GetListBox() { return m_ItemList; }
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
DECLARE_MESSAGE_MAP()
CEdit m_ItemInfo;
CListBox m_ItemList;
CFont m_Font;
unsigned long m_dwDepositMoney;
Item::CItemContainer* m_lpItemContainer;
public:
virtual BOOL OnInitDialog();
afx_msg void OnLbnDblclkItemList();
afx_msg void OnBnClickedButton1();
};

View File

@@ -0,0 +1,184 @@
// ItemInfoSheet.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "resource.h"
#include "GameLogAnalyzer.h"
#include "ItemInfoSheet.h"
#include "LogItemContainer.h"
// CItemInfoSheet
IMPLEMENT_DYNAMIC(CItemInfoSheet, CPropertySheet)
CItemInfoSheet::CItemInfoSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
: CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
std::fill_n(m_lpItemContainer, int(MAX_ITEM_INFO), reinterpret_cast<Item::CItemContainer*>(0));
}
CItemInfoSheet::CItemInfoSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
: CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
std::fill_n(m_lpItemContainer, int(MAX_ITEM_INFO), reinterpret_cast<Item::CItemContainer*>(0));
}
CItemInfoSheet::~CItemInfoSheet()
{
for(int nCount = 0; nCount < MAX_ITEM_INFO; ++nCount)
{
if(NULL != m_lpItemContainer[nCount])
{
delete m_lpItemContainer[nCount];
m_lpItemContainer[nCount] = NULL;
}
}
}
BEGIN_MESSAGE_MAP(CItemInfoSheet, CPropertySheet)
ON_WM_CLOSE()
END_MESSAGE_MAP()
bool CItemInfoSheet::Initialize(char* lpCharacterInfo,
unsigned short usUpdateInfo[DBUpdateData::MAX_UPDATE_DB],
char* szDepositData, unsigned short usDepositSize, unsigned long dwDepositMoney)
{
UINT nIDS[MAX_ITEM_INFO] =
{ IDS_EQUIP_INFO, IDS_INVEN_INFO, IDS_EXCHANGE_INFO, IDS_TEMPINVEN_INFO, IDS_EXTRA_INFO };
for(int nCount = 0; nCount < MAX_ITEM_INFO; ++nCount)
{
int nPos = DBUpdateData::MAX_UPDATE_DB;
CEdit& edit = m_ItemInfo[nCount].GetEditBox();
CListBox& listbox = m_ItemInfo[nCount].GetListBox();
Item::CItemContainer* lpItemContainer = NULL;
int nListSize = 0;
int nArrayXSize = 0, nArrayYSize = 0, nArrayTabNum = 0;
switch(nCount)
{
case EQUIP_INFO:
nPos = DBUpdateData::ITEM_EQUIP_UPDATE;
nListSize = Item::EquipmentPos::MAX_EQUPMENT_POS;
break;
case INVEN_INFO:
nPos = DBUpdateData::ITEM_INVEN_UPDATE;
nArrayXSize = 6; nArrayYSize = 6; nArrayTabNum = 4;
break;
case EXCHANGE_INFO:
nPos = DBUpdateData::ITEM_EXCHANGE_UPDATE;
nArrayXSize = 8; nArrayYSize = 4; nArrayTabNum = 1;
break;
case TEMPINVEN_INFO:
nPos = DBUpdateData::ITEM_TEMPINVEN_UPDATE;
nArrayXSize = 4; nArrayYSize = 6; nArrayTabNum = 1;
break;
case EXTRA_INFO:
nPos = DBUpdateData::ITEM_EXTRA_UPDATE;
nListSize = Item::ExtraSpacePos::MAX_EXTRA_SPACE_NUM;
break;
default:
continue;
}
char* szSerializePtr =
lpCharacterInfo + std::accumulate(&usUpdateInfo[0], &usUpdateInfo[nPos], 0);
unsigned long dwSerializeSize = usUpdateInfo[nPos];
switch(nCount)
{
case EQUIP_INFO:
case EXTRA_INFO:
{
Item::CLogListContainer* lpLogListContainer = new Item::CLogListContainer(listbox, edit);
if(NULL != lpLogListContainer)
{
if(lpLogListContainer->Initialize(0, Item::EquipmentPos::MAX_EQUPMENT_POS))
{
lpItemContainer = lpLogListContainer;
}
}
}
break;
case EXCHANGE_INFO:
case INVEN_INFO:
{
Item::CLogArrayContainer* lpLogArrayContainer = new Item::CLogArrayContainer(listbox, edit);
if(NULL != lpLogArrayContainer)
{
if(lpLogArrayContainer->Initialize(0, nArrayXSize, nArrayYSize, nArrayTabNum))
{
lpItemContainer = lpLogArrayContainer;
}
}
}
break;
case TEMPINVEN_INFO:
{
Item::CLogListContainer* lpLogListContainer = new Item::CLogListContainer(listbox, edit);
if(NULL != lpLogListContainer)
{
if(lpLogListContainer->Initialize(0, Item::MAX_TEMP_INVEN_ITEM_NUM))
{
lpItemContainer = lpLogListContainer;
}
}
}
break;
}
if(NULL != lpItemContainer)
{
lpItemContainer->SerializeIn(szSerializePtr, dwSerializeSize);
}
m_lpItemContainer[nCount] = lpItemContainer;
m_ItemInfo[nCount].Initialize(lpItemContainer);
m_ItemInfo[nCount].Construct(IDD_ITEMINFO_PAGE, nIDS[nCount]);
AddPage(&m_ItemInfo[nCount]);
}
Item::CLogArrayContainer* lpLogArrayContainer = new Item::CLogArrayContainer(m_Deposit.GetListBox(), m_Deposit.GetEditBox());
if(NULL != lpLogArrayContainer)
{
m_lpDeposit = lpLogArrayContainer;
lpLogArrayContainer->Initialize(0, 8, 12, 4);
lpLogArrayContainer->SerializeIn(szDepositData, usDepositSize);
m_Deposit.Initialize(lpLogArrayContainer, dwDepositMoney);
m_Deposit.Construct(IDD_ITEMINFO_PAGE, IDS_DEPOSIT_INFO);
AddPage(&m_Deposit);
}
return true;
}
BOOL CItemInfoSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
// TODO: 여기에 특수화된 코드를 추가합니다.
return bResult;
}
void CItemInfoSheet::OnClose()
{
// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
CPropertySheet::OnClose();
}

View File

@@ -0,0 +1,48 @@
#pragma once
#include <RylGameLibrary/Log/LogCommands.h>
#include <RylGameLibrary/Network/Packet/PacketStruct/CharLoginOutPacketStruct.h>
#include "ItemInfoPage.h"
// CItemInfoSheet
class CItemInfoSheet : public CPropertySheet
{
DECLARE_DYNAMIC(CItemInfoSheet)
public:
CItemInfoSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CItemInfoSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
virtual ~CItemInfoSheet();
bool Initialize(char* lpCharacterInfo, unsigned short usUpdateInfo[DBUpdateData::MAX_UPDATE_DB],
char* szDepositData, unsigned short usDepositSize, unsigned long dwDepositMoney);
protected:
DECLARE_MESSAGE_MAP()
enum
{
EQUIP_INFO = 0,
INVEN_INFO = 1,
EXCHANGE_INFO = 2,
TEMPINVEN_INFO = 3,
EXTRA_INFO = 4,
DEPOSIT_INFO = 5,
MAX_ITEM_INFO = 6
};
CItemInfoPage m_ItemInfo[MAX_ITEM_INFO];
Item::CItemContainer* m_lpItemContainer[MAX_ITEM_INFO];
CItemInfoPage m_Deposit;
Item::CItemContainer* m_lpDeposit;
virtual BOOL OnInitDialog();
private:
afx_msg void OnClose();
};

View File

@@ -0,0 +1,661 @@
#include "stdafx.h"
#include <algorithm>
#include "PrintLog.h"
#include "SearchClass.h"
#include "LogAnalyzer.h"
#include <RylGameLibrary/Log/LogCommands.h>
#include "GlobalFunctions.h"
#include "XListBox.h"
#include "CheckComboBox.h"
#include <GameGuardLib/ggsrv.h>
// edith 2009.08.11 게임가드 2.5 업그레이드
GGAUTHS_API void NpLog(int mode, char* msg)
{
}
GGAUTHS_API void GGAuthUpdateCallback(PGG_UPREPORT report)
{
}
struct CategoryInfo
{
typedef void PrintSimpleInfo(CString& Result, const GAMELOG::sLogBase* lpLogBase);
const char* m_szCategoryName;
unsigned char m_cCmd;
CXListBox::Color m_nFGColor;
CXListBox::Color m_nBGColor;
PrintSimpleInfo* m_lpSimpleInfo;
CategoryInfo() : m_szCategoryName(0), m_cCmd(0),
m_nFGColor(CXListBox::Black), m_nBGColor(CXListBox::White), m_lpSimpleInfo(0)
{
}
CategoryInfo(const char* szCategoryName, unsigned char cCmd,
CXListBox::Color nFGColor, CXListBox::Color nBGColor, PrintSimpleInfo* lpSimpleInfo)
: m_szCategoryName(szCategoryName), m_cCmd(cCmd),
m_nFGColor(nFGColor), m_nBGColor(nBGColor), m_lpSimpleInfo(lpSimpleInfo)
{
}
};
class CCategoryData
{
public:
CCategoryData();
static CCategoryData& GetInstance();
CategoryInfo* GetCategoryInfo(unsigned char cCmd)
{
return cCmd < GAMELOG::CMD::MAX_LOGCMD ? m_categoryInfo + cCmd : 0;
}
CategoryInfo* GetCategoryInfo(const char* szText)
{
CategoryInfo* lpPos = m_categoryInfo;
CategoryInfo* lpEnd = m_categoryInfo + GAMELOG::CMD::MAX_LOGCMD;
for(; lpPos != lpEnd; ++lpPos)
{
if(0 != lpPos->m_szCategoryName &&
0 == strcmp(lpPos->m_szCategoryName, szText))
{
return lpPos;
}
}
return 0;
}
private:
CategoryInfo m_categoryInfo[GAMELOG::CMD::MAX_LOGCMD];
};
CCategoryData& CCategoryData::GetInstance()
{
static CCategoryData categoryData;
return categoryData;
}
namespace GAMELOG
{
namespace CMD
{
const unsigned int ALL = 0;
};
};
CCategoryData::CCategoryData()
{
using namespace GAMELOG::SimpleInfo;
#define SET_CATEGORY_DATA(name, fgColor, bgColor, lpSimpleInfo) \
m_categoryInfo[GAMELOG::CMD::name] = \
CategoryInfo(#name, GAMELOG::CMD::name, fgColor, bgColor, lpSimpleInfo);
SET_CATEGORY_DATA(ALL, CXListBox::Black, CXListBox::White, 0);
SET_CATEGORY_DATA(CHAR_LOGIN, CXListBox::Yellow, CXListBox::Black, CharLogin);
SET_CATEGORY_DATA(CHAR_LOGOUT, CXListBox::Yellow, CXListBox::Black, CharLogout);
SET_CATEGORY_DATA(CHAR_CREATE, CXListBox::Black, CXListBox::White, CharCreate);
SET_CATEGORY_DATA(CHAR_DELETE, CXListBox::Black, CXListBox::WhitePink, CharDelete);
SET_CATEGORY_DATA(CHAR_DBUPDATE, CXListBox::Black, CXListBox::White, CharDBUpdate);
SET_CATEGORY_DATA(CHAR_LEVELUP, CXListBox::Black, CXListBox::White, CharLevelUp);
SET_CATEGORY_DATA(CHAR_BIND_POS, CXListBox::Black, CXListBox::White, CharBindPos);
SET_CATEGORY_DATA(CHAR_DEAD, CXListBox::Black, CXListBox::WhitePink, CharDead);
SET_CATEGORY_DATA(CHAR_RESPAWN, CXListBox::Black, CXListBox::White, CharRespawn);
SET_CATEGORY_DATA(MOVE_ITEM, CXListBox::Black, CXListBox::White, MoveItem);
SET_CATEGORY_DATA(SWAP_ITEM, CXListBox::Black, CXListBox::White, SwapItem);
SET_CATEGORY_DATA(USE_ITEM, CXListBox::Black, CXListBox::White, UseItem);
SET_CATEGORY_DATA(SPLIT_ITEM, CXListBox::Black, CXListBox::White, SplitItem);
SET_CATEGORY_DATA(PICKUP_ITEM, CXListBox::Black, CXListBox::White, PickupItem);
SET_CATEGORY_DATA(DROP_ITEM, CXListBox::Black, CXListBox::White, DropItem);
SET_CATEGORY_DATA(BUY_ITEM, CXListBox::Black, CXListBox::White, BuyItem);
SET_CATEGORY_DATA(SELL_ITEM, CXListBox::Black, CXListBox::White, SellItem);
SET_CATEGORY_DATA(USE_LOTTERY, CXListBox::Black, CXListBox::White, UseLottery);
SET_CATEGORY_DATA(BEFORE_EXCHANGE_ITEM, CXListBox::Black, CXListBox::Yellow, BeforeExchange);
SET_CATEGORY_DATA(AFTER_EXCHANGE_ITEM, CXListBox::Black, CXListBox::Yellow, AfterExchange);
SET_CATEGORY_DATA(INSTALL_SOCKET_ITEM, CXListBox::Black, CXListBox::White, InstallSocketItem);
SET_CATEGORY_DATA(REPAIR_ITEM, CXListBox::Black, CXListBox::White, RepairItem);
SET_CATEGORY_DATA(CHANGE_WEAPON, CXListBox::Black, CXListBox::White, ChangeWeapon);
SET_CATEGORY_DATA(TAKE_GOLD, CXListBox::Black, CXListBox::White, TakeGold);
SET_CATEGORY_DATA(UPGRADE_ITEM, CXListBox::Black, CXListBox::White, UpgradeItem);
SET_CATEGORY_DATA(STALL_OPEN_CLOSE, CXListBox::Black, CXListBox::White, StallOpenClose);
SET_CATEGORY_DATA(STALL_ENTER_LEAVE, CXListBox::Black, CXListBox::White, StallEnterLeave);
SET_CATEGORY_DATA(STALL_ITEM_REGISTER_REMOVE, CXListBox::Black, CXListBox::White, StallRegisterRemoveItem);
SET_CATEGORY_DATA(MEDAL_BUY_ITEM, CXListBox::Black, CXListBox::White, MedalItemBuy);
SET_CATEGORY_DATA(TAKE_GOLD_V2, CXListBox::Black, CXListBox::White, TakeGoldV2);
SET_CATEGORY_DATA(GUILD_CREATE, CXListBox::Black, CXListBox::White, GuildCreate);
SET_CATEGORY_DATA(GUILD_JOIN, CXListBox::Black, CXListBox::White, GuildJoin);
SET_CATEGORY_DATA(GUILD_MEMBER_LEVEL, CXListBox::Black, CXListBox::White, GuildMemberLevelAdjust);
SET_CATEGORY_DATA(GUILD_LEAVE, CXListBox::Black, CXListBox::White, GuildLeave);
SET_CATEGORY_DATA(GUILD_RIGHTS_CHANGE, CXListBox::Black, CXListBox::White, GuildRightsLevelChange);
SET_CATEGORY_DATA(GUILD_LEVEL_ADJUST, CXListBox::Black, CXListBox::White, GuildLevelChange);
SET_CATEGORY_DATA(GUILD_MARK_ADJUST, CXListBox::Black, CXListBox::White, GuildMarkChange);
SET_CATEGORY_DATA(GUILD_GOLD_CHANGE, CXListBox::Black, CXListBox::Yellow, GuildStoreGoldChange);
SET_CATEGORY_DATA(GUILD_DISSOLVE, CXListBox::Black, CXListBox::White, GuildDispose);
SET_CATEGORY_DATA(ZONE_MOVE, CXListBox::Black, CXListBox::White, ZoneMoveLog);
SET_CATEGORY_DATA(ITEM_ATTACH_OPTION, CXListBox::Black, CXListBox::White, ItemAttachOption);
SET_CATEGORY_DATA(ITEM_COMPENSATION, CXListBox::Black, CXListBox::SkyBlue, ItemCompensation);
SET_CATEGORY_DATA(TICKET_BUY_SKILLBOOK, CXListBox::Black, CXListBox::White, TicketBuySkillBook);
SET_CATEGORY_DATA(UPGRADE_ITEM_V2, CXListBox::Black, CXListBox::White, UpgradeItemV2);
SET_CATEGORY_DATA(MONSTER_DEAD, CXListBox::Black, CXListBox::White, MonsterDead);
SET_CATEGORY_DATA(FAME_GET_BATTLE, CXListBox::Black, CXListBox::White, FameGetBattle);
SET_CATEGORY_DATA(FAME_LOSE_BATTLE, CXListBox::Black, CXListBox::White, FameLoseBattle);
SET_CATEGORY_DATA(FAME_GET_CAMP, CXListBox::Black, CXListBox::White, FameGetCamp);
SET_CATEGORY_DATA(FAME_LOSE_CAMP, CXListBox::Black, CXListBox::White, FameLoseCamp);
SET_CATEGORY_DATA(QUEST_GET_REWARD, CXListBox::Black, CXListBox::White, QuestGetReward);
SET_CATEGORY_DATA(CHANGE_RIDE, CXListBox::Black, CXListBox::White, ChangeRide);
SET_CATEGORY_DATA(ILLEGAL_ITEM, CXListBox::White, CXListBox::Red, IllegalItem);
SET_CATEGORY_DATA(ILLEGAL_WARPPOS, CXListBox::White, CXListBox::Red, IllegalWarpPos);
SET_CATEGORY_DATA(HACK_DOUBT, CXListBox::White, CXListBox::Red, HackDoubt);
};
CLogAnalyzer::CLogAnalyzer()
: m_nCurrentIndex(0), m_dwShowMode(0)
{
m_ResultArray.reserve(5120);
memset(m_szFileName, 0, MAX_PATH);
}
CLogAnalyzer::~CLogAnalyzer()
{
Cleanup();
}
bool CLogAnalyzer::Initialize(HWND hWnd_In, CComboBox& SearchSort_Out, CCheckComboBox& Category_Out)
{
if(CB_ERR == SearchSort_Out.InsertString(0, "CID")) { return false; }
if(CB_ERR == SearchSort_Out.InsertString(1, "UID")) { return false; }
if(CB_ERR == SearchSort_Out.InsertString(2, "ItemUID")) { return false; }
if(CB_ERR == SearchSort_Out.InsertString(3, "IP")) { return false; }
if(CB_ERR == SearchSort_Out.InsertString(4, "ItemTypeID")) { return false; }
if(CB_ERR == SearchSort_Out.InsertString(5, "GID")) { return false; }
if(CB_ERR == SearchSort_Out.SetCurSel(0)) { return false; }
unsigned char nCount = 0;
unsigned char nStringNum = 0;
for(; nCount < GAMELOG::CMD::MAX_LOGCMD; ++nCount)
{
CategoryInfo* lpInfo = CCategoryData::GetInstance().GetCategoryInfo(nCount);
if(0 != lpInfo && 0 != lpInfo->m_szCategoryName)
{
if(CB_ERR == Category_Out.InsertString(nStringNum, lpInfo->m_szCategoryName))
{
return false;
}
Category_Out.SetItemData(nStringNum, nCount);
++nStringNum;
}
}
if(CB_ERR == Category_Out.SetCurSel(0)) { return false; }
memset(&m_OpenFile, 0, sizeof(OPENFILENAME));
m_OpenFile.lStructSize = sizeof(OPENFILENAME);
m_OpenFile.hwndOwner = hWnd_In;
m_OpenFile.lpstrFilter = "Log and ziped files\0*.zip;*.log\0All files\0*.*";
m_OpenFile.nMaxFile = MAX_PATH * MAX_PATH;
m_OpenFile.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_EXPLORER;
m_OpenFile.lpstrFile = m_szFileName;
return true;
}
bool CLogAnalyzer::Cleanup()
{
m_nCurrentIndex = 0;
m_ResultArray.clear();
return true;
}
bool CLogAnalyzer::Open()
{
Cleanup();
ZeroMemory(m_szFileName, MAX_PATH);
//if(!GetOpenFileName(&m_OpenFile))
//{
// return false;
//}
if (GetOpenFileName(&m_OpenFile))
return m_ParseLog.LoadFile(m_szFileName);
return true;
}
bool CLogAnalyzer::Search(CCheckComboBox& categoryValue_In,
const CString& SearchType_In, const CString& SearchValue_In,
const CTime& StartTime, const CTime& StopTime,
const CRegion& Region, const BOOL bSearchInResult)
{
m_nCurrentIndex = 0;
return Search(m_ParseLog, m_ResultArray, categoryValue_In,
SearchType_In, SearchValue_In, StartTime, StopTime, Region, bSearchInResult);
}
bool CLogAnalyzer::Search(CParseLog& ParseLog,
CParseLog::LogPtrArray& ResultArray,
CCheckComboBox& categoryValue_In,
const CString& SearchType_In, const CString& SearchValue_In,
const CTime& StartTime, const CTime& StopTime,
const CRegion& Region, const BOOL bSearchInResult)
{
CParseLog::LogPtrArray Result;
// 시간대 검색
if(bSearchInResult)
{
CParseLog::Find(ResultArray, Result, CTimeSearch(StartTime, StopTime));
ResultArray.swap(Result);
}
else
{
ParseLog.Find(ResultArray, CTimeSearch(StartTime, StopTime));
}
// 행동반경 검색
if(Region.IsValid())
{
CParseLog::Find(ResultArray, Result, CPositionSearch(Region));
ResultArray.swap(Result);
}
// CID, UID, ItemUID, ItemTypeID 로 검색
if(0 == SearchType_In.Compare("CID"))
{
CParseLog::Find(ResultArray, Result, CCIDSearch(SearchValue_In));
ResultArray.swap(Result);
}
else if(0 == SearchType_In.Compare("UID"))
{
CParseLog::Find(ResultArray, Result, CUIDSearch(SearchValue_In));
ResultArray.swap(Result);
}
else if(0 == SearchType_In.Compare("ItemUID"))
{
CParseLog::Find(ResultArray, Result, CItemUIDSearch(SearchValue_In));
ResultArray.swap(Result);
}
else if(0 == SearchType_In.Compare("IP"))
{
CParseLog::Find(ResultArray, Result, CIPSearch(SearchValue_In));
ResultArray.swap(Result);
}
else if(0 == SearchType_In.Compare("ItemTypeID"))
{
CParseLog::Find(ResultArray, Result, CItemTypeIDSearch(SearchValue_In));
ResultArray.swap(Result);
}
else if(0 == SearchType_In.Compare("GID"))
{
CParseLog::Find(ResultArray, Result, CGIDSearch(SearchValue_In));
ResultArray.swap(Result);
}
// ALL이 체크되어 있지 않으면 재검색.
int nCount = categoryValue_In.FindString(0, "ALL");
if(CB_ERR != nCount)
{
if(!categoryValue_In.GetCheck(nCount))
{
CString strText;
CCategory::CMDArray CMDArray;
for(int nIndex = 0; nIndex < categoryValue_In.GetCount(); ++nIndex)
{
if (categoryValue_In.GetCheck(nIndex))
{
categoryValue_In.GetLBText(nIndex, strText);
if(!strText.IsEmpty())
{
CategoryInfo* lpCategoryInfo =
CCategoryData::GetInstance().GetCategoryInfo(strText);
if(lpCategoryInfo)
{
CMDArray.push_back(lpCategoryInfo->m_cCmd);
}
}
}
}
std::sort(CMDArray.begin(), CMDArray.end());
CParseLog::Find(ResultArray, Result, CCategory(CMDArray));
ResultArray.swap(Result);
}
}
return true;
}
void CLogAnalyzer::Prev(CXListBox& Result, const size_t nShowNum, CString& Page)
{
if(m_nCurrentIndex > nShowNum)
{
m_nCurrentIndex -= nShowNum;
Show(Result, nShowNum, Page);
}
}
void CLogAnalyzer::Next(CXListBox& Result, const size_t nShowNum, CString& Page)
{
if(m_nCurrentIndex + nShowNum < m_ResultArray.size())
{
m_nCurrentIndex += nShowNum;
Show(Result, nShowNum, Page);
}
}
void CLogAnalyzer::MovePage(CXListBox& Result, const size_t nShowNum, CString& Page, unsigned int dwPageIndex)
{
if((nShowNum * dwPageIndex) < (m_ResultArray.size() + nShowNum))
{
m_nCurrentIndex = 0;
m_nCurrentIndex = nShowNum * (dwPageIndex - 1);
Show(Result, nShowNum, Page);
}
}
void CLogAnalyzer::SetShowMode(const BOOL bShowUID, const BOOL bShowCID,
const BOOL bShowTime, const BOOL bShowPosition)
{
m_dwShowMode = 0;
if(bShowUID) { m_dwShowMode = m_dwShowMode | GAMELOG::UID; }
if(bShowCID) { m_dwShowMode = m_dwShowMode | GAMELOG::CID; }
if(bShowTime) { m_dwShowMode = m_dwShowMode | GAMELOG::TIME; }
if(bShowPosition) { m_dwShowMode = m_dwShowMode | GAMELOG::POS; }
}
void CLogAnalyzer::Show(CXListBox& Result, const size_t nShowNum, CString& Page)
{
using namespace GAMELOG;
Result.ResetContent();
CXListBox::Color nBackColor = CXListBox::White;
CXListBox::Color nTextColor = CXListBox::Black;
CString LogLine;
CSize LogLineSize;
int nMaxSizeX = 0;
CDC* lpDC = Result.GetDC();
TEXTMETRIC tm;
lpDC->GetTextMetrics(&tm);
size_t nMaxShowNum = (m_ResultArray.size() < m_nCurrentIndex + nShowNum)
? m_ResultArray.size() : m_nCurrentIndex + nShowNum;
CParseLog::LogPtrArray::iterator begin = m_ResultArray.begin() + m_nCurrentIndex;
CParseLog::LogPtrArray::iterator end = m_ResultArray.begin() + nMaxShowNum;
CCategoryData& categoryData = CCategoryData::GetInstance();
for(int nCount = 0; begin != end; ++begin, ++nCount)
{
const sLogBase* lpLogBase = *begin;
LogLine = "";
SimpleInfo::BaseLog(LogLine, lpLogBase, m_dwShowMode);
nBackColor = CXListBox::White;
nTextColor = CXListBox::Black;
if(lpLogBase->m_cCmd < GAMELOG::CMD::MAX_LOGCMD)
{
CategoryInfo* lpInfo = categoryData.GetCategoryInfo(lpLogBase->m_cCmd);
if(0 != lpInfo && 0 != lpInfo->m_lpSimpleInfo)
{
lpInfo->m_lpSimpleInfo(LogLine, lpLogBase);
nTextColor = lpInfo->m_nFGColor;
nBackColor = lpInfo->m_nBGColor;
}
}
if(0 != LogLine.GetString())
{
LogLineSize = lpDC->GetTextExtent(LogLine);
LogLineSize.cx += tm.tmAveCharWidth;
if(LogLineSize.cx > nMaxSizeX)
{
nMaxSizeX = LogLineSize.cx;
}
Result.AddLine(nTextColor, nBackColor, LogLine);
}
}
Result.ReleaseDC(lpDC);
Result.SetHorizontalExtent(nMaxSizeX);
Page.Format(GetMyINIString("STRING_FOR_LOCALIZE", "FORMAT_002"),
m_nCurrentIndex/nShowNum + 1, m_ResultArray.size()/nShowNum + 1);
}
bool CLogAnalyzer::ShowDetail(int nSelect)
{
using namespace GAMELOG;
CParseLog::LogPtrArray::size_type nIndex = nSelect + m_nCurrentIndex;
if(nIndex >= m_ResultArray.size())
{
return false;
}
sLogBase* lpLogBase = m_ResultArray[nIndex];
CString DetailString;
switch(lpLogBase->m_cCmd)
{
case CMD::CHAR_LOGIN:
case CMD::CHAR_LOGOUT:
case CMD::CHAR_DBUPDATE: DetailInfo::ShowCharacterInfo(lpLogBase); break;
case CMD::CHAR_CREATE: DetailInfo::CharCreate(lpLogBase); break;
case CMD::CHAR_DELETE: DetailInfo::CharDelete(lpLogBase); break;
case CMD::CHAR_LEVELUP: DetailInfo::CharLevelUp(lpLogBase); break;
case CMD::CHAR_BIND_POS: DetailInfo::CharBindPos(lpLogBase); break;
case CMD::CHAR_DEAD: DetailInfo::CharDead(lpLogBase); break;
case CMD::CHAR_RESPAWN: DetailInfo::CharRespawn(lpLogBase); break;
case CMD::MOVE_ITEM: DetailInfo::MoveItem(lpLogBase); break;
case CMD::SWAP_ITEM: DetailInfo::SwapItem(lpLogBase); break;
case CMD::USE_ITEM: DetailInfo::UseItem(lpLogBase); break;
case CMD::SPLIT_ITEM: DetailInfo::SplitItem(lpLogBase); break;
case CMD::PICKUP_ITEM:
DetailString = GetMyINIString("STRING_FOR_LOCALIZE", "PICKUP_ITEM");
DetailInfo::PickupItem(DetailString, lpLogBase);
break;
case CMD::DROP_ITEM:
DetailString = GetMyINIString("STRING_FOR_LOCALIZE", "DROP_ITEM");
DetailInfo::DropItem(DetailString, lpLogBase);
break;
case CMD::USE_LOTTERY:
DetailInfo::UseLottery(lpLogBase);
break;
case CMD::SELL_ITEM:
DetailString = GetMyINIString("STRING_FOR_LOCALIZE", "SELL_ITEM");
DetailInfo::TradeItem(DetailString, lpLogBase);
break;
case CMD::BUY_ITEM:
DetailString = GetMyINIString("STRING_FOR_LOCALIZE", "BUY_ITEM");
DetailInfo::TradeItem(DetailString, lpLogBase);
break;
case CMD::BEFORE_EXCHANGE_ITEM:
case CMD::AFTER_EXCHANGE_ITEM:
DetailInfo::ExchangeItem(lpLogBase);
break;
case CMD::INSTALL_SOCKET_ITEM:
DetailInfo::InstallSocketItem(lpLogBase);
break;
case CMD::REPAIR_ITEM: break;
case CMD::CHANGE_WEAPON: break;
case CMD::TAKE_GOLD: break;
case CMD::UPGRADE_ITEM:
DetailInfo::UpgradeItem(lpLogBase);
break;
case CMD::STALL_OPEN_CLOSE: break;
case CMD::STALL_ENTER_LEAVE: break;
case CMD::STALL_ITEM_REGISTER_REMOVE: break;
case CMD::MEDAL_BUY_ITEM:
DetailString = GetMyINIString("STRING_FOR_LOCALIZE", "MEDAL_BUY_ITEM");
DetailInfo::TradeItem(DetailString, lpLogBase);
break;
case CMD::GUILD_CREATE:
case CMD::GUILD_JOIN:
case CMD::GUILD_MEMBER_LEVEL:
case CMD::GUILD_LEAVE:
case CMD::GUILD_LEVEL_ADJUST:
case CMD::GUILD_MARK_ADJUST:
case CMD::GUILD_GOLD_CHANGE:
case CMD::GUILD_DISSOLVE:
break;
case CMD::GUILD_RIGHTS_CHANGE:
DetailInfo::GuildRightsChange(lpLogBase);
break;
case CMD::ZONE_MOVE:
break;
case CMD::ITEM_ATTACH_OPTION:
DetailInfo::ItemAttachOption(lpLogBase);
break;
case CMD::ITEM_COMPENSATION:
DetailInfo::ItemCompensation(lpLogBase);
break;
case CMD::TICKET_BUY_SKILLBOOK:
DetailInfo::TradeItem(DetailString, lpLogBase);
break;
case CMD::UPGRADE_ITEM_V2:
DetailInfo::UpgradeItemV2(lpLogBase);
break;
case CMD::MONSTER_DEAD:
DetailInfo::MonsterDead(lpLogBase);
break;
case CMD::FAME_GET_BATTLE:
case CMD::FAME_LOSE_BATTLE:
case CMD::FAME_GET_CAMP:
case CMD::FAME_LOSE_CAMP:
case CMD::QUEST_GET_REWARD:
break;
case CMD::CHANGE_RIDE:
break;
case CMD::ILLEGAL_ITEM:
break;
case CMD::ILLEGAL_WARPPOS:
break;
case CMD::HACK_DOUBT:
DetailString = GetMyINIString("STRING_FOR_LOCALIZE", "BUY_ITEM");
DetailInfo::HackDoubtItem(DetailString, lpLogBase);
break;
default: return false;
}
return true;
}
bool CLogAnalyzer::WriteTextLog(const char* szFileName)
{
CFile WriteFile(szFileName, CFile::modeWrite | CFile::modeCreate);
CParseLog::LogPtrArray::iterator pos = m_ResultArray.begin();
CParseLog::LogPtrArray::iterator end = m_ResultArray.end();
CString LogLine;
CCategoryData& categoryData = CCategoryData::GetInstance();
for(;pos != end;++pos)
{
const GAMELOG::sLogBase* lpLogBase = *pos;
LogLine = "";
GAMELOG::SimpleInfo::BaseLog(LogLine, lpLogBase, m_dwShowMode);
if(lpLogBase->m_cCmd < GAMELOG::CMD::MAX_LOGCMD)
{
CategoryInfo* lpInfo = categoryData.GetCategoryInfo(lpLogBase->m_cCmd);
if(0 != lpInfo && 0 != lpInfo->m_lpSimpleInfo)
{
lpInfo->m_lpSimpleInfo(LogLine, lpLogBase);
LogLine += "\n";
}
}
if(0 != LogLine.GetString())
{
WriteFile.Write(LogLine, LogLine.GetLength());
}
}
return true;
}

View File

@@ -0,0 +1,65 @@
#ifndef _GAME_LOG_ANALYZE_H_
#define _GAME_LOG_ANALYZE_H_
#include <vector>
#include <numeric>
#include <algorithm>
#include <zlib/zlib.h>
#include <RylGameLibrary/Log/ParseLog.h>
// Àü¹æ ÂüÁ¶
class CRegion;
class CXListBox;
class CCheckComboBox;
class CLogAnalyzer
{
public:
CLogAnalyzer();
~CLogAnalyzer();
bool Initialize(HWND hWnd_In, CComboBox& SearchSort_Out, CCheckComboBox& Category_Out);
bool Open();
bool Search(CCheckComboBox& categoryValue_In,
const CString& SearchType_In, const CString& SearchValue_In,
const CTime& StartTime, const CTime& StopTime, const CRegion& Region,
const BOOL bSearchInResult);
static bool Search(CParseLog& ParseLog, CParseLog::LogPtrArray& ResultArray,
CCheckComboBox& categoryValue_In,
const CString& SearchType_In, const CString& SearchValue_In,
const CTime& StartTime, const CTime& StopTime, const CRegion& Region,
const BOOL bSearchInResult);
void SetShowMode(const BOOL bShowUID, const BOOL bShowCID,
const BOOL bShowTime, const BOOL bShowPosition);
void Show(CXListBox& Result, const size_t nShowNum, CString& Page);
void Prev(CXListBox& Result, const size_t nShowNum, CString& Page);
void Next(CXListBox& Result, const size_t nShowNum, CString& Page);
void MovePage(CXListBox& Result, const size_t nShowNum, CString& Page, unsigned int dwPageIndex);
bool ShowDetail(int nSelect);
bool Cleanup();
const char* GetFileName() { return m_szFileName; }
bool WriteTextLog(const char* szFileName);
protected:
CParseLog m_ParseLog;
CParseLog::LogPtrArray m_ResultArray;
CParseLog::LogPtrArray::size_type m_nCurrentIndex;
unsigned long m_dwShowMode;
OPENFILENAME m_OpenFile;
char m_szFileName[MAX_PATH * MAX_PATH];
};
#endif

View File

@@ -0,0 +1,120 @@
#include "stdafx.h"
#include "PrintLog.h"
#include "LogItemContainer.h"
#include <Item/Item.h>
#include <Item/ItemMgr.h>
#include <Utility/Math/Math.h>
#include "GlobalFunctions.h"
inline const char* GetItemName(unsigned short usProtoTypeID)
{
const Item::ItemInfo* lpItemInfo = Item::CItemMgr::GetInstance().GetItemInfo(usProtoTypeID);
return (NULL != lpItemInfo)
? lpItemInfo->m_SpriteData.m_szName : GetMyINIString("STRING_FOR_LOCALIZE", "UNKNOWN_ITEM");
}
void Item::CLogArrayContainer::DumpItemInfo()
{
CString LogLine;
int nIndex = 0;
for(int nTab = 0; nTab < m_nTabNum; ++nTab)
{
LogLine.AppendFormat("\r\n");
LogLine.AppendFormat(GetMyINIString("STRING_FOR_LOCALIZE", "FORMAT_003"), nTab);
LogLine.AppendFormat("\r\n");
for(int nHeight = 0; nHeight < m_nYSize; ++nHeight)
{
for(int nWidth = 0; nWidth < m_nXSize; ++nWidth)
{
Item::CItem* lpItem = m_lppItems[nWidth + nHeight * m_nXSize + nTab * m_nSizePerTab];
LogLine.AppendFormat(" %5d", (0 != lpItem) ? lpItem->GetPrototypeID() : 0);
}
LogLine.AppendFormat("\r\n");;
}
}
m_LogStringBox.SetWindowText(LogLine);
// ¾ÆÀÌÅÛ ´ýÇÁ
for(int nTab = 0; nTab < m_nTabNum; ++nTab)
{
for(int nHeight = 0; nHeight < m_nYSize; ++nHeight)
{
for(int nWidth = 0; nWidth < m_nXSize; ++nWidth)
{
Item::CItem* lpItem = m_lppItems[nWidth + nHeight * m_nXSize + nTab * m_nSizePerTab];
if(0 != lpItem && m_lpNullItem != lpItem)
{
char szUID[GAMELOG::MIN_BUFFER];
Math::Convert::Hex64ToStr(szUID, lpItem->GetUID());
LogLine.Format(GetMyINIString("STRING_FOR_LOCALIZE", "FORMAT_063"),
szUID, GetItemName(lpItem->GetPrototypeID()), lpItem->GetPrototypeID(),
nWidth, nHeight, nTab,
lpItem->GetItemInfo().m_DetailData.m_cXSize,
lpItem->GetItemInfo().m_DetailData.m_cYSize,
lpItem->IsSet(Item::DetailData::EQUIP)
? GetMyINIString("STRING_FOR_LOCALIZE", "DURABILITY") : GetMyINIString("STRING_FOR_LOCALIZE", "NUMS"),
lpItem->GetNumOrDurability());
m_LogListBox.InsertString(nIndex, LogLine);
m_LogListBox.SetItemDataPtr(nIndex, lpItem);
++nIndex;
}
}
}
}
CString testLogLine;
m_LogStringBox.GetWindowText(testLogLine);
}
void Item::CLogArrayContainer::DumpMoneyInfo(unsigned long dwDepositMoney)
{
std::string szMoney = GetMoneyString(dwDepositMoney);
CString LogLine;
LogLine.AppendFormat(GetMyINIString("STRING_FOR_LOCALIZE", "FORMAT_080"), szMoney.c_str());
LogLine.AppendFormat("\r\n");
m_LogStringBox.ReplaceSel(LogLine, true);
CArrayContainer::DumpMoneyInfo(dwDepositMoney);
}
void Item::CLogListContainer::DumpItemInfo()
{
CString szItemInfo;
unsigned int nItemNum = 0;
for(int nIndex = 0; nIndex < m_nMaxSize; ++nIndex)
{
CItem* lpItem = m_lppItems[nIndex];
if(NULL != lpItem)
{
char szUID[GAMELOG::MIN_BUFFER];
char szPosition[GAMELOG::MAX_BUFFER];
Math::Convert::Hex64ToStr(szUID, lpItem->GetUID());
GAMELOG::SimpleInfo::PositionToString(szPosition, GAMELOG::MAX_BUFFER, lpItem->GetPos());
szItemInfo.Format(GetMyINIString("STRING_FOR_LOCALIZE", "FORMAT_064"),
szPosition, szUID, GetItemName(lpItem->GetPrototypeID()), lpItem->GetPrototypeID(),
lpItem->IsSet(Item::DetailData::EQUIP)
? GetMyINIString("STRING_FOR_LOCALIZE", "DURABILITY") : GetMyINIString("STRING_FOR_LOCALIZE", "NUMS"),
lpItem->GetNumOrDurability());
m_LogListBox.InsertString(nItemNum, szItemInfo);
m_LogListBox.SetItemDataPtr(nItemNum, lpItem);
++nItemNum;
}
}
}

View File

@@ -0,0 +1,42 @@
#ifndef _LOG_ITEM_CONTAINER_H_
#define _LOG_ITEM_CONTAINER_H_
#include <Item/Container/ItemContainer.h>
namespace Item
{
class CLogArrayContainer : public CArrayContainer
{
public:
CLogArrayContainer(CListBox& LogListBox, CEdit& LogStringBox)
: m_LogListBox(LogListBox), m_LogStringBox(LogStringBox) { }
virtual void DumpItemInfo();
virtual void DumpMoneyInfo(unsigned long dwDepositMoney);
private:
CListBox& m_LogListBox;
CEdit& m_LogStringBox;
};
class CLogListContainer : public CListContainer
{
public:
CLogListContainer(CListBox& LogListBox, CEdit& LogStringBox)
: m_LogListBox(LogListBox), m_LogStringBox(LogStringBox) { }
virtual void DumpItemInfo();
private:
CListBox& m_LogListBox;
CEdit& m_LogStringBox;
unsigned long m_dwDepositMoney;
};
};
#endif

View File

@@ -0,0 +1,671 @@
#include "stdafx.h"
#pragma warning(disable:4800)
#include <Item/ItemFactory.h>
#include <Item/ItemConstants.h>
#include <Item/ItemMgr.h>
#include <Log/GuildLog.h>
#include <Log/LogStruct.h>
#include <Log/LogCommands.h>
#include <Map/FieldMap/Cell.h>
#include <Utility/Math/Math.h>
#include <Community/Guild/GuildConstants.h>
#include <Network/Packet/PacketStruct/GuildPacket.h>
#include "CharacterInfoDlg.h"
#include "InfoDlg.h"
#include "ItemInfoDlg.h"
#include "LogItemContainer.h"
#include "GlobalFunctions.h"
#include "PrintLog.h"
using namespace GAMELOG;
inline const char* GetItemName(unsigned short usProtoTypeID)
{
const Item::ItemInfo* lpItemInfo = Item::CItemMgr::GetInstance().GetItemInfo(usProtoTypeID);
return (NULL != lpItemInfo) ? lpItemInfo->m_SpriteData.m_szName : NULL;
}
inline const char* GetGradeString(Item::EquipType::Grade eGrade)
{
switch(eGrade)
{
case Item::EquipType::AAA_GRADE: return "AAA";
case Item::EquipType::AA_GRADE: return "AA";
case Item::EquipType::A_GRADE: return "A";
case Item::EquipType::B_GRADE: return "B";
case Item::EquipType::C_GRADE: return "C";
case Item::EquipType::D_GRADE: return "D";
case Item::EquipType::F_GRADE: return "F";
}
return "Unknown";
}
void CreateMonsterItemInfo(CString& szResult, unsigned long dwIndex, unsigned long dwKindID);
/*
void DetailInfo::CharLogin(const sLogBase* lpLogBase){ }
void DetailInfo::CharLogout(const sLogBase* lpLogBase){ }
void DetailInfo::CharDBUpdate(const sLogBase* lpLogBase){ }
*/
void DetailInfo::ShowCharacterInfo(const sLogBase* lpLogBase)
{
CCharacterInfoDlg* pCharInfoDlg = new CCharacterInfoDlg;
pCharInfoDlg->Create(IDD_CHARACTERINFODLG, AfxGetMainWnd());
pCharInfoDlg->ShowWindow(SW_SHOW);
if(!pCharInfoDlg->Initialize(lpLogBase))
{
pCharInfoDlg->OnClose();
}
}
void DetailInfo::GetMinItemInfo(CString& Result, const GAMELOG::sMinItemInfo& minItemInfo)
{
Result.AppendFormat("\r\n"
"UID : 0x%016I64X\r\n"
"ItemProtoTypeID : %5d\r\n"
"Num(Durability) : %5d\r\n",
minItemInfo.m_dwItemUID, minItemInfo.m_usProtoTypeID, minItemInfo.m_cNowDurability);
}
CString DetailInfo::GetDetailItemInfo(const Item::CItem* lpItem)
{
CString szItemInfo = "";
CString szItemGradeInfo = "";
Item::CEquipment* lpEquipment = Item::CEquipment::DowncastToEquipment(
const_cast<Item::CItem*>(lpItem));
if(0 != lpEquipment)
{
Item::Grade::GradeInfo gradeInfo = lpEquipment->GetItemGrade();
szItemGradeInfo.Format("(%s", GetGradeString(gradeInfo.m_eItemGrade));
szItemGradeInfo.Append("++++++++++++++++++++++++++++++++++++++", gradeInfo.m_cPlus);
szItemGradeInfo.Append(")");
}
szItemInfo.Format(
"Name : %18s%s\r\n"
"UID : 0x%016I64X\r\n"
"ItemProtoTypeID : %5d\r\n",
GetItemName(lpItem->GetPrototypeID()),
szItemGradeInfo, lpItem->GetUID(), lpItem->GetPrototypeID());
if(0 != lpEquipment)
{
// 장비 정보를 출력. 내구도, 소켓, 속성.
class CLogEquipment : public Item::CEquipment
{
public:
void LogEquipment(CString& szItemInfo)
{
int nCurrentSocketNum = 0;
int nCurrentAttributeNum = 0;
for(int nIndex = 0;
nIndex < Item::EquipmentInfo::MAX_SOCKET_NUM; ++nIndex)
{
if(0 != m_cSocket[nCurrentSocketNum])
{
szItemInfo.AppendFormat("GemID : %5d\r\n",
m_cSocket[nCurrentSocketNum] + Item::EtcItemID::GEM_START_ID - 1);
++nCurrentSocketNum;
}
}
for(int nIndex = 0;
nIndex < Item::Attribute::MAX_ATTRIBUTE_NUM; ++nIndex)
{
short wAttributeValue = GetAttribute(static_cast<Item::Attribute::Type>(nIndex));
if(0 != wAttributeValue)
{
++nCurrentAttributeNum;
// edith 2009.09.09 장비중 HP, MP의 증가율은 x10 배임
if(nIndex == Item::Attribute::MAX_HP || nIndex == Item::Attribute::MAX_MP)
{
wAttributeValue = wAttributeValue * 10;
}
szItemInfo.AppendFormat("AttributeType : %20s(%5d)\r\n",
Item::Attribute::Attributes[nIndex].GetTypeName(), wAttributeValue);
}
}
szItemInfo.AppendFormat(
"Durablility : %5d/%5d\r\n"
"Socket Nums : %5d/%5d\r\n"
"Attribute Nums : %5d/%5d\r\n"
"Upgrade Step : %5d\r\n"
"Season Record : %5d\r\n"
"Core Level : %5d\r\n",
m_ItemData.m_cNumOrDurability, GetMaxNumOrDurability(),
nCurrentSocketNum, m_cMaxSocket, nCurrentAttributeNum, m_cMaxAttribute,
m_cUpgradeLevel, m_cSeasonRecord, m_cCoreLevel);
}
};
static_cast<CLogEquipment*>(lpEquipment)->LogEquipment(szItemInfo);
}
else
{
// 기타 혹은 사용 아이템.
// 개수 출력. 사용 아이템이면 스킬 아이디와 스킬 레벨 출력
szItemInfo.AppendFormat("Current number : %5d\r\n", lpItem->GetNumOrDurability());
Item::CUseItem* lpUseItem = Item::CUseItem::DowncastToUseItem(
const_cast<Item::CItem*>(lpItem));
if(NULL != lpUseItem)
{
szItemInfo.AppendFormat("Skill ID : 0x%04x Skill Level : %5d",
lpUseItem->GetItemInfo().m_UseItemInfo.m_usSkill_ID,
lpUseItem->GetItemInfo().m_UseItemInfo.m_usSkill_LockCount);
}
}
return szItemInfo;
}
void DetailInfo::ShowItemInfo(CString& Title, const Item::CItem* lpItem)
{
CInfoDlg itemInfoDlg(Title, DetailInfo::GetDetailItemInfo(lpItem));
itemInfoDlg.DoModal();
}
void DetailInfo::ExchangeItem(const sLogBase* lpLogBase)
{
const GAMELOG::sExchangeItemLog* pExchangeItemLog =
static_cast<const GAMELOG::sExchangeItemLog*>(lpLogBase);
CItemInfoDlg itemInfoDlg;
Item::CLogArrayContainer LogArrayContainer(itemInfoDlg.GetListBox(), itemInfoDlg.GetEditBox());
if(LogArrayContainer.Initialize(0, 8, 4, 1))
{
if(LogArrayContainer.SerializeIn((char*)(&pExchangeItemLog[1]), pExchangeItemLog->m_usItemSize))
{
itemInfoDlg.Initialize(&LogArrayContainer);
itemInfoDlg.DoModal();
}
}
}
void DetailInfo::CharCreate(const sLogBase* lpLogBase){ }
void DetailInfo::CharDelete(const sLogBase* lpLogBase){ }
void DetailInfo::CharLevelUp(const sLogBase* lpLogBase){ }
void DetailInfo::CharBindPos(const sLogBase* lpLogBase){ }
void DetailInfo::CharDead(const sLogBase* lpLogBase){ }
void DetailInfo::CharRespawn(const sLogBase* lpLogBase){ }
void DetailInfo::MoveItem(const sLogBase* lpLogBase)
{
CString Result;
const sMoveItemLog* lpMoveItemLog = static_cast<const sMoveItemLog*>(lpLogBase);
const TakeType& takeType = lpMoveItemLog->m_takeType;
char szSrc[MIN_BUFFER], szDst[MIN_BUFFER];
SimpleInfo::PositionToString(szSrc, MIN_BUFFER, takeType.m_srcPos);
SimpleInfo::PositionToString(szDst, MIN_BUFFER, takeType.m_dstPos);
Result.AppendFormat("Item moved : %s->%s, %d(Num/Durability)",
szSrc, szDst, lpMoveItemLog->m_itemInfo.m_cNowDurability);
GetMinItemInfo(Result, lpMoveItemLog->m_itemInfo);
CInfoDlg itemInfoDlg("Item Move Info", Result);
itemInfoDlg.DoModal();
}
void DetailInfo::SwapItem(const sLogBase* lpLogBase)
{
}
void DetailInfo::UseItem(const sLogBase* lpLogBase)
{
}
void DetailInfo::UseLottery(const sLogBase* lpLogBase)
{
}
void DetailInfo::SplitItem(const sLogBase* lpLogBase)
{
}
void DetailInfo::PickupItem(CString& Title, const sLogBase* lpLogBase)
{
const sPickupItemLog* lpPickupItemLog = static_cast<const sPickupItemLog*>(lpLogBase);
if(0 == lpLogBase->m_cErr)
{
size_t nItemSize = Item::MAX_ITEM_SIZE;
Item::CItem* lpItem = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpPickupItemLog + sizeof(sPickupItemLog), nItemSize);
if(NULL != lpItem)
{
ShowItemInfo(Title, lpItem);
DELETE_ITEM(lpItem)
}
}
}
void DetailInfo::DropItem(CString& Title, const sLogBase* lpLogBase)
{
const sDropItemLog* lpDropItemLog = static_cast<const sDropItemLog*>(lpLogBase);
if(0 == lpLogBase->m_cErr)
{
size_t nItemSize = Item::MAX_ITEM_SIZE;
Item::CItem* lpItem = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpDropItemLog + sizeof(sDropItemLog), nItemSize);
if(NULL != lpItem)
{
ShowItemInfo(Title, lpItem);
DELETE_ITEM(lpItem)
}
}
}
void DetailInfo::TradeItem(CString& Title, const sLogBase* lpLogBase)
{
const sTradeItemLog* lpTradeItemLog = static_cast<const sTradeItemLog*>(lpLogBase);
if(0 == lpLogBase->m_cErr)
{
size_t nItemSize = Item::MAX_ITEM_SIZE;
Item::CItem* lpItem = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpTradeItemLog + sizeof(sTradeItemLog), nItemSize);
if(NULL != lpItem)
{
ShowItemInfo(Title, lpItem);
DELETE_ITEM(lpItem)
}
}
}
void DetailInfo::HackDoubtItem(CString& Title, const sLogBase* lpLogBase)
{
const sHockDoubtLog* lpDoubtItemLog = static_cast<const sHockDoubtLog*>(lpLogBase);
if(0 == lpLogBase->m_cErr)
{
size_t nItemSize = Item::MAX_ITEM_SIZE;
Item::CItem* lpItem = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpDoubtItemLog + sizeof(sHockDoubtLog), nItemSize);
if(NULL != lpItem)
{
ShowItemInfo(Title, lpItem);
DELETE_ITEM(lpItem)
}
}
}
void DetailInfo::InstallSocketItem(const sLogBase* lpLogBase)
{
}
void DetailInfo::UpgradeItem(const sLogBase* lpLogBase)
{
const sUpgradeItemLog* lpUpgradeItemLog = static_cast<const sUpgradeItemLog*>(lpLogBase);
CString Result;
if(0 == lpUpgradeItemLog->m_cErr)
{
size_t nMineralSize = Item::MAX_ITEM_SIZE;
size_t nEquipSize = Item::MAX_ITEM_SIZE;
if(0 != lpUpgradeItemLog->m_cMineralSize)
{
Item::CItem* lpMineral = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpUpgradeItemLog + sizeof(sUpgradeItemLog), nMineralSize);
if(NULL != lpMineral)
{
Result += GetDetailItemInfo(lpMineral);
DELETE_ITEM(lpMineral);
}
}
if(0 != lpUpgradeItemLog->m_cEquipSize)
{
Item::CItem* lpEquip = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpUpgradeItemLog + sizeof(sUpgradeItemLog) + lpUpgradeItemLog->m_cMineralSize, nEquipSize);
Item::CEquipment* lpEquipment = Item::CEquipment::DowncastToEquipment(lpEquip);
if(NULL != lpEquipment)
{
Result += GetDetailItemInfo(lpEquipment);
DELETE_ITEM(lpEquip);
}
}
CInfoDlg itemInfoDlg("Item Upgrade Info", Result);
itemInfoDlg.DoModal();
}
}
// 길드원 권한 설정
void DetailInfo::GuildRightsChange(const sLogBase* lpLogBase)
{
CString Result;
const sGuildLog* lpGuildLog = static_cast<const sGuildLog*>(lpLogBase);
CString szRightsString[Guild::MAX_RIGHT_SIZE];
szRightsString[GuildRight::PUT_STOREHOUSE] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_PUT_STOREHOUSE");
szRightsString[GuildRight::GET_STOREHOUSE] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_GET_STOREHOUSE");
szRightsString[GuildRight::USE_SAFE] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_USE_SAFE");
szRightsString[GuildRight::INVITE_MEMBER] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_INVITE_MEMBER");
szRightsString[GuildRight::PERMIT_JOIN] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_PERMIT_JOIN");
szRightsString[GuildRight::CHANGE_PASSWORD] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_CHANGE_PASSWORD");
//szRightsString[GuildRight::SETUP_RELATION] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_SETUP_RELATION");
//szRightsString[GuildRight::SETUP_RANK] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_SETUP_RANK");
szRightsString[GuildRight::REGULATE_TEX] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_REGULATE_TEX");
szRightsString[GuildRight::KICK_MEMBER] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_KICK_MEMBER");
szRightsString[GuildRight::BOARD_ADMIN] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_BOARD_ADMIN");
szRightsString[GuildRight::SETUP_MARK_N_LEVEL] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_SETUP_MARK_N_LEVEL");
szRightsString[GuildRight::SETUP_MIDDLE] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_SETUP_MIDDLE");
szRightsString[GuildRight::DIVIDE_GOLD] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_DIVIDE_GOLD");
szRightsString[GuildRight::SETUP_POLICY] = GetMyINIString("STRING_FOR_LOCALIZE", "GUILDRIGHTS_SETUP_POLICY");
const char* szRights = reinterpret_cast<const char*>(lpGuildLog + 1);
int nCountMax = min(lpGuildLog->m_usExtraDataSize, unsigned short(MAX_RIGHT_SIZE));
for(int nCount = 0; nCount < nCountMax; ++nCount)
{
if(!szRightsString[nCount].IsEmpty())
{
Result.AppendFormat("%30s : %s\r\n", szRightsString[nCount],
GuildTitle(szRights[nCount]));
}
}
CInfoDlg itemInfoDlg("Guild rights level changed", Result);
itemInfoDlg.DoModal();
}
void DetailInfo::ItemAttachOption(const sLogBase* lpLogBase)
{
const sItemAttachOption* lpItemAttach = static_cast<const sItemAttachOption*>(lpLogBase);
if (0 == lpItemAttach->m_cErr &&
0 != lpItemAttach->m_cOldItemLen &&
0 != lpItemAttach->m_cUseItemLen &&
0 != lpItemAttach->m_cNewItemLen)
{
const char* szOldItem = reinterpret_cast<const char*>(lpItemAttach + 1);
const char* szUseItem = szOldItem + lpItemAttach->m_cOldItemLen;
const char* szNewItem = szUseItem + lpItemAttach->m_cUseItemLen;
size_t nItemLen = lpItemAttach->m_cOldItemLen;
Item::CItem* lpOldItem = Item::CItemFactory::GetInstance().CreateItem(szOldItem, nItemLen);
nItemLen = lpItemAttach->m_cUseItemLen;
Item::CItem* lpUseItem = Item::CItemFactory::GetInstance().CreateItem(szUseItem, nItemLen);
nItemLen = lpItemAttach->m_cNewItemLen;
Item::CItem* lpNewItem = Item::CItemFactory::GetInstance().CreateItem(szNewItem, nItemLen);
Item::CEquipment* lpOldEquipment = Item::CEquipment::DowncastToEquipment(lpOldItem);
Item::CEquipment* lpUseEquipment = Item::CEquipment::DowncastToEquipment(lpUseItem);
Item::CEquipment* lpNewEquipment = Item::CEquipment::DowncastToEquipment(lpNewItem);
if(0 != lpOldEquipment && 0 != lpUseEquipment && 0 != lpNewEquipment)
{
const char* szAttributeName =
Item::Attribute::Attributes[lpItemAttach->m_cSelectedOptionIndex].GetTypeName();
Item::Attribute::Type eAttrType =
static_cast<Item::Attribute::Type>(lpItemAttach->m_cSelectedOptionIndex);
CString szTitle;
CString szResult;
szTitle.Format("Item option attach : %s / UsedGold : %10u",
Item::Attribute::Attributes[eAttrType].GetTypeName(),
lpItemAttach->m_dwOldInvenGold - lpItemAttach->m_dwNewInvenGold);
szResult = "[Old Item]\r\n" + GetDetailItemInfo(lpOldEquipment);
szResult += "\r\n[Sacrifice Item]\r\n" + GetDetailItemInfo(lpUseEquipment);
szResult += "\r\n[New Item]\r\n" + GetDetailItemInfo(lpNewEquipment);
CInfoDlg infoDlg(szTitle, szResult);
infoDlg.DoModal();
}
DELETE_ITEM(lpOldItem);
DELETE_ITEM(lpUseItem);
DELETE_ITEM(lpNewItem);
}
}
void DetailInfo::ItemCompensation(const sLogBase* lpLogBase)
{
const sItemCompensation* lpItemCompensation = static_cast<const sItemCompensation*>(lpLogBase);
if (0 == lpItemCompensation->m_cErr &&
0 != lpItemCompensation->m_cOldItemLen &&
0 != lpItemCompensation->m_cNewItemLen)
{
const char* szOldItem = reinterpret_cast<const char*>(lpItemCompensation + 1);
const char* szNewItem = szOldItem + lpItemCompensation->m_cOldItemLen;
size_t nItemLen = lpItemCompensation->m_cOldItemLen;
Item::CItem* lpOldItem = Item::CItemFactory::GetInstance().CreateItem(szOldItem, nItemLen);
nItemLen = lpItemCompensation->m_cNewItemLen;
Item::CItem* lpNewItem = Item::CItemFactory::GetInstance().CreateItem(szNewItem, nItemLen);
Item::CEquipment* lpOldEquipment = Item::CEquipment::DowncastToEquipment(lpOldItem);
Item::CEquipment* lpNewEquipment = Item::CEquipment::DowncastToEquipment(lpNewItem);
if(0 != lpOldEquipment && 0 != lpNewEquipment)
{
long nGold = lpItemCompensation->m_dwOldInvenGold - lpItemCompensation->m_dwNewInvenGold;
unsigned long dwGetGold = nGold < 0 ? -nGold : 0;
unsigned long dwUsedGold = 0 < nGold ? nGold : 0;
CString szTitle;
CString szResult;
szTitle.Format("Item compension : GetGold : %10u / UsedGold : %10u", dwGetGold, dwUsedGold);
szResult = "[Old Item]\r\n" + GetDetailItemInfo(lpOldEquipment);
szResult += "\r\n[New Item]\r\n" + GetDetailItemInfo(lpNewEquipment);
CInfoDlg infoDlg(szTitle, szResult);
infoDlg.DoModal();
}
DELETE_ITEM(lpOldItem);
DELETE_ITEM(lpNewItem);
}
}
void DetailInfo::UpgradeItemV2(const sLogBase* lpLogBase)
{
const sUpgradeItemLogV2* lpUpgradeItemLogV2 = static_cast<const sUpgradeItemLogV2*>(lpLogBase);
CString Result;
if(0 == lpUpgradeItemLogV2->m_cErr)
{
size_t nMineralSize = Item::MAX_ITEM_SIZE;
size_t nEquipSize = Item::MAX_ITEM_SIZE;
unsigned char cUpgradeLevel = 0;
if(0 != lpUpgradeItemLogV2->m_cMineralSize)
{
Item::CItem* lpMineral = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpUpgradeItemLogV2 + sizeof(sUpgradeItemLogV2), nMineralSize);
if(NULL != lpMineral)
{
Result += GetDetailItemInfo(lpMineral);
DELETE_ITEM(lpMineral);
}
}
if(0 != lpUpgradeItemLogV2->m_cEquipSize)
{
Item::CItem* lpEquip = Item::CItemFactory::GetInstance().CreateItem(
(const char*)lpUpgradeItemLogV2 + sizeof(sUpgradeItemLogV2) + lpUpgradeItemLogV2->m_cMineralSize, nEquipSize);
Item::CEquipment* lpEquipment = Item::CEquipment::DowncastToEquipment(lpEquip);
if(NULL != lpEquipment)
{
cUpgradeLevel = lpEquipment->GetUpgradeLevel();
Result += GetDetailItemInfo(lpEquipment);
DELETE_ITEM(lpEquip);
}
}
CString szHeader;
szHeader.Format("Item Upgrade %u to %u",
lpUpgradeItemLogV2->m_cLastUpgradeLevel, cUpgradeLevel);
CInfoDlg itemInfoDlg(szHeader, Result);
itemInfoDlg.DoModal();
}
}
void DetailInfo::MonsterDead(const sLogBase* lpLogBase)
{
const sMonsterDeadLog* lpMonsterDeadLog =
static_cast<const sMonsterDeadLog*>(lpLogBase);
CString szResult;
const unsigned long* lpdwItemIndexPos = reinterpret_cast<const unsigned long*>(lpMonsterDeadLog + 1);
const unsigned long* lpdwItemIndexEnd = lpdwItemIndexPos + lpMonsterDeadLog->m_cDropItemNum;
for(unsigned long dwIndex = 0;
lpdwItemIndexPos != lpdwItemIndexEnd; ++lpdwItemIndexPos, ++dwIndex)
{
CreateMonsterItemInfo(szResult, dwIndex, *lpdwItemIndexPos);
}
CInfoDlg itemInfoDlg("Monster Dead", szResult);
itemInfoDlg.DoModal();
}
void CreateMonsterItemInfo(CString& szResult, unsigned long dwIndex, unsigned long dwKindID)
{
// TODO : 컴파일 에러가 나서 주석 처리해둡니다. 필요하신 분이 수정해주세요. (2005-01-26 by 로딘)
/*
Item::CItemFactory& ItemFactory = Item::CItemFactory::GetInstance();
// 몬스터가 떨군 것
if (dwKindID & CCell::MONEY_BIT)
{
// 돈
unsigned long dwMoney = dwKindID & ~CCell::TYPE_CHECK_BIT;
szResult.AppendFormat("%2u : %10u Gold Dropped\r\n\r\n", dwIndex, dwMoney);
}
else if (dwKindID & CCell::EQUIP_BIT)
{
const Item::ItemInfo* lpItemInfo = Item::CItemMgr::GetInstance().GetItemInfo(
static_cast<unsigned short>(dwKindID & CCell::ITEM_PROTOTYPE_ID_BIT));
if(0 != lpItemInfo)
{
// 장비
Item::CItem* lpItem = ItemFactory.CreateTempItem(*lpItemInfo);
Item::CEquipment* lpEquip = Item::CEquipment::DowncastToEquipment(lpItem);
if (0 != lpEquip)
{
lpEquip->AddRandomOption(static_cast<Item::EquipType::Grade>(
(dwKindID & ~(CCell::TYPE_CHECK_BIT | CCell::ITEM_PROTOTYPE_ID_BIT)) >> 16));
lpEquip->SetNewEquip();
lpEquip->SetUID(0LL);
szResult.AppendFormat("%2u : Dropped equip info(ignore itemUID)\r\n", dwIndex);
szResult += DetailInfo::GetDetailItemInfo(lpEquip);
szResult.AppendFormat("\r\n\r\n");
}
else
{
szResult.AppendFormat("%2u : Item create failed - KindID(0x%08X)\r\n", dwIndex, dwKindID);
}
DELETE_ITEM(lpItem);
}
else
{
szResult.AppendFormat("%2u : Item create failed - KindID(0x%08X)\r\n", dwIndex, dwKindID);
}
}
else
{
// 기타 아이템
const Item::ItemInfo* lpItemInfo = Item::CItemMgr::GetInstance().GetItemInfo(
static_cast<unsigned short>(dwKindID));
if(0 != lpItemInfo)
{
Item::CItem* lpItem = ItemFactory.CreateTempItem(*lpItemInfo);
if (0 != lpItem)
{
lpItem->SetNumOrDurability(1);
szResult.AppendFormat("%2u : Dropped item info(ignore itemUID)\r\n", dwIndex);
szResult += DetailInfo::GetDetailItemInfo(lpItem);
szResult.AppendFormat("\r\n\r\n");
}
else
{
szResult.AppendFormat("%2u : Item create failed - KindID(0x%08X)\r\n", dwIndex, dwKindID);
}
DELETE_ITEM(lpItem);
}
else
{
szResult.AppendFormat("%2u : Item create failed - KindID(0x%08X)\r\n", dwIndex, dwKindID);
}
}
*/
}

View File

@@ -0,0 +1,161 @@
#ifndef _PRINT_LOG_H_
#define _PRINT_LOG_H_
#include <RylGameLibrary/Utility/TypeArray.h>
#include <RylGameLibrary/Item/Item.h>
#include <RylGameLibrary/Item/ItemStructure.h>
namespace GAMELOG
{
// 전방 참조
struct sLogBase;
struct sMinItemInfo;
enum
{
MIN_BUFFER = 64,
MAX_BUFFER = 512
};
enum
{
TIME = 1 << 0,
UID = 1 << 1,
CID = 1 << 2,
POS = 1 << 3,
};
const char* GuildLogType(const char cType);
const char* GuildTitle(unsigned long dwTitle);
namespace SimpleInfo
{
bool InitPositionData();
int PositionToString(char* lpBuffer_Out, const int nBufferSize, const Item::ItemPos itemPos);
const char* GetPositionName(unsigned char cPos);
const char* GetExtraPosString(unsigned char cIndex);
void BaseLog(CString& Result, const sLogBase* lpLogBase, const DWORD dwLogType);
void CharLogin(CString& Result, const sLogBase* lpLogBase);
void CharLogout(CString& Result, const sLogBase* lpLogBase);
void CharCreate(CString& Result, const sLogBase* lpLogBase);
void CharDelete(CString& Result, const sLogBase* lpLogBase);
void CharDBUpdate(CString& Result, const sLogBase* lpLogBase);
void CharLevelUp(CString& Result, const sLogBase* lpLogBase);
void CharBindPos(CString& Result, const sLogBase* lpLogBase);
void CharDead(CString& Result, const sLogBase* lpLogBase);
void CharRespawn(CString& Result, const sLogBase* lpLogBase);
// 아이템 관련
void MoveItem(CString& Result, const sLogBase* lpLogBase);
void SwapItem(CString& Result, const sLogBase* lpLogBase);
void UseItem(CString& Result, const sLogBase* lpLogBase);
void SplitItem(CString& Result, const sLogBase* lpLogBase);
void UseLottery(CString& Result, const sLogBase* lpLogBase);
void PickupItem(CString& Result, const sLogBase* lpLogBase);
void DropItem(CString& Result, const sLogBase* lpLogBase);
void SellItem(CString& Result, const sLogBase* lpLogBase);
void BuyItem(CString& Result, const sLogBase* lpLogBase);
void BeforeExchange(CString& Result, const sLogBase* lpLogBase);
void AfterExchange(CString& Result, const sLogBase* lpLogBase);
void InstallSocketItem(CString& Result, const sLogBase* lpLogBase);
void RepairItem(CString& Result, const sLogBase* lpLogBase);
void ChangeWeapon(CString& Result, const sLogBase* lpLogBase);
void ChangeRide(CString& Result, const sLogBase* lpLogBase);
void IllegalItem(CString& Result, const sLogBase* lpLogBase);
void IllegalWarpPos(CString& Result, const sLogBase* lpLogBase);
void HackDoubt(CString& Result, const sLogBase* lpLogBase);
void TakeGold(CString& Result, const sLogBase* lpLogBase);
void TakeGoldV2(CString& Result, const sLogBase* lpLogBase);
void UpgradeItem(CString& Result, const sLogBase* lpLogBase);
// 노점상 관련
void StallOpenClose(CString& Result, const sLogBase* lpLogBase);
void StallEnterLeave(CString& Result, const sLogBase* lpLogBase);
void StallRegisterRemoveItem(CString& Result, const sLogBase* lpLogBase);
// 메달 상점 관련
void MedalItemBuy(CString& Result, const sLogBase* lpLogBase);
// 길드 관련 로그들.
void GuildCreate(CString& Result, const sLogBase* lpLogBase); // 길드 생성
void GuildJoin(CString& Result, const sLogBase* lpLogBase); // 길드 가입
void GuildLeave(CString& Result, const sLogBase* lpLogBase); // 길드 탈퇴
void GuildMemberLevelAdjust(CString& Result, const sLogBase* lpLogBase); // 길드원 등급 변경
void GuildRightsLevelChange(CString& Result, const sLogBase* lpLogBase); // 길드원 권한 설정
void GuildLevelChange(CString& Result, const sLogBase* lpLogBase); // 길드 레벨 변경
void GuildMarkChange(CString& Result, const sLogBase* lpLogBase); // 길드마크 등록/변경
void GuildStoreGoldChange(CString& Result, const sLogBase* lpLogBase); // 길드 금고 변경
void GuildDispose(CString& Result, const sLogBase* lpLogBase); // 길드 소멸됨
// 존 이동 로그.
void ZoneMoveLog(CString& Result, const sLogBase* lpLogBase); // 캐릭터 존 이동
void ItemAttachOption(CString& Result, const sLogBase* lpLogBase); // 아이템 옵션 이식
void ItemCompensation(CString& Result, const sLogBase* lpLogBase); // 아이템 보상
void TicketBuySkillBook(CString& Result, const sLogBase* lpLogBase); // 교환권으로 스킬북 사기
void UpgradeItemV2(CString& Result, const sLogBase* lpLogBase); // 아이템 업그레이드 로그
void MonsterDead(CString& Result, const sLogBase* lpLogBase); // 몬스터 사망 로그
void FameGetBattle(CString& Result, const sLogBase* lpLogBase); // 전투로 얻은 명성
void FameLoseBattle(CString& Result, const sLogBase* lpLogBase); // 전투로 잃은 명성
void FameGetCamp(CString& Result, const sLogBase* lpLogBase); // 요새로 얻은 명성
void FameLoseCamp(CString& Result, const sLogBase* lpLogBase); // 요새로 잃은 명성
void QuestGetReward(CString& Result, const sLogBase* lpLogBase); // 퀘스트 수행으로 얻은 보상
};
namespace DetailInfo
{
void ShowCharacterInfo(const sLogBase* lpLogBase);
void ShowItemInfo(CString& Title, const Item::CItem* lpItem);
void GetMinItemInfo(CString& Result, const GAMELOG::sMinItemInfo& minItemInfo);
CString GetDetailItemInfo(const Item::CItem* lpItem);
void CharCreate(const sLogBase* lpLogBase);
void CharDelete(const sLogBase* lpLogBase);
void CharLevelUp(const sLogBase* lpLogBase);
void CharBindPos(const sLogBase* lpLogBase);
void CharDead(const sLogBase* lpLogBase);
void CharRespawn(const sLogBase* lpLogBase);
void MoveItem(const sLogBase* lpLogBase);
void SwapItem(const sLogBase* lpLogBase);
void UseItem(const sLogBase* lpLogBase);
void SplitItem(const sLogBase* lpLogBase);
void UseLottery(const sLogBase* lpLogBase);
void PickupItem(CString& Title, const sLogBase* lpLogBase);
void DropItem(CString& Title, const sLogBase* lpLogBase);
void TradeItem(CString& Title, const sLogBase* lpLogBase);
void HackDoubtItem(CString& Title, const sLogBase* lpLogBase);
void ExchangeItem(const sLogBase* lpLogBase);
void InstallSocketItem(const sLogBase* lpLogBase);
void UpgradeItem(const sLogBase* lpLogBase);
void GuildRightsChange(const sLogBase* lpLogBase); // 길드원 권한 설정
void ItemAttachOption(const sLogBase* lpLogBase);
void ItemCompensation(const sLogBase* lpLogBase);
void UpgradeItemV2(const sLogBase* lpLogBase);
void MonsterDead(const sLogBase* lpLogBase); // 몬스터 사망 로그
};
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,77 @@
================================================================================
MFC 라이브러리 : GameLogAnalyzer 프로젝트 개요
================================================================================
응용 프로그램 마법사를 사용하여 GameLogAnalyzer 응용 프로그램을 만듭니다. 이 응용
프로그램에서는 기본적인 MFC 사용 밥법과 응용 프로그램 작성 방법을 설명합니다.
이 파일에는 GameLogAnalyzer 응용 프로그램을 구성하는 각 파일에 대한 개요가 포함되어
있습니다.
GameLogAnalyzer.vcproj
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 주 프로젝트 파일입니다.
이 파일에는 파일을 생성한 Visual C++ 버전 정보 및 응용 프로그램 마법사에서 선택한 플랫폼,
구성, 프로젝트 기능 등의 정보가 포함됩니다.
GameLogAnalyzer.h
응용 프로그램의 주 헤더 파일입니다. 이 파일에는 다른 프로젝트에 관련된 Resource.h와 같은
특정 헤더가 포함되며 CGameLogAnalyzerApp 응용 프로그램 클래스가 선언됩니다.
GameLogAnalyzer.cpp
CGameLogAnalyzerApp 응용 프로그램 클래스를 포함하는 주 응용 프로그램의 소스 파일입니다.
GameLogAnalyzer.rc
프로그램에서 사용하는 모든 Microsoft Windows 리소스가 나열된 파일입니다.
이 파일에는 RES 하위 디렉터리에 저장된 아이콘, 비트맵 및 커서가 포함되며
Microsoft Visual C++에서 직접 이 파일을 편집할 수도 있습니다. 사용자의 프로젝트
리소스는 1042에 들어 있습니다.
res\GameLogAnalyzer.ico
응용 프로그램의 아이콘으로 사용되는 아이콘 파일입니다.
이 아이콘은 주 리소스 파일인 GameLogAnalyzer.rc에 포함됩니다.
res\GameLogAnalyzer.rc2
Microsoft Visual C++에서 편집할 수 없는 리소스가 포함된 파일입니다.
리소스 편집기에서 편집할 수 없는 모든 리소스는 이 파일에 포함되어 있습니다.
/////////////////////////////////////////////////////////////////////////////
응용 프로그램 마법사에서는 단일 대화 상자 클래스를 만듭니다.
GameLogAnalyzerDlg.h, GameLogAnalyzerDlg.cpp - 대화 상자
CGameLogAnalyzerDlg 클래스를 포함하는 파일입니다. 이 클래스에는 응용 프로그램의
주 대화 상자에 대한 동작이 정의됩니다. 대화 상자의 템플릿은 GameLogAnalyzer.rc에
있으며 Microsoft Visual C++에서 편집할 수 있습니다.
/////////////////////////////////////////////////////////////////////////////
기타 기능
ActiveX 컨트롤
응용 프로그램에서 ActiveX 컨트롤을 사용할 수 있습니다.
/////////////////////////////////////////////////////////////////////////////
기타 표준 파일
StdAfx.h, StdAfx.cpp
미리 컴파일된 헤더 파일(PCH) GameLogAnalyzer.pch 및 미리 컴파일된
형식 파일 StdAfx.obj를 빌드할 때 사용되는 파일입니다.
Resource.h
새로운 리소스 ID를 정의하는 표준 헤더 파일입니다.
Microsoft Visual C++에서 이 파일을 읽고 업데이트합니다.
/////////////////////////////////////////////////////////////////////////////
기타 정보
응용 프로그램 마법사에서는 "TODO:"를 사용하여 추가하거나 사용자 지정해야 하는
소스 코드를 나타냅니다.
응용 프로그램에서 공유 DLL에 MFC를 사용하고 응용 프로그램의 언어가 운영 체제의
언어와 다른 경우 Microsoft Visual C++ CD-ROM의 Win\System 디렉터리에 있는
해당 지역의 리소스인 MFC70XXX.DLL을 컴퓨터의 system 또는 system32 디렉터리에
복사한 다음 MFCLOC.DLL로 이름을 바꾸어야 합니다. "XXX"는 해당 언어를 나타내는
약어입니다. 예를 들어 MFC70DEU.DLL에는 독일어로 변환된 리소스가 포함됩니다.
이런 작업을 하지 않으면 응용 프로그램의 일부 UI 요소가 운영 체제의 언어로
남아 있게 됩니다.
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,98 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by GameLogAnalyzer.rc
//
#define IDR_MANIFEST 1
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_GAMELOGANALYZER_DIALOG 102
#define IDS_EQUIP_INFO 102
#define IDD_CHARACTERINFODLG 103
#define IDS_INVEN_INFO 103
#define IDS_EXCHANGE_INFO 104
#define IDS_EXTRA_INFO 105
#define IDS_DEPOSIT_INFO 106
#define IDS_TEMPINVEN_INFO 107
#define IDD_ITEMINFODLG 130
#define IDD_ITEMINFO_PAGE 130
#define IDD_DETAIL_INFO 131
#define IDR_RESULT_LISTBOX 132
#define IDI_ICON1 135
#define IDR_MAINFRAME 135
#define IDC_PREV_BUTTON 1001
#define IDC_NEXT_BUTTON 1002
#define IDC_SEARCH_TYPE_COMBO 1003
#define IDC_READ_FILE_SELECT_BUTTON 1004
#define IDC_SEARCH_BUTTON 1005
#define IDC_VIEW_NUM_COMBO 1006
#define IDC_RESULT_LIST 1007
#define IDC_GOPAGE_BTN 1008
#define IDC_CHARACTER_STATUS_LIST 1009
#define IDC_SEARCH_TYPE_COMBO2 1009
#define IDC_CATEGORY_TYPE_COMBO 1009
#define IDC_LAST_POSX 1010
#define IDC_LAST_POSY 1011
#define IDC_LAST_POSZ 1012
#define IDC_READFILENAME 1013
#define IDC_SEARCH_VALUE_EDIT 1014
#define IDC_SAVE_POSX 1015
#define IDC_SAVE_POSY 1016
#define IDC_SAVE_POSZ 1017
#define IDC_EXPORT_BUTTON 1018
#define IDC_BUTTON1 1019
#define IDC_BUTTON_OK 1019
#define IDC_OUTPUT 1019
#define IDC_DEFAULT_BTN 1019
#define IDC_BUTTON2 1020
#define IDC_BUTTON3 1021
#define IDC_BUTTON4 1022
#define IDC_CHARACTER_INFO_DUMP 1022
#define IDC_EXTRACTMULTIFILE 1022
#define IDC_ITEMINFOEDIT 1027
#define IDC_ITEMINFO_DETAIL 1029
#define IDC_SHOW_UID 1030
#define IDC_CHECK2 1031
#define IDC_CHECK3 1032
#define IDC_CHECK4 1033
#define IDC_CHECK5 1034
#define IDC_EDIT1 1035
#define IDC_DATETIMEPICKER2 1037
#define IDC_DATETIMEPICKER3 1038
#define IDC_EDIT2 1042
#define IDC_EDIT3 1043
#define IDC_EDIT4 1044
#define IDC_EDIT5 1045
#define IDC_LIST1 1046
#define IDC_ITEM_LIST 1046
#define IDC_SHOW_QUICKSLOT 1048
#define IDC_SHOW_SKILLSLOT 1049
#define IDC_COMBOBOXEX1 1057
#define IDC_LOGFILENAME_STATIC 1058
#define IDC_SEARCHTIME_STATIC 1059
#define IDC_SEARCHCOORDINATES_STATIC 1060
#define IDC_GOPAGE_EDIT 1063
#define IDC_SEARCHTYPE_STATIC 1064
#define IDC_SEARCHCONDITION_STATIC 1065
#define IDC_SEARCHVALUE_STATIC 1066
#define IDC_SEARCHSTARTDATE_STATIC 1067
#define IDC_SEARCHENDDATE_STATIC 1068
#define IDC_RADIUS_STATIC 1069
#define IDC_CHARACTERINFO_GROUP 1070
#define IDC_CARTEGORY_TYPE_CB 1071
#define IDC_CATEGORY_TYPE_CB 1071
#define IDC_BUTTON5 1072
#define IDC_CONVERT_TO_TEXT 1072
#define ID_RESULT_EXPORTTOFILE 32771
#define ID_RESULT_EXPORTTOCLIPBOARD 32772
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 136
#define _APS_NEXT_COMMAND_VALUE 32773
#define _APS_NEXT_CONTROL_VALUE 1073
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif

View File

@@ -0,0 +1,692 @@
#include "stdafx.h"
#include "SearchClass.h"
#include <BaseLibrary/Utility/Math/Math.h>
#include <RylGameLibrary/Log/LogCommands.h>
// ------------------------------------------------------------------------------------------
DWORD StringToDWORD(const CString& SearchValue_In)
{
DWORD dwResult = 0;
if(0 != SearchValue_In.GetLength())
{
if(-1 == SearchValue_In.Find("0x") && -1 == SearchValue_In.Find("0X"))
{
// 정수
dwResult = atoi(SearchValue_In);
}
else
{
dwResult += Math::Convert::StrToHex32(SearchValue_In);
}
}
return dwResult;
}
DWORD64 StringToDWORD64(const CString& SearchValue_In)
{
DWORD64 dwResult = 0;
if(0 != SearchValue_In.GetLength())
{
if(-1 == SearchValue_In.Find("0x") && -1 == SearchValue_In.Find("0X"))
{
// 정수
dwResult = _atoi64(SearchValue_In);
}
else
{
dwResult += Math::Convert::StrToHex64(SearchValue_In);
}
}
return dwResult;
}
// ------------------------------------------------------------------------------------------
CRegion::CRegion(const DWORD dwRadius, const DWORD dwXPos,
const DWORD dwYPos, const DWORD dwZPos)
: m_dwRadiusSquare(dwRadius*dwRadius), m_dwXPos(dwXPos),
m_dwYPos(dwYPos), m_dwZPos(dwZPos)
{
}
CRegion::CRegion(const CString& Radius, const CString& XPos,
const CString& YPos, const CString& ZPos)
{
m_dwRadiusSquare = (0 != Radius.GetLength()) ? atoi(Radius)*atoi(Radius) : 0;
m_dwXPos = (0 != XPos.GetLength()) ? atoi(XPos) : 0;
m_dwYPos = (0 != YPos.GetLength()) ? atoi(YPos) : 0;
m_dwZPos = (0 != ZPos.GetLength()) ? atoi(ZPos) : 0;
}
// ------------------------------------------------------------------------------------------
CCIDSearch::CCIDSearch(const CString& SearchValue_In)
: m_dwCID((0 == SearchValue_In.GetLength()) ? 0 : StringToDWORD(SearchValue_In))
{
}
bool CCIDSearch::operator () (const GAMELOG::sLogBase* lpLogBase)
{
using namespace GAMELOG;
if(0 == m_dwCID)
{
return true;
}
switch(lpLogBase->m_cCmd)
{
case CMD::GUILD_CREATE:
case CMD::GUILD_JOIN:
case CMD::GUILD_MEMBER_LEVEL:
case CMD::GUILD_LEAVE:
case CMD::GUILD_RIGHTS_CHANGE:
case CMD::GUILD_LEVEL_ADJUST:
case CMD::GUILD_MARK_ADJUST:
case CMD::GUILD_GOLD_CHANGE:
case CMD::GUILD_DISSOLVE:
{
const sGuildLog* lpGuildLog = static_cast<const sGuildLog*>(lpLogBase);
if((m_dwCID == lpGuildLog->m_dwSrcCID) || (m_dwCID == lpGuildLog->m_dwDstCID))
{
return true;
}
}
}
return (m_dwCID == lpLogBase->m_dwCID);
}
// ------------------------------------------------------------------------------------------
CUIDSearch::CUIDSearch(const CString& SearchValue_In)
: m_dwUID((0 == SearchValue_In.GetLength()) ? 0 : StringToDWORD(SearchValue_In))
{
}
bool CUIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
{
if(0 == m_dwUID) { return true; }
return (m_dwUID == lpLogBase->m_dwUID);
}
// ------------------------------------------------------------------------------------------
CPositionSearch::CPositionSearch(const CRegion& Region)
: m_Region(Region)
{
}
bool CPositionSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
{
return m_Region.IsIn(lpLogBase->m_usXPos,
lpLogBase->m_usYPos, lpLogBase->m_usZPos);
}
// ------------------------------------------------------------------------------------------
CTimeSearch::CTimeSearch(const CTime& StartTime, const CTime& StopTime)
: m_startTime(StartTime.GetTime()), m_stopTime(StopTime.GetTime())
{
}
bool CTimeSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
{
time_t time = lpLogBase->m_time;
if((m_startTime < time && time < m_stopTime) || 0 == time) { return true; }
return false;
}
// ------------------------------------------------------------------------------------------
CItemUIDSearch::CItemUIDSearch(const CString& SearchValue_In)
: m_dwItemUID(StringToDWORD64(SearchValue_In))
{
}
bool CItemUIDSearch::FindItem(const GAMELOG::sCharLoginOut* pLoginOut,
const DBUpdateData::UpdateList eUpdateList)
{
unsigned short usSize = 0;
unsigned short usItemSize = pLoginOut->m_usDataSize[eUpdateList];
const char *lpITEM_DATA = reinterpret_cast<const char*>(pLoginOut+1) +
std::accumulate(&pLoginOut->m_usDataSize[0], &pLoginOut->m_usDataSize[eUpdateList], 0);
while(usSize < usItemSize)
{
const Item::ItemData* lpItemData =
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + usSize);
if(m_dwItemUID == lpItemData->m_dwUID)
{
return true;
}
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
}
return false;
}
bool CItemUIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
{
using namespace GAMELOG;
if(0 == m_dwItemUID) { return true; }
switch(lpLogBase->m_cCmd)
{
case CMD::CHAR_LOGIN:
case CMD::CHAR_LOGOUT:
case CMD::CHAR_DBUPDATE:
// 아이템 하나씩 다 뒤져서 UID일치하는 게 있으면 true리턴
{
const GAMELOG::sCharLoginOut* lpLoginOut = static_cast<const GAMELOG::sCharLoginOut*>(lpLogBase);
if(FindItem(lpLoginOut, DBUpdateData::ITEM_EQUIP_UPDATE) ||
FindItem(lpLoginOut, DBUpdateData::ITEM_INVEN_UPDATE) ||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXTRA_UPDATE) ||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXCHANGE_UPDATE))
{
return true;
}
const char *lpDeposit = reinterpret_cast<const char*>(lpLoginOut+1) +
std::accumulate(&lpLoginOut->m_usDataSize[0],
&lpLoginOut->m_usDataSize[DBUpdateData::MAX_UPDATE_DB], 0);
unsigned short usSize = 0;
unsigned short usItemSize = lpLoginOut->m_usDepositData;
while(usSize < usItemSize)
{
const Item::ItemData* lpItemData =
reinterpret_cast<const Item::ItemData*>(lpDeposit + usSize);
if(m_dwItemUID == lpItemData->m_dwUID)
{
return true;
}
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
}
}
break;
case CMD::MOVE_ITEM:
return m_dwItemUID == static_cast<const sMoveItemLog*>(lpLogBase)->m_itemInfo.m_dwItemUID;
case CMD::SWAP_ITEM:
{
const sSwapItemLog* lpSwapItemLog = static_cast<const sSwapItemLog*>(lpLogBase);
return (m_dwItemUID == lpSwapItemLog->m_srcItemInfo.m_dwItemUID) ||
(m_dwItemUID == lpSwapItemLog->m_dstItemInfo.m_dwItemUID);
}
case CMD::USE_ITEM:
// 사용하는 아이템
return (m_dwItemUID == static_cast<const GAMELOG::sUseItemLog*>(lpLogBase)->m_itemInfo.m_dwItemUID);
case CMD::USE_LOTTERY:
// 사용하는 아이템
return (m_dwItemUID == static_cast<const GAMELOG::sUseLotteryLog*>(lpLogBase)->m_itemInfo.m_dwItemUID);
case CMD::SPLIT_ITEM:
{
const sSplitItemLog* lpSplitItemLog = static_cast<const GAMELOG::sSplitItemLog*>(lpLogBase);
return (m_dwItemUID == lpSplitItemLog ->m_prevItem.m_dwItemUID) ||
(m_dwItemUID == lpSplitItemLog->m_splitItem.m_dwItemUID);
}
case CMD::PICKUP_ITEM:
// 집는 아이템
{
const GAMELOG::sPickupItemLog* lpPickup = static_cast<const GAMELOG::sPickupItemLog*>(lpLogBase);
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpPickup + 1);
return (0 == lpPickup->m_cErr) ? (m_dwItemUID == lpItemData->m_dwUID) : false;
}
case CMD::DROP_ITEM:
// 버리는 아이템
{
const GAMELOG::sDropItemLog* lpDrop = static_cast<const GAMELOG::sDropItemLog*>(lpLogBase);
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpDrop+1);
return (0 == lpDrop->m_cErr) ? (m_dwItemUID == lpItemData->m_dwUID) : false;
}
case CMD::BUY_ITEM:
case CMD::SELL_ITEM:
// 사는 아이템 / 파는 아이템
{
const GAMELOG::sTradeItemLog* lpTrade = static_cast<const GAMELOG::sTradeItemLog*>(lpLogBase);
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpTrade+1);
return (0 == lpTrade->m_cErr) ? (m_dwItemUID == lpItemData->m_dwUID) : false;
}
case CMD::BEFORE_EXCHANGE_ITEM:
case CMD::AFTER_EXCHANGE_ITEM:
// 교환하기 전 아이템 / 교환 후 아이템
{
const GAMELOG::sExchangeItemLog* lpExchange = static_cast<const GAMELOG::sExchangeItemLog*>(lpLogBase);
const char* lpITEM_DATA = reinterpret_cast<const char*>(lpExchange + 1);
unsigned short nSize = 0;
while(nSize < lpExchange->m_usItemSize)
{
const Item::ItemData* lpItemData =
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + nSize);
if(m_dwItemUID == lpItemData->m_dwUID)
{
return true;
}
nSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
}
}
break;
case CMD::INSTALL_SOCKET_ITEM:
{
// Gem하고, Equip조사
const GAMELOG::sInstallSocketLog* lpInstallSocket =
static_cast<const GAMELOG::sInstallSocketLog*>(lpLogBase);
if(0 == lpInstallSocket->m_cErr)
{
const Item::ItemData* lpItemGemData =
reinterpret_cast<const Item::ItemData*>(lpInstallSocket+1);
if(m_dwItemUID == lpItemGemData->m_dwUID)
{
return true;
}
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
reinterpret_cast<const char*>(lpInstallSocket + 1) + lpItemGemData->m_cItemSize);
if(m_dwItemUID == lpItemEquipData->m_dwUID)
{
return true;
}
}
}
break;
case CMD::REPAIR_ITEM:
// 수리 아이템
return (m_dwItemUID ==
static_cast<const GAMELOG::sRepairItemLog*>(lpLogBase)->m_RepairedItem.m_dwItemUID);
case CMD::UPGRADE_ITEM:
{
// Gem하고, Equip조사
const GAMELOG::sUpgradeItemLog* lpUpgradeItemLog =
static_cast<const GAMELOG::sUpgradeItemLog*>(lpLogBase);
if(0 == lpUpgradeItemLog->m_cErr)
{
const Item::ItemData* lpItemMineralData =
reinterpret_cast<const Item::ItemData*>(lpUpgradeItemLog+1);
if(m_dwItemUID == lpItemMineralData->m_dwUID)
{
return true;
}
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
reinterpret_cast<const char*>(lpUpgradeItemLog + 1) + lpItemMineralData->m_cItemSize);
if(m_dwItemUID == lpItemEquipData->m_dwUID)
{
return true;
}
}
}
break;
case CMD::STALL_ITEM_REGISTER_REMOVE:
{
const GAMELOG::sStallRegisterRemoveItemLog* lpStallRegisterRemoveItemLog =
static_cast<const GAMELOG::sStallRegisterRemoveItemLog*>(lpLogBase);
if(m_dwItemUID == lpStallRegisterRemoveItemLog->m_itemInfo.m_dwItemUID)
{
return true;
}
}
};
return false;
}
CItemTypeIDSearch::CItemTypeIDSearch(const CString& SearchValue_In)
: m_usItemTypeID(atoi(SearchValue_In))
{
}
bool CItemTypeIDSearch::FindItem(const GAMELOG::sCharLoginOut* pLoginOut,
const DBUpdateData::UpdateList eUpdateList)
{
unsigned short usSize = 0;
unsigned short usItemSize = pLoginOut->m_usDataSize[eUpdateList];
const char *lpITEM_DATA = reinterpret_cast<const char*>(pLoginOut+1) +
std::accumulate(&pLoginOut->m_usDataSize[0], &pLoginOut->m_usDataSize[eUpdateList], 0);
while(usSize < usItemSize)
{
const Item::ItemData* lpItemData =
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + usSize);
if(m_usItemTypeID == lpItemData->m_usProtoTypeID)
{
return true;
}
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
}
return false;
}
bool CItemTypeIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
{
using namespace GAMELOG;
if(0 == m_usItemTypeID) { return true; }
switch(lpLogBase->m_cCmd)
{
case CMD::CHAR_LOGIN:
case CMD::CHAR_LOGOUT:
case CMD::CHAR_DBUPDATE:
// 아이템 하나씩 다 뒤져서 UID일치하는 게 있으면 true리턴
{
const GAMELOG::sCharLoginOut* lpLoginOut = static_cast<const GAMELOG::sCharLoginOut*>(lpLogBase);
if(FindItem(lpLoginOut, DBUpdateData::ITEM_EQUIP_UPDATE) ||
FindItem(lpLoginOut, DBUpdateData::ITEM_INVEN_UPDATE) ||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXTRA_UPDATE) ||
FindItem(lpLoginOut, DBUpdateData::ITEM_EXCHANGE_UPDATE))
{
return true;
}
const char *lpDeposit = reinterpret_cast<const char*>(lpLoginOut+1) +
std::accumulate(&lpLoginOut->m_usDataSize[0],
&lpLoginOut->m_usDataSize[DBUpdateData::MAX_UPDATE_DB], 0);
unsigned short usSize = 0;
unsigned short usItemSize = lpLoginOut->m_usDepositData;
while(usSize < usItemSize)
{
const Item::ItemData* lpItemData =
reinterpret_cast<const Item::ItemData*>(lpDeposit + usSize);
if(m_usItemTypeID == lpItemData->m_usProtoTypeID)
{
return true;
}
usSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
}
}
break;
case CMD::USE_ITEM:
// 사용하는 아이템
{
const GAMELOG::sUseItemLog* lpUseItem = static_cast<const GAMELOG::sUseItemLog*>(lpLogBase);
return m_usItemTypeID == lpUseItem->m_itemInfo.m_usProtoTypeID;
}
case CMD::USE_LOTTERY:
// 사용하는 아이템
{
const GAMELOG::sUseLotteryLog* lpUseLottery = static_cast<const GAMELOG::sUseLotteryLog*>(lpLogBase);
return m_usItemTypeID == lpUseLottery->m_itemInfo.m_usProtoTypeID;
}
case CMD::PICKUP_ITEM:
// 집는 아이템
{
const GAMELOG::sPickupItemLog* lpPickup = static_cast<const GAMELOG::sPickupItemLog*>(lpLogBase);
if(0 != lpPickup->m_dwGold) return false;
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpPickup + 1);
return (0 == lpPickup->m_cErr) ? (m_usItemTypeID == lpItemData->m_usProtoTypeID) : false;
}
case CMD::DROP_ITEM:
// 버리는 아이템
{
const GAMELOG::sDropItemLog* lpDrop = static_cast<const GAMELOG::sDropItemLog*>(lpLogBase);
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpDrop+1);
return (0 == lpDrop->m_cErr) ? (m_usItemTypeID == lpItemData->m_usProtoTypeID) : false;
}
case CMD::BUY_ITEM:
case CMD::SELL_ITEM:
// 사는 아이템 / 파는 아이템
{
const GAMELOG::sTradeItemLog* lpTrade = static_cast<const GAMELOG::sTradeItemLog*>(lpLogBase);
const Item::ItemData* lpItemData = reinterpret_cast<const Item::ItemData*>(lpTrade+1);
return (0 == lpTrade->m_cErr) ? (m_usItemTypeID == lpItemData->m_usProtoTypeID) : false;
}
case CMD::BEFORE_EXCHANGE_ITEM:
case CMD::AFTER_EXCHANGE_ITEM:
// 교환하기 전 아이템 / 교환 후 아이템
{
const GAMELOG::sExchangeItemLog* lpExchange = static_cast<const GAMELOG::sExchangeItemLog*>(lpLogBase);
const char* lpITEM_DATA = reinterpret_cast<const char*>(lpExchange + 1);
unsigned short nSize = 0;
while(nSize < lpExchange->m_usItemSize)
{
const Item::ItemData* lpItemData =
reinterpret_cast<const Item::ItemData*>(lpITEM_DATA + nSize);
if(m_usItemTypeID == lpItemData->m_usProtoTypeID)
{
return true;
}
nSize += static_cast<unsigned short>(lpItemData->m_cItemSize);
}
}
break;
case CMD::INSTALL_SOCKET_ITEM:
{
// Gem하고, Equip조사
const GAMELOG::sInstallSocketLog* lpInstallSocket =
static_cast<const GAMELOG::sInstallSocketLog*>(lpLogBase);
if(0 == lpInstallSocket->m_cErr)
{
const Item::ItemData* lpItemGemData =
reinterpret_cast<const Item::ItemData*>(lpInstallSocket+1);
if(m_usItemTypeID == lpItemGemData->m_usProtoTypeID)
{
return true;
}
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
reinterpret_cast<const char*>(lpInstallSocket + 1) + lpItemGemData->m_cItemSize);
if(m_usItemTypeID == lpItemEquipData->m_usProtoTypeID)
{
return true;
}
}
}
break;
case CMD::REPAIR_ITEM:
// 수리 아이템
return (m_usItemTypeID ==
static_cast<const GAMELOG::sRepairItemLog*>(lpLogBase)->m_RepairedItem.m_usProtoTypeID);
case CMD::UPGRADE_ITEM:
{
// Gem하고, Equip조사
const GAMELOG::sUpgradeItemLog* lpUpgradeItemLog =
static_cast<const GAMELOG::sUpgradeItemLog*>(lpLogBase);
if(0 == lpUpgradeItemLog->m_cErr)
{
const Item::ItemData* lpItemMineralData =
reinterpret_cast<const Item::ItemData*>(lpUpgradeItemLog+1);
if(m_usItemTypeID == lpItemMineralData->m_usProtoTypeID)
{
return true;
}
const Item::ItemData* lpItemEquipData = reinterpret_cast<const Item::ItemData*>(
reinterpret_cast<const char*>(lpUpgradeItemLog + 1) + lpItemMineralData->m_cItemSize);
if(m_usItemTypeID == lpItemEquipData->m_usProtoTypeID)
{
return true;
}
}
}
break;
};
return false;
}
CIPSearch::CIPSearch(const CString& SearchValue_In)
{
CString resToken;
int curPos= 0;
resToken = SearchValue_In.Tokenize(".",curPos);
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b1 = atoi(resToken.Trim()); }
resToken = SearchValue_In.Tokenize(".",curPos);
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b2 = atoi(resToken.Trim()); }
resToken = SearchValue_In.Tokenize(".",curPos);
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b3 = atoi(resToken.Trim()); }
resToken = SearchValue_In.Tokenize(".\n",curPos);
if("" != resToken) { m_sockaddr_In.sin_addr.S_un.S_un_b.s_b4 = atoi(resToken.Trim()); }
}
bool CIPSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
{
using namespace GAMELOG;
switch(lpLogBase->m_cCmd)
{
case CMD::CHAR_LOGIN:
case CMD::CHAR_LOGOUT:
{
const GAMELOG::sCharLoginOut* lpCharLoginOut = static_cast<const GAMELOG::sCharLoginOut*>(lpLogBase);
if(lpCharLoginOut->m_nIP == m_sockaddr_In.sin_addr.S_un.S_addr)
{
return true;
}
}
break;
};
return false;
}
// ------------------------------------------------------------------------------------------
CCategory::CCategory(const CMDArray& CMDs)
: m_CMDArray(CMDs)
{
}
bool CCategory::operator() (const GAMELOG::sLogBase* lpLogBase)
{
return std::binary_search(m_CMDArray.begin(),
m_CMDArray.end(), lpLogBase->m_cCmd);
}
// ------------------------------------------------------------------------------------------
CGIDSearch::CGIDSearch(const CString& SearchValue_In)
: m_dwGID((0 == SearchValue_In.GetLength()) ? 0 : StringToDWORD(SearchValue_In))
{
}
bool CGIDSearch::operator() (const GAMELOG::sLogBase* lpLogBase)
{
using namespace GAMELOG;
switch(lpLogBase->m_cCmd)
{
case CMD::GUILD_CREATE:
case CMD::GUILD_JOIN:
case CMD::GUILD_MEMBER_LEVEL:
case CMD::GUILD_LEAVE:
case CMD::GUILD_RIGHTS_CHANGE:
case CMD::GUILD_LEVEL_ADJUST:
case CMD::GUILD_MARK_ADJUST:
case CMD::GUILD_GOLD_CHANGE:
case CMD::GUILD_DISSOLVE:
return m_dwGID == static_cast<const sGuildLog*>(lpLogBase)->m_dwGID;
}
return false;
}

View File

@@ -0,0 +1,144 @@
#ifndef _SEARCH_CLASS_H_
#define _SEARCH_CLASS_H_
#include <vector>
#include <RylGameLibrary/Network/Packet/PacketStruct/CharLoginOutPacketStruct.h>
namespace GAMELOG
{
// Àü¹æ ÂüÁ¶
struct sLogBase;
struct sCharLoginOut;
};
class CRegion
{
public:
explicit CRegion(const DWORD dwRadius, const DWORD dwXPos,
const DWORD dwYPos, const DWORD dwZPos);
explicit CRegion(const CString& Radius, const CString& XPos,
const CString& YPos, const CString& ZPos);
inline bool IsIn(const DWORD dwXPos, const DWORD dwYPos, const DWORD dwZPos);
inline bool IsValid() const { return (0 != m_dwRadiusSquare); }
protected:
DWORD m_dwRadiusSquare;
DWORD m_dwXPos;
DWORD m_dwYPos;
DWORD m_dwZPos;
inline DWORD DistanceSquare(const DWORD dwPos1, const DWORD dwPos2);
};
inline DWORD CRegion::DistanceSquare(const DWORD dwPos1, const DWORD dwPos2)
{
if(dwPos1 > dwPos2) { return (dwPos1-dwPos2)*(dwPos1-dwPos2); }
else if(dwPos1 < dwPos2) { return (dwPos2-dwPos1)*(dwPos2-dwPos1); }
return 0;
}
inline bool CRegion::IsIn(const DWORD dwXPos, const DWORD dwYPos, const DWORD dwZPos)
{
return (DistanceSquare(m_dwXPos, dwXPos) +
DistanceSquare(m_dwYPos, dwYPos) +
DistanceSquare(m_dwZPos, dwZPos)) < m_dwRadiusSquare;
}
class CCIDSearch
{
public:
CCIDSearch(const CString& SearchValue_In);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
protected:
DWORD m_dwCID;
};
class CUIDSearch
{
public:
CUIDSearch(const CString& SearchValue_In);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
protected:
DWORD m_dwUID;
};
class CPositionSearch
{
public:
CPositionSearch(const CRegion& Region);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
protected:
CRegion m_Region;
};
class CTimeSearch
{
public:
CTimeSearch(const CTime& StartTime, const CTime& StopTime);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
protected:
__time64_t m_startTime;
__time64_t m_stopTime;
};
class CItemUIDSearch
{
public:
CItemUIDSearch(const CString& SearchValue_In);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
protected:
DWORD64 m_dwItemUID;
bool FindItem(const GAMELOG::sCharLoginOut* pLoginOut, const DBUpdateData::UpdateList eUpdateList);
};
class CItemTypeIDSearch
{
public:
CItemTypeIDSearch(const CString& SearchValue_In);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
protected:
unsigned short m_usItemTypeID;
bool FindItem(const GAMELOG::sCharLoginOut* pLoginOut, const DBUpdateData::UpdateList eUpdateList);
};
class CIPSearch
{
public:
CIPSearch(const CString& SearchValue_In);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
private:
SOCKADDR_IN m_sockaddr_In;
};
class CCategory
{
public:
typedef std::vector<unsigned char> CMDArray;
CCategory(const CMDArray& CMDs);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
private:
const CMDArray& m_CMDArray;
};
class CGIDSearch
{
public:
CGIDSearch(const CString& SearchValue_In);
bool operator() (const GAMELOG::sLogBase* lpLogBase);
protected:
unsigned long m_dwGID;
};
#endif

View File

@@ -0,0 +1,710 @@
// XListBox.cpp
//
// Author: Hans Dietrich
// hdietrich2@hotmail.com
//
// This software is released into the public domain.
// You are free to use it in any way you like.
//
// This software is provided "as is" with no expressed
// or implied warranty. I accept no liability for any
// damage or loss of business that this software may cause.
//
// Notes on use: To use in an MFC project, first create
// a listbox using the standard dialog editor.
// Be sure to mark the listbox as OWNERDRAW
// FIXED, and check the HAS STRINGS box.
// Using Class Wizard, create a variable for
// the listbox. Finally, manually edit the
// dialog's .h file and replace CListBox with
// CXListBox, and #include XListBox.h.
//
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "XListBox.h"
#include "Clipboard.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
// NOTE - following table must be kept in sync with ColorPickerCB.cpp
const int MAX_COLOR = 19;
static COLORREF ColorTable[MAX_COLOR] = { RGB( 0, 0, 0), // Black
RGB(255, 255, 255), // White
RGB(128, 0, 0), // Maroon
RGB( 0, 128, 0), // Green
RGB(128, 128, 0), // Olive
RGB( 0, 0, 128), // Navy
RGB(128, 0, 128), // Purple
RGB( 0, 128, 128), // Teal
RGB(192, 192, 192), // Silver
RGB(128, 128, 128), // Gray
RGB(255, 70, 70), // Red
RGB( 0, 255, 0), // Lime
RGB(255, 255, 180), // Yellow
RGB( 0, 0, 255), // Blue
RGB(255, 0, 255), // Fuschia
RGB( 0, 255, 255), // Aqua
RGB(239, 239, 239), // WhiteGray
RGB(255, 223, 239), // WhitePink
RGB(182, 249, 254)}; // SkyBlue
BEGIN_MESSAGE_MAP(CXListBox, CListBox)
//{{AFX_MSG_MAP(CXListBox)
ON_WM_LBUTTONDBLCLK()
ON_COMMAND(ID_EDIT_SELECT_ALL, OnEditSelectAll)
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_EDIT_CLEAR, OnEditClear)
ON_WM_ERASEBKGND() // Add by zun!
//}}AFX_MSG_MAP
//ON_WM_CONTEXTMENU() : 재정의 필요없음;
END_MESSAGE_MAP()
#define new DEBUG_NEW
/////////////////////////////////////////////////////////////////////////////
// CXListBox
CXListBox::CXListBox()
{
m_ColorWindow = ::GetSysColor(COLOR_WINDOW);
m_ColorHighlight = ::GetSysColor(COLOR_HIGHLIGHT);
m_ColorWindowText = ::GetSysColor(COLOR_WINDOWTEXT);
m_ColorHighlightText = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
m_bColor = TRUE;
m_cxExtent = 0;
m_nTabPosition = 8; // tab stops every 8 columns
m_nSpaceWidth = 7;
m_nContextMenuId = (UINT)-1;
for (int i = 0; i < MAXTABSTOPS; i++)
m_nTabStopPositions[i] = (i+1) * m_nTabPosition * m_nSpaceWidth;
}
CXListBox::~CXListBox()
{
}
//////////////////////////////////////////////////////////////////////////////
// MeasureItem
void CXListBox::MeasureItem(LPMEASUREITEMSTRUCT)
{
}
//////////////////////////////////////////////////////////////////////////////
// CompareItem
int CXListBox::CompareItem(LPCOMPAREITEMSTRUCT)
{
return 0;
}
//////////////////////////////////////////////////////////////////////////////
// DrawItem
void CXListBox::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
COLORREF oldtextcolor, oldbackgroundcolor;
CDC* pDC = CDC::FromHandle(lpDIS->hDC);
pDC->GetCharWidth((UINT) ' ', (UINT) ' ', &m_nSpaceWidth);
pDC->GetCharWidth((UINT) 'c', (UINT) 'c', &m_nAveCharWidth);
for (int i = 0; i < MAXTABSTOPS; i++)
m_nTabStopPositions[i] = (i+1) * m_nAveCharWidth * m_nTabPosition;
// draw focus rectangle when no items in listbox
if (lpDIS->itemID == (UINT)-1)
{
if (lpDIS->itemAction & ODA_FOCUS)
pDC->DrawFocusRect(&lpDIS->rcItem);
return;
}
else
{
int selChange = lpDIS->itemAction & ODA_SELECT;
int focusChange = lpDIS->itemAction & ODA_FOCUS;
int drawEntire = lpDIS->itemAction & ODA_DRAWENTIRE;
if (selChange || drawEntire)
{
BOOL sel = lpDIS->itemState & ODS_SELECTED;
int nLen = CListBox::GetTextLen(lpDIS->itemID);
if (nLen != LB_ERR)
{
char *buf = new char [nLen + 10];
ASSERT(buf);
if (buf && (GetTextWithColor(lpDIS->itemID, (LPSTR)buf) != LB_ERR))
{
// set text color from first character in string -
// NOTE: 1 was added to color index to avoid asserts by CString
int itext = int (buf[0] - 1);
// set background color from second character in string -
// NOTE: 1 was added to color index to avoid asserts by CString
int iback = int (buf[1] - 1);
buf[0] = ' ';
buf[1] = ' ';
COLORREF textcolor = sel ? m_ColorHighlightText : ColorTable[itext];
oldtextcolor = pDC->SetTextColor(textcolor);
COLORREF backgroundcolor = sel ? m_ColorHighlight : ColorTable[iback];
oldbackgroundcolor = pDC->SetBkColor(backgroundcolor);
// fill the rectangle with the background color the fast way
pDC->ExtTextOut(0, 0, ETO_OPAQUE, &lpDIS->rcItem, NULL, 0, NULL);
pDC->TabbedTextOut(lpDIS->rcItem.left, lpDIS->rcItem.top, &buf[2],
strlen(&buf[2]), MAXTABSTOPS, (LPINT)m_nTabStopPositions, 0);
CSize size;
size = pDC->GetOutputTextExtent(&buf[2]);
int nScrollBarWidth = ::GetSystemMetrics(SM_CXVSCROLL);
size.cx += nScrollBarWidth; // in case of vertical scrollbar
int cxExtent = (size.cx > m_cxExtent) ? size.cx : m_cxExtent;
if (cxExtent > m_cxExtent)
{
m_cxExtent = cxExtent;
SetHorizontalExtent(m_cxExtent+(m_cxExtent/32));
}
}
if (buf)
delete [] buf;
}
}
if (focusChange || (drawEntire && (lpDIS->itemState & ODS_FOCUS)))
pDC->DrawFocusRect(&lpDIS->rcItem);
}
}
//////////////////////////////////////////////////////////////////////////////
// GetTextWithColor - get text string with color bytes
int CXListBox::GetTextWithColor(int nIndex, LPTSTR lpszBuffer) const
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return LB_ERR;
}
ASSERT(lpszBuffer);
lpszBuffer[0] = 0;
return CListBox::GetText(nIndex, lpszBuffer);
}
//////////////////////////////////////////////////////////////////////////////
// GetTextWithColor - get text string with color bytes
void CXListBox::GetTextWithColor(int nIndex, CString& rString) const
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return;
}
rString.Empty();
CListBox::GetText(nIndex, rString);
}
//////////////////////////////////////////////////////////////////////////////
// GetText - for compatibility with CListBox (no color bytes)
int CXListBox::GetText(int nIndex, LPTSTR lpszBuffer) const
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return LB_ERR;
}
ASSERT(lpszBuffer);
lpszBuffer[0] = 0;
int nRet = CListBox::GetText(nIndex, lpszBuffer);
int n = strlen(lpszBuffer);
if (n > 2)
memcpy(&lpszBuffer[0], &lpszBuffer[2], n-1); // copy nul too
return nRet;
}
//////////////////////////////////////////////////////////////////////////////
// GetText - for compatibility with CListBox (no color bytes)
void CXListBox::GetText(int nIndex, CString& rString) const
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return;
}
CString str;
str.Empty();
CListBox::GetText(nIndex, str);
if ((!str.IsEmpty()) && (str.GetLength() > 2))
rString = str.Mid(2);
else
rString.Empty();
}
//////////////////////////////////////////////////////////////////////////////
// GetTextLen - for compatibility with CListBox (no color bytes)
int CXListBox::GetTextLen(int nIndex) const
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return LB_ERR;
}
int n = CListBox::GetTextLen(nIndex);
if (n != LB_ERR && n >= 2)
n -= 2;
return n;
}
//////////////////////////////////////////////////////////////////////////////
// SearchString
int CXListBox::SearchString(int nStartAfter, LPCTSTR lpszItem, BOOL bExact) const
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return LB_ERR;
}
// start the search after specified index
int nIndex = nStartAfter + 1;
int nCount = GetCount();
if (nCount == LB_ERR)
return LB_ERR;
// convert string to search for to lower case
CString strItem;
strItem = lpszItem;
strItem.MakeLower();
int nItemSize = strItem.GetLength();
CString strText;
// search until end
for ( ; nIndex < nCount; nIndex++)
{
GetText(nIndex, strText);
strText.MakeLower();
if (!bExact)
strText = strText.Left(nItemSize);
if (strText == strItem)
return nIndex;
}
// if we started at beginning there is no more to do, search failed
if (nStartAfter == -1)
return LB_ERR;
// search until we reach beginning index
for (nIndex = 0; (nIndex <= nStartAfter) && (nIndex < nCount); nIndex++)
{
GetText(nIndex, strText);
strText.MakeLower();
if (!bExact)
strText = strText.Left(nItemSize);
if (strText == strItem)
return nIndex;
}
return LB_ERR;
}
//////////////////////////////////////////////////////////////////////////////
// FindString
int CXListBox::FindString(int nStartAfter, LPCTSTR lpszItem) const
{
return SearchString(nStartAfter, lpszItem, FALSE);
}
//////////////////////////////////////////////////////////////////////////////
// SelectString
int CXListBox::SelectString(int nStartAfter, LPCTSTR lpszItem)
{
int rc = SearchString(nStartAfter, lpszItem, FALSE);
if (rc != LB_ERR)
SetCurSel(rc);
return rc;
}
//////////////////////////////////////////////////////////////////////////////
// FindStringExact
int CXListBox::FindStringExact(int nStartAfter, LPCTSTR lpszItem) const
{
return SearchString(nStartAfter, lpszItem, TRUE);
}
//////////////////////////////////////////////////////////////////////////////
// InsertString - override to add text color
int CXListBox::InsertString(int nIndex, LPCTSTR lpszItem)
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return LB_ERR;
}
CString s;
s.Empty();
s = lpszItem;
Color tc = Black; // to force black-only text
Color bc = White;
UINT nColor = (UINT) tc;
ASSERT(nColor < 16);
if (nColor >= 16)
tc = Black;
// don't display \r or \n characters
int i;
while ((i = s.FindOneOf("\r\n")) != -1)
s.SetAt(i, ' ');
// first character in string is color -- add 1 to color
// to avoid asserts by CString class
CString t;
t .Empty();
t += (char) (tc + 1);
t += (char) (bc + 1);
t += s;
// try to insert the string into the listbox
i = CListBox::InsertString(nIndex, t);
return i;
}
//////////////////////////////////////////////////////////////////////////////
// AddString - override to add text color
void CXListBox::AddString(LPCTSTR lpszItem)
{
AddLine(CXListBox::Black, CXListBox::White, lpszItem);
}
//////////////////////////////////////////////////////////////////////////////
// AddLine
void CXListBox::AddLine(Color tc, Color bc, LPCTSTR lpszLine)
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return;
}
CString s;
s.Empty();
s = lpszLine;
if (!m_bColor)
{
tc = Black; // to force black-only text
bc = White;
}
UINT nColor = (UINT) tc;
ASSERT(nColor < MAX_COLOR);
if (nColor >= MAX_COLOR)
tc = Black;
// don't display \r or \n characters
int i;
while ((i = s.FindOneOf("\r\n")) != -1)
s.SetAt(i, ' ');
// first character in string is color -- add 1 to color
// to avoid asserts by CString class
CString t;
t .Empty();
t += (char) (tc + 1);
t += (char) (bc + 1);
t += s;
// try to add the string to the listbox
i = CListBox::AddString(t);
if (i == LB_ERRSPACE)
{
// will get LB_ERRSPACE if listbox is out of memory
int n = GetCount();
if (n == LB_ERR)
return;
if (n < 2)
return;
// try to delete some strings to free up some room --
// don't spend too much time deleting strings, since
// we might be getting a burst of messages
n = (n < 20) ? (n-1) : 20;
if (n <= 0)
n = 1;
SetRedraw(FALSE);
for (i = 0; i < n; i++)
DeleteString(0);
i = CListBox::AddString(t);
SetRedraw(TRUE);
}
/*
if (i >= 0)
{
SetTopIndex(i);
}
SetCurSel(-1);
*/
}
///////////////////////////////////////////////////////////////////////////////
// Printf
void _cdecl CXListBox::Printf(Color tc, Color bc, UINT nID, LPCTSTR lpszFmt, ...)
{
char buf[1024], fmt[1024];
va_list marker;
// load format string from string resource if
// a resource ID was specified
if (nID)
{
CString s;
if (!s.LoadString(nID))
{
sprintf(s.GetBufferSetLength(80), "Failed to load string resource %u",
nID);
s.ReleaseBuffer(-1);
}
strncpy(fmt, s, sizeof(fmt)-1);
}
else
{
// format string was passed as parameter
strncpy(fmt, lpszFmt, sizeof(fmt)-1);
}
fmt[sizeof(fmt)-1] = 0;
// combine output string and variables
va_start(marker, lpszFmt);
_vsnprintf(buf, sizeof(buf)-1, fmt, marker);
va_end(marker);
buf[sizeof(buf)-1] = 0;
AddLine(tc, bc, buf);
}
//////////////////////////////////////////////////////////////////////////////
// EnableColor
void CXListBox::EnableColor (BOOL bEnable)
{
m_bColor = bEnable;
}
//////////////////////////////////////////////////////////////////////////////
// SetTabPosition
void CXListBox::SetTabPosition(int nSpacesPerTab)
{
ASSERT(nSpacesPerTab > 0 && nSpacesPerTab < 11);
m_nTabPosition = nSpacesPerTab;
CDC* pDC = GetDC();
if (pDC)
{
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
pDC->GetCharWidth((UINT) ' ', (UINT) ' ', &m_nSpaceWidth);
pDC->GetCharWidth((UINT) '9', (UINT) '9', &m_nAveCharWidth);
for (int i = 0; i < MAXTABSTOPS; i++)
m_nTabStopPositions[i] = (i+1) * m_nAveCharWidth * m_nTabPosition;
ReleaseDC(pDC);
}
}
//////////////////////////////////////////////////////////////////////////////
// GetVisibleLines
int CXListBox::GetVisibleLines()
{
int nCount = 0;
CDC* pDC = GetDC();
if (pDC)
{
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
int h = tm.tmHeight + tm.tmInternalLeading;
ReleaseDC(pDC);
CRect rect;
GetClientRect(&rect);
nCount = rect.Height() / h;
}
return nCount;
}
//////////////////////////////////////////////////////////////////////////////
// ResetContent
void CXListBox::ResetContent()
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return;
}
CListBox::ResetContent();
m_cxExtent = 0;
SetHorizontalExtent(m_cxExtent);
}
//////////////////////////////////////////////////////////////////////////////
// SetFont
void CXListBox::SetFont(CFont *pFont, BOOL bRedraw)
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return;
}
CListBox::SetFont(pFont, bRedraw);
CDC* pDC = GetDC();
if (pDC)
{
CFont *pOldFont = pDC->SelectObject(pFont);
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
int h = tm.tmHeight;
SetItemHeight(0, h);
pDC->SelectObject(pOldFont);
pDC->GetCharWidth((UINT) ' ', (UINT) ' ', &m_nSpaceWidth);
pDC->GetCharWidth((UINT) '9', (UINT) '9', &m_nAveCharWidth);
for (int i = 0; i < MAXTABSTOPS; i++)
m_nTabStopPositions[i] = (i+1) * m_nAveCharWidth * m_nTabPosition;
ReleaseDC(pDC);
}
m_cxExtent = 0;
}
//////////////////////////////////////////////////////////////////////////////
// OnLButtonDblClk
void CXListBox::OnLButtonDblClk(UINT nFlags, CPoint point)
{
CListBox::OnLButtonDblClk(nFlags, point);
}
//////////////////////////////////////////////////////////////////////////////////////
// OnContextMenu : 여기서 재정의 해놔서 메인 다이얼로그에서 컨텍스트 메뉴처리가 안됨;
/*
void CXListBox::OnContextMenu(CWnd* pWnd, CPoint point)
{
if (m_nContextMenuId == -1)
{
TRACE(" no context menu\n");
return;
}
CMenu menu;
if (!menu.LoadMenu(m_nContextMenuId))
{
TRACE(" ERROR failed to load %d\n", m_nContextMenuId);
return;
}
menu.GetSubMenu(0)->TrackPopupMenu(0,
point.x, point.y, this, NULL);
}
*/
//////////////////////////////////////////////////////////////////////////////
// OnEditCopy
void CXListBox::OnEditCopy()
{
CString str;
str.Empty();
int nCount = GetCount();
int nSel = 0;
for (int i = 0; i < nCount; i++)
{
if (GetSel(i) > 0)
{
CString s;
s.Empty();
GetText(i, s);
if (!s.IsEmpty())
{
nSel++;
s.TrimLeft("\r\n");
s.TrimRight("\r\n");
if (s.Find('\n') == -1)
s += "\n";
s.Replace("\t", " ");
str += s;
}
}
}
if (!str.IsEmpty())
CClipboard::SetText(str);
}
//////////////////////////////////////////////////////////////////////////////
// OnEditClear
void CXListBox::OnEditClear()
{
ResetContent();
}
//////////////////////////////////////////////////////////////////////////////
// OnEditSelectAll
void CXListBox::OnEditSelectAll()
{
if (!::IsWindow(m_hWnd))
{
ASSERT(FALSE);
return;
}
SelItemRange(TRUE, 0, GetCount()-1);
}
// Add by zun!
BOOL CXListBox::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}

View File

@@ -0,0 +1,97 @@
// XListBox.h
//
// Author: Hans Dietrich
// hdietrich2@hotmail.com
//
// This software is released into the public domain.
// You are free to use it in any way you like.
//
// This software is provided "as is" with no expressed
// or implied warranty. I accept no liability for any
// damage or loss of business that this software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XLISTBOX_H
#define XLISTBOX_H
///////////////////////////////////////////////////////////////////////////////
// CXListBox class
class CXListBox : public CListBox
{
// Constructors
public:
CXListBox();
~CXListBox();
// Attributes
public:
int m_cxExtent;
int m_nTabPosition;
BOOL m_bColor;
COLORREF m_ColorWindow;
COLORREF m_ColorHighlight;
COLORREF m_ColorWindowText;
COLORREF m_ColorHighlightText;
// NOTE - following list must be kept in sync with ColorPickerCB.cpp
enum Color { Black, White, Maroon, Green,
Olive, Navy, Purple, Teal,
Silver, Gray, Red, Lime,
Yellow, Blue, Fuschia, Aqua,
WhiteGray, WhitePink, SkyBlue };
void EnableColor(BOOL bEnable);
// Operations
public:
void AddLine(Color tc, Color bc, LPCTSTR lpszLine);
void AddString(LPCTSTR lpszItem);
int FindString(int nStartAfter, LPCTSTR lpszItem) const;
int FindStringExact(int nStartAfter, LPCTSTR lpszItem) const;
int GetText(int nIndex, LPTSTR lpszBuffer) const;
void GetText(int nIndex, CString& rString) const;
int GetTextLen(int nIndex) const;
int GetTextWithColor(int nIndex, LPTSTR lpszBuffer) const;
void GetTextWithColor(int nIndex, CString& rString) const;
int GetVisibleLines();
int InsertString(int nIndex, LPCTSTR lpszItem);
void _cdecl Printf(Color tc, Color bc, UINT nID, LPCTSTR lpszFmt, ...);
virtual void ResetContent();
int SelectString(int nStartAfter, LPCTSTR lpszItem);
virtual void SetFont(CFont *pFont, BOOL bRedraw = TRUE);
void SetTabPosition(int nSpacesPerTab);
// Implementation
protected:
int SearchString(int nStartAfter, LPCTSTR lpszItem, BOOL bExact) const;
#define MAXTABSTOPS 100
int m_nTabStopPositions[MAXTABSTOPS];
int m_nSpaceWidth;
int m_nAveCharWidth;
UINT m_nContextMenuId;
virtual int CompareItem (LPCOMPAREITEMSTRUCT lpCIS);
virtual void DrawItem (LPDRAWITEMSTRUCT lpDIS);
virtual void MeasureItem (LPMEASUREITEMSTRUCT lpMIS);
// Generated message map functions
//{{AFX_MSG(CXListBox)
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnEditCopy();
afx_msg void OnEditClear();
afx_msg void OnEditSelectAll();
afx_msg BOOL OnEraseBkgnd(CDC* pDC); // Add by zun!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
// XListBox ÄÁÅØ½ºÆ® ¸Þ´º °ü·Ã
//void SetContextMenuId(UINT nId) { m_nContextMenuId = nId; }
//afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
};
#endif
///////////////////////////////////////////////////////////////////////////////

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Windows.GameLogAnalyzer"
type="win32"
/>
<description>여기에 응용 프로그램 설명을 추가합니다.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@@ -0,0 +1,13 @@
//
// GameLogAnalyzer.RC2 - resources Microsoft Visual C++에서 직접 편집하지 않는 리소스
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// 여기에 수동으로 편집한 리소스를 추가합니다....
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,24 @@
// stdafx.cpp : 표준 포함 파일을 포함하는 소스 파일입니다.
// GameLogAnalyzer.pch는 미리 컴파일된 헤더가 됩니다.
// stdafx.obj는 미리 컴파일된 형식 정보를 포함합니다.
#include "stdafx.h"
#include <BaseLibrary/Log/ServerLog.h>
std::string GetMoneyString(unsigned long dwMoney)
{
std::string strTemp;
char strBuff[128];
sprintf(strBuff, "%u", dwMoney);
strTemp = strBuff;
if( strTemp.length() > 3 )
{
for( int i = (int)strTemp.length() - 3 ; i > 0 ; i -= 3 )
{
strTemp.insert( i, "," );
}
}
return strTemp;
}

View File

@@ -0,0 +1,51 @@
// stdafx.h : 잘 변경되지 않고 자주 사용하는
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
// 들어 있는 포함 파일입니다.
#pragma once
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Windows 헤더에서 거의 사용되지 않는 내용을 제외시킵니다.
#endif
// 아래 지정된 플랫폼보다 우선하는 플랫폼을 대상으로 하는 경우 다음 정의를 수정하십시오.
// 다른 플랫폼에 사용되는 해당 값의 최신 정보는 MSDN을 참조하십시오.
#ifndef WINVER // Windows 95 및 Windows NT 4 이후 버전에서만 기능을 사용할 수 있습니다.
#define WINVER 0x0400 // Windows 98과 Windows 2000 이후 버전에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#ifndef _WIN32_WINNT // Windows NT 4 이후 버전에서만 기능을 사용할 수 있습니다.
#define _WIN32_WINNT 0x0400 // Windows 98과 Windows 2000 이후 버전에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#ifndef _WIN32_WINDOWS // Windows 98 이후 버전에서만 기능을 사용할 수 있습니다.
#define _WIN32_WINDOWS 0x0410 // Windows Me 이후 버전에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#ifndef _WIN32_IE // IE 4.0 이후 버전에서만 기능을 사용할 수 있습니다.
#define _WIN32_IE 0x0400 // IE 5.0 이후 버전에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 일부 CString 생성자는 명시적으로 선언됩니다.
// MFC의 공통 부분과 무시 가능한 경고 메시지에 대한 숨기기를 해제합니다.
#define _AFX_ALL_WARNINGS
#include <afxwin.h> // MFC 핵심 및 표준 구성 요소
#include <afxext.h> // MFC 익스텐션
#include <afxdisp.h> // MFC 자동화 클래스
#include <afxdtctl.h> // Internet Explorer 4 공용 컨트롤에 대한 MFC 지원
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // Windows 공용 컨트롤에 대한 MFC 지원
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxdlgs.h>
#define _CRTDBG_MAP_ALLOC
#include "crtdbg.h"
#include <BaseLibrary/Log/ServerLog.h>
#include <string>
std::string GetMoneyString(unsigned long dwMoney);