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

Binary file not shown.

View File

@@ -0,0 +1,76 @@
// ChatParser.cpp : 응용 프로그램에 대한 클래스 동작을 정의합니다.
//
#include "stdafx.h"
#include "ChatParser.h"
#include "ChatParserDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CChatParserApp
BEGIN_MESSAGE_MAP(CChatParserApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// CChatParserApp 생성
CChatParserApp::CChatParserApp()
{
// TODO: 여기에 생성 코드를 추가합니다.
// InitInstance에 모든 중요한 초기화 작업을 배치합니다.
}
// 유일한 CChatParserApp 개체입니다.
CChatParserApp theApp;
// CChatParserApp 초기화
BOOL CChatParserApp::InitInstance()
{
// 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을
// 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControlsEx()가 필요합니다.
// InitCommonControlsEx()를 사용하지 않으면 창을 만들 수 없습니다.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 응용 프로그램에서 사용할 모든 공용 컨트롤 클래스를 포함하도록
// 이 항목을 설정하십시오.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
// 표준 초기화
// 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면
// 아래에서 필요 없는 특정 초기화
// 루틴을 제거해야 합니다.
// 해당 설정이 저장된 레지스트리 키를 변경하십시오.
// TODO: 이 문자열을 회사 또는 조직의 이름과 같은
// 적절한 내용으로 수정해야 합니다.
SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램"));
CChatParserDlg 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 @@
// ChatParser.h : PROJECT_NAME 응용 프로그램에 대한 주 헤더 파일입니다.
//
#pragma once
#ifndef __AFXWIN_H__
#error "PCH에 대해 이 파일을 포함하기 전에 'stdafx.h'를 포함합니다."
#endif
#include "resource.h" // 주 기호입니다.
// CChatParserApp:
// 이 클래스의 구현에 대해서는 ChatParser.cpp을 참조하십시오.
//
class CChatParserApp : public CWinApp
{
public:
CChatParserApp();
// 재정의입니다.
public:
virtual BOOL InitInstance();
// 구현입니다.
DECLARE_MESSAGE_MAP()
};
extern CChatParserApp theApp;

View File

@@ -0,0 +1,204 @@
// 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_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\\ChatParser.rc2"" // Microsoft Visual C++ 이외의 다른 도구에서 편집한 리소스입니다.\r\n"
"#include ""afxres.rc"" // 표준 구성 요소입니다.\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON "res\\ChatParser.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ChatParser 정보"
FONT 9, "MS 셸 대화 상자", 0, 0, 0x1
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "ChatParser 버전 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2008",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "확인",IDOK,178,7,50,16,WS_GROUP
END
IDD_CHATPARSER_DIALOG DIALOGEX 0, 0, 499, 399
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "ChatParser"
FONT 9, "굴림", 400, 0, 0x81
BEGIN
PUSHBUTTON "Open",IDC_OPENFILE,433,7,59,14
CONTROL "Oldversion",IDC_OLDVERSION,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,443,25,49,10
LISTBOX IDC_CHATLIST,7,40,485,352,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
EDITTEXT IDC_OPEN_FILENAME,7,7,423,14,ES_AUTOHSCROLL | ES_READONLY
COMBOBOX IDC_SERVERID,7,24,52,102,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_ZONEID,61,24,48,124,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "find",IDC_FINDLIST,359,23,59,14
COMBOBOX IDC_CHATTYPE,111,24,103,124,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_FINDNAME,216,24,86,13,ES_AUTOHSCROLL
CONTROL "FindName",IDC_FINDNAMECHK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,304,26,55,10
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", "TODO: <회사 이름>"
VALUE "FileDescription", "TODO: <파일 설명>"
VALUE "FileVersion", "1.0.0.1"
VALUE "InternalName", "ChatParser.exe"
VALUE "LegalCopyright", "TODO: (c) <회사 이름>. All rights reserved."
VALUE "OriginalFilename", "ChatParser.exe"
VALUE "ProductName", "TODO: <제품 이름>"
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, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_CHATPARSER_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 492
TOPMARGIN, 7
BOTTOMMARGIN, 392
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_ABOUTBOX "ChatParser 정보(&A)..."
END
#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\ChatParser.rc2" // Microsoft Visual C++ 이외의 다른 도구에서 편집한 리소스입니다.
#include "afxres.rc" // 표준 구성 요소입니다.
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChatParser", "ChatParser.vcproj", "{380483B5-D873-4836-9D31-99C0791A6F4F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{380483B5-D873-4836-9D31-99C0791A6F4F}.Debug|Win32.ActiveCfg = Debug|Win32
{380483B5-D873-4836-9D31-99C0791A6F4F}.Debug|Win32.Build.0 = Debug|Win32
{380483B5-D873-4836-9D31-99C0791A6F4F}.Release|Win32.ActiveCfg = Release|Win32
{380483B5-D873-4836-9D31-99C0791A6F4F}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@@ -0,0 +1,311 @@
<?xml version="1.0" encoding="ks_c_5601-1987"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ChatParser"
ProjectGUID="{380483B5-D873-4836-9D31-99C0791A6F4F}"
RootNamespace="ChatParser"
Keyword="MFCProj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1042"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"
MinimalRebuild="false"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1042"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="소스 파일"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ChatParser.cpp"
>
</File>
<File
RelativePath=".\ChatParserDlg.cpp"
>
</File>
<File
RelativePath=".\ChatParserSetup.cpp"
>
</File>
<File
RelativePath=".\Clipboard.cpp"
>
</File>
<File
RelativePath=".\NFTokenizer.cpp"
>
</File>
<File
RelativePath=".\RegFunctions.cpp"
>
</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=".\XListBox.cpp"
>
</File>
</Filter>
<Filter
Name="헤더 파일"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\ChatParser.h"
>
</File>
<File
RelativePath=".\ChatParserDlg.h"
>
</File>
<File
RelativePath=".\ChatParserSetup.h"
>
</File>
<File
RelativePath=".\Clipboard.h"
>
</File>
<File
RelativePath=".\NFTokenizer.h"
>
</File>
<File
RelativePath=".\RegFunctions.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
<File
RelativePath=".\XListBox.h"
>
</File>
</Filter>
<Filter
Name="리소스 파일"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\res\ChatParser.ico"
>
</File>
<File
RelativePath=".\ChatParser.rc"
>
</File>
<File
RelativePath=".\res\ChatParser.rc2"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
<Global
Name="RESOURCE_FILE"
Value="ChatParser.rc"
/>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,564 @@
// ChatParserDlg.cpp : 구현 파일
//
#include "stdafx.h"
#include "ChatParser.h"
#include "ChatParserDlg.h"
#include "NFTokenizer.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()
// CChatParserDlg 대화 상자
CChatParserDlg::CChatParserDlg(CWnd* pParent /*=NULL*/)
: CDialog(CChatParserDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CChatParserDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_CHATLIST, m_ChatList);
DDX_Control(pDX, IDC_OLDVERSION, m_OldVersion);
DDX_Control(pDX, IDC_SERVERID, m_ServerGroup);
DDX_Control(pDX, IDC_ZONEID, m_ServerZone);
DDX_Control(pDX, IDC_CHATTYPE, m_ChatType);
DDX_Control(pDX, IDC_FINDNAMECHK, m_FindNameChk);
DDX_Control(pDX, IDC_FINDNAME, m_FindName);
}
BEGIN_MESSAGE_MAP(CChatParserDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_OPENFILE, &CChatParserDlg::OnBnClickedOpenfile)
ON_BN_CLICKED(IDC_FINDLIST, &CChatParserDlg::OnBnClickedFindlist)
ON_BN_CLICKED(IDC_FINDNAMECHK, &CChatParserDlg::OnBnClickedFindnamechk)
END_MESSAGE_MAP()
// CChatParserDlg 메시지 처리기
BOOL CChatParserDlg::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_OPENFILE, GetMyINIString("LOCAL_STRING", "STRING_01"));
SetDlgItemText(IDC_OLDVERSION, GetMyINIString("LOCAL_STRING", "STRING_02"));
SetDlgItemText(IDC_FINDLIST, GetMyINIString("LOCAL_STRING", "STRING_04"));
SetDlgItemText(IDC_FINDNAMECHK, GetMyINIString("LOCAL_STRING", "STRING_05"));
m_FindName.EnableWindow(FALSE);
int iCount = atoi(GetMyINIString("SERVER_GROUP", "SERVER_GROUP_CNT"));
char strID[32];
char strName[32];
m_ServerGroup.AddString("All");
for(int i = 0; i < iCount; ++i)
{
wsprintf(strID, "SERVER_GROUP%d", i+1);
m_ServerGroup.AddString(GetMyINIString("SERVER_GROUP", strID));
}
m_ServerGroup.SetCurSel(0);
iCount = atoi(GetMyINIString("SERVER_ZONE", "SERVER_ZONE_CNT"));
m_ServerZone.AddString("All");
for(int i = 0; i < iCount; ++i)
{
wsprintf(strID, "SERVER_ZONE%d", i+1);
wsprintf(strName, "ZONE%s", GetMyINIString("SERVER_ZONE", strID));
m_ServerZone.AddString(strName);
}
m_ServerZone.SetCurSel(0);
iCount = atoi(GetMyINIString("CHAT_TYPE", "CHAT_TYPE_CNT"));
m_ChatType.AddString("All");
for(int i = 0; i < iCount; ++i)
{
wsprintf(strID, "CHAT_TYPE%d", i+1);
m_ChatType.AddString(GetMyINIString("CHAT_TYPE", strID));
}
m_ChatType.SetCurSel(0);
memset(&m_OpenFile, 0, sizeof(OPENFILENAME));
m_OpenFile.lStructSize = sizeof(OPENFILENAME);
m_OpenFile.hwndOwner = m_hWnd;
m_OpenFile.lpstrFilter = "Chat Log files\0*.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; // 포커스를 컨트롤에 설정하지 않으면 TRUE를 반환합니다.
}
void CChatParserDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// 대화 상자에 최소화 단추를 추가할 경우 아이콘을 그리려면
// 아래 코드가 필요합니다. 문서/뷰 모델을 사용하는 MFC 응용 프로그램의 경우에는
// 프레임워크에서 이 작업을 자동으로 수행합니다.
void CChatParserDlg::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 CChatParserDlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
// 추가
void CChatParserDlg::AddLineToChatList(unsigned char cChatType, char* szMsg)
{
CXListBox::Color cBackColor = CXListBox::BackColor;
CXListBox::Color cMessageColor = CXListBox::ChatNormal;
switch(cChatType)
{
case NORMAL:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatNormal;
break;
case PARTY:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatParty;
break;
case FRIEND:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatFriend;
break;
case GUILD:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatGuild;
break;
case CLIENT_LOG:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatNormal;
break;
case STALL:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatStall;
break;
case SHOUT:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatShout;
break;
case ADMIN_NORMAL_CHAT:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatAdminNormal;
break;
case ADMIN_SHOUT:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatAdminShout;
break;
case WHISPER:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatWhisper;
break;
case TRADE:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatTrade;
break;
case NOTICE:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatNotice;
break;
case DICE:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::ChatAdminShout;
break;
case GMREPORT:
cBackColor = CXListBox::BackColor; cMessageColor = CXListBox::GMReport;
break;
}
m_ChatList.AddLine(cMessageColor, cBackColor, szMsg, FALSE);
}
void CChatParserDlg::Cleanup()
{
m_ChatList.ResetContent();
}
void CChatParserDlg::OnBnClickedOpenfile()
{
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
ZeroMemory(m_szFileName, MAX_PATH);
if(GetOpenFileName(&m_OpenFile))
{
// 파서하기
LoadFile();
SetDlgItemText(IDC_OPEN_FILENAME, m_szFileName);
}
}
void CChatParserDlg::LoadFile()
{
FILE* fp = fopen(m_szFileName, "rt");
if(fp == NULL)
return;
Cleanup();
m_ChatData.clear();
int iCount = 0;
BOOL bOldVersion = FALSE;
if(m_OldVersion.GetCheck())
bOldVersion = TRUE;
char strData[2048];
int Len = 0;
CHATLIST st;
while(!feof(fp))
{
fgets(strData, 2048, fp);
if(strncmp(strData, "[Ty-NOR]", 8) == 0)
break;
else
{
std::string str = strData;
std::string temp, temp2;
Nave::NFTokenizerA token(str, "[");
int iToken = token.CountTokens();
DWORD dwServerID = 0;
int Temp = 0;
for(int i = 0; i < iToken; ++i)
{
temp = token.NextToken();
if(i == 0) // 시간
{
sscanf(temp.c_str(), "%04d-%02d-%02d %02d:%02d:%02d",
&st.sysTime.wYear, &st.sysTime.wMonth, &st.sysTime.wDay,
&st.sysTime.wHour, &st.sysTime.wMinute, &st.sysTime.wSecond);
}
else if(i == 1)
{
sscanf(temp.c_str(), "ServerID:0x%08x", &dwServerID);
}
else if(i == 2)
{
temp2 = &temp[6];
temp2.erase(temp2.end()-1);
int n = temp2.find_first_of(" ");
strcpy(st.strServerName, temp2.c_str());
st.strServerName[n] = 0;
}
else if(i == 3)
{
sscanf(temp.c_str(), "Zone:%2d", &st.iZone);
}
else if(i == 4)
{
sscanf(temp.c_str(), "CH:%2d", &st.iChannel);
}
else if(i == 5)
{
sscanf(temp.c_str(), "X:%4d", &Temp);
}
else if(i == 6)
{
sscanf(temp.c_str(), "Z:%4d", &Temp);
}
else if(i == 7)
{
sscanf(temp.c_str(), "UID:%10d", &st.dwUID);
}
else if(i == 8)
{
sscanf(temp.c_str(), "CID:%10d", &st.dwCID);
}
else if(i == 9)
{
sscanf(temp.c_str(), "Type:%2d", &st.iChatType);
}
else if(i == 10)
{
temp2 = &temp[2];
temp2.erase(temp2.end()-1);
int n = temp2.find_last_not_of(" ");
strcpy(st.strSenderName, temp2.c_str());
st.strSenderName[n+1] = 0;
}
else if(i == 11)
{
temp2 = &temp[2];
temp2.erase(temp2.end()-1);
int n = temp2.find_last_not_of(" ");
strcpy(st.strTargetName, temp2.c_str());
st.strTargetName[n+1] = 0;
}
else if(i == 12)
{
strncpy(st.strMessage, temp.c_str(), temp.size()-2);
st.strMessage[temp.size()-2] = 0;
}
}
m_ChatData[iCount++] = st;
}
/*
if(strncmp(strData, "[Ty-NOR]", 8) == 0)
break;
else
{
// 시간 읽기
sscanf(strData, "[%04d-%02d-%02d %02d:%02d:%02d]",
&st.sysTime.wYear, &st.sysTime.wMonth, &st.sysTime.wDay,
&st.sysTime.wHour, &st.sysTime.wMinute, &st.sysTime.wSecond);
// 그룹
sscanf(&strData[21], "[Group:%s]", st.strServerName);
// 아이디들
sscanf(&strData[44], "[Zone:%2d][CH:%2d][UID:%10d][CID:%10d][Type:%2d]", &st.iZone, &st.iChannel, &st.dwUID, &st.dwCID, &st.iChatType);
if(strncmp(&strData[101], "[S:", 3) == 0)
{
// Sender
sscanf(&strData[101], "[S:%s]", st.strSenderName);
// Target
sscanfe(&strData[120], "[T:%s]", st.strTargetName);
if(st.strTargetName[0] == ']')
ZeroMemory(st.strTargetName, 32);
// Msg
strcpy(st.strMessage, &strData[140]);
Len = (int)strlen(st.strMessage);
if(st.strMessage[Len-2] == ']')
st.strMessage[Len-2] = 0;
else
st.strMessage[Len-1] = 0;
}
else
{
// Msg
strcpy(st.strMessage, &strData[102]);
Len = (int)strlen(st.strMessage);
if(st.strMessage[Len-2] == ']')
st.strMessage[Len-2] = 0;
else
st.strMessage[Len-1] = 0;
}
m_ChatData[iCount++] = st;
}
*/
}
m_ChatList.AddString(GetMyINIString("LOCAL_STRING", "STRING_03"));
fclose(fp);
}
void CChatParserDlg::OnBnClickedFindlist()
{
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
Cleanup();
char strData[2048];
int Len = 0;
char strTemp[32];
char strServerGroup[32];
int iGroupID = m_ServerGroup.GetCurSel();
if(iGroupID != 0)
{
m_ServerGroup.GetWindowText(strServerGroup, 32);
}
int iZoneID = m_ServerZone.GetCurSel();
if(iZoneID != 0)
{
iZoneID = 0;
m_ServerZone.GetWindowText(strTemp, 32);
sscanf(strTemp, "ZONE%d", &iZoneID);
}
int iChatType = m_ChatType.GetCurSel();
if(iChatType != 0)
{
m_ChatType.GetWindowText(strTemp, 32);
iChatType = GetChatType(strTemp);
}
char strName[64];
BOOL bFindName = FALSE;
if(m_FindNameChk.GetCheck())
{
bFindName = TRUE;
m_FindName.GetWindowText(strName, 64);
}
else
{
ZeroMemory(strName, 64);
}
// 출력
std::map<int, CHATLIST>::iterator obj = m_ChatData.begin();
std::map<int, CHATLIST>::iterator end = m_ChatData.end();
BOOL bAddItem;
while(obj != end)
{
CHATLIST& st = obj->second;
bAddItem = TRUE;
if(iGroupID != 0 && strcmp(strServerGroup, st.strServerName) != 0)
{
bAddItem = FALSE;
}
if(iZoneID != 0 && st.iZone != iZoneID)
{
bAddItem = FALSE;
}
if(iChatType != 0 && st.iChatType != iChatType)
{
bAddItem = FALSE;
}
if(bFindName)
{
if(strcmp(strName, st.strSenderName) != 0 && strcmp(strName, st.strTargetName) != 0)
bAddItem = FALSE;
}
if(bAddItem)
{
if(st.iChatType-1 == WHISPER)
{
if(strlen(st.strTargetName) == 0)
wsprintf(strData, "%-15s[Z:%02d/C:%d][%02d:%02d] %s", st.strServerName, st.iZone, st.iChannel, st.sysTime.wHour, st.sysTime.wMinute, st.strMessage);
else
wsprintf(strData, "%-15s[Z:%02d/C:%d][%02d:%02d] %s (To: %s)", st.strServerName, st.iZone, st.iChannel, st.sysTime.wHour, st.sysTime.wMinute, st.strMessage, st.strTargetName);
}
else
{
wsprintf(strData, "%-15s[Z:%02d/C:%d][%02d:%02d] %s", st.strServerName, st.iZone, st.iChannel, st.sysTime.wHour, st.sysTime.wMinute, st.strMessage);
}
if(iChatType == 0)
AddLineToChatList(st.iChatType-1, strData);
else
AddLineToChatList(iChatType-1, strData);
}
++obj;
}
UpdateData(false);
}
void CChatParserDlg::OnBnClickedFindnamechk()
{
m_FindName.EnableWindow(m_FindNameChk.GetCheck());
}

View File

@@ -0,0 +1,92 @@
// ChatParserDlg.h : 헤더 파일
//
#pragma once
#include "afxwin.h"
#include "XListBox.h"
#include <map>
typedef struct CHATLIST
{
SYSTEMTIME sysTime;
char strServerName[32];
int iZone;
int iChannel;
unsigned long dwUID;
unsigned long dwCID;
int iChatType;
char strSenderName[32];
char strTargetName[32];
char strMessage[512];
CHATLIST()
{
Clear();
}
void Clear()
{
ZeroMemory(&sysTime, sizeof(sysTime));
iZone=0;
iChannel=0;
dwUID=0;
dwCID=0;
iChatType=0;
ZeroMemory(strServerName, 32);
ZeroMemory(strSenderName, 32);
ZeroMemory(strTargetName, 32);
ZeroMemory(strMessage, 512);
}
}CHATLIST;
// CChatParserDlg 대화 상자
class CChatParserDlg : public CDialog
{
// 생성입니다.
public:
CChatParserDlg(CWnd* pParent = NULL); // 표준 생성자입니다.
// 대화 상자 데이터입니다.
enum { IDD = IDD_CHATPARSER_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
void AddLineToChatList(unsigned char cChatType, char* szMsg);
void Cleanup();
void LoadFile();
// 구현입니다.
protected:
HICON m_hIcon;
// 생성된 메시지 맵 함수
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
OPENFILENAME m_OpenFile;
char m_szFileName[MAX_PATH * MAX_PATH];
std::map<int, CHATLIST> m_ChatData;
CXListBox m_ChatList;
CButton m_OldVersion;
CComboBox m_ServerGroup;
CComboBox m_ServerZone;
CComboBox m_ChatType;
CButton m_FindNameChk;
CEdit m_FindName;
public:
afx_msg void OnBnClickedOpenfile();
afx_msg void OnBnClickedFindlist();
afx_msg void OnBnClickedFindnamechk();
};

View File

@@ -0,0 +1,15 @@
#include "stdafx.h"
#include "ChatParserSetup.h"
CChatParserSetup::CChatParserSetup(const char* szFileName)
: Registry::CSetupFile(szFileName)
{
}
CChatParserSetup& CChatParserSetup::GetInstance()
{
static CChatParserSetup setup("./ChatParserSetup.ini");
return setup;
}

View File

@@ -0,0 +1,17 @@
#ifndef _GAMA_NETWORK_CHAT_SETUP_H_
#define _GAMA_NETWORK_CHAT_SETUP_H_
#include "RegFunctions.h"
/** \class CChatParserSetup
모니터링 툴 셋업 클래스*/
class CChatParserSetup : public Registry::CSetupFile
{
public:
CChatParserSetup(const char* szFileName);
static CChatParserSetup& GetInstance();
};
#endif

View File

@@ -0,0 +1,42 @@
[SERVER_GROUP]
SERVER_GROUP_CNT = 1
SERVER_GROUP1 = Ichman
[SERVER_ZONE]
SERVER_ZONE_CNT = 9
SERVER_ZONE1 = 1
SERVER_ZONE2 = 2
SERVER_ZONE3 = 4
SERVER_ZONE4 = 5
SERVER_ZONE5 = 8
SERVER_ZONE6 = 12
SERVER_ZONE7 = 16
SERVER_ZONE8 = 17
SERVER_ZONE9 = 18
[CHAT_TYPE]
CHAT_TYPE_CNT = 17
CHAT_TYPE1 = NORMAL
CHAT_TYPE2 = PARTY
CHAT_TYPE3 = FRIEND
CHAT_TYPE4 = GUILD
CHAT_TYPE5 = CLIENT_LOG
CHAT_TYPE6 = STALL
CHAT_TYPE7 = SHOUT
CHAT_TYPE8 = ADMIN_NORMAL_CHAT
CHAT_TYPE9 = ADMIN_SHOUT
CHAT_TYPE10 = WHISPER
CHAT_TYPE11 = TRADE
CHAT_TYPE12 = CAMP_SHOP
CHAT_TYPE13 = NOTIFY_CHAR_INFO
CHAT_TYPE14 = FIND_PARTY
CHAT_TYPE15 = ENEMY_CHECK
CHAT_TYPE16 = DICE
CHAT_TYPE17 = NOTICE
[LOCAL_STRING]
STRING_01 = 열기
STRING_02 = 구버젼 로그
STRING_03 = 로딩 완료.
STRING_04 = 검색
STRING_05 = 이름검색

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 = (DWORD)::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 = (DWORD)::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 = (int)_tcslen(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.
LPTSTR lpszData = (LPTSTR) ::GlobalLock(hGlobal);
if (lpszData)
{
// Now, copy the text from the buffer into the allocated
// global memory pointer
_tcscpy(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,85 @@
================================================================================
MFC 라이브러리 : ChatParser 프로젝트 개요
===============================================================================
응용 프로그램 마법사에서 이 ChatParser 응용 프로그램을
만들었습니다. 이 응용 프로그램은 MFC의 기본 사용법을 보여 줄 뿐만 아니라 응용 프로그램
작성을 위한 기본 구조를 제공합니다.
이 파일에는 ChatParser 응용 프로그램을 구성하는 각 파일에 대한
요약 설명이 포함되어 있습니다.
ChatParser.vcproj
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 주 프로젝트 파일입니다.
파일을 생성한 Visual C++ 버전에 대한 정보와 응용 프로그램 마법사를 사용하여 선택한
플랫폼, 구성 및 프로젝트 기능에 대한 정보가 들어 있습니다.
ChatParser.h
응용 프로그램의 기본 헤더 파일입니다. 여기에는 다른 프로젝트 관련
헤더(Resource.h 포함)가 들어 있고 CChatParserApp 응용 프로그램
클래스를 선언합니다.
ChatParser.cpp
응용 프로그램 클래스 CChatParserApp이(가) 들어 있는 기본 응용 프로그램
소스 파일입니다.
ChatParser.rc
프로그램에서 사용하는 모든 Microsoft Windows 리소스의 목록입니다.
여기에는 RES 하위 디렉터리에 저장된 아이콘, 비트맵 및 커서가
포함됩니다. 이 파일은 Microsoft Visual C++에서 직접
편집할 수 있습니다. 프로젝트 리소스는 1042에 있습니다.
res\ChatParser.ico
응용 프로그램의 아이콘으로 사용되는 아이콘 파일입니다. 이 아이콘은
주 리소스 파일인 ChatParser.rc에 의해 포함됩니다.
res\ChatParser.rc2
이 파일에는 Microsoft Visual C++ 이외의 다른 도구에서 편집한 리소스가
들어 있습니다. 리소스 편집기로 편집할 수 없는 모든 리소스는
이 파일에 넣어야 합니다.
/////////////////////////////////////////////////////////////////////////////
응용 프로그램 마법사에서 하나의 대화 상자 클래스가 만들어집니다.
ChatParserDlg.h, ChatParserDlg.cpp ? 대화 상자
이 파일에는 CChatParserDlg 클래스가 들어 있습니다. 이 클래스는
응용 프로그램의 주 대화 상자 동작을 정의합니다. 대화 상자의 템플릿은
Microsoft Visual C++에서 편집할 수 있는 ChatParser.rc에 있습니다.
/////////////////////////////////////////////////////////////////////////////
기타 표준 파일:
StdAfx.h, StdAfx.cpp
이 파일은 미리 컴파일된 헤더 파일(PCH)인 ChatParser.pch와
미리 컴파일된 형식 파일인 StdAfx.obj를 빌드하는 데 사용됩니다.
Resource.h
새 리소스 ID를 정의하는 표준 헤더 파일입니다.
Microsoft Visual C++에서 이 파일을 읽고 업데이트합니다.
ChatParser.manifest
응용 프로그램 매니페스트 파일은 Windows XP에서 특정 버전의 Side-by-Side
어셈블리에 대한 응용 프로그램 종속성을 설명하는 데 사용됩니다. 로더는 이 정보를
사용하여 어셈블리 캐시에서 적절한 어셈블리를 로드하거나 응용 프로그램에서 전용
어셈블리를 로드합니다. 응용 프로그램 매니페스트는 응용 프로그램 실행 파일과 같은
폴더에 설치된 외부 .manifest 파일로 재배포를 위해 포함되거나 리소스의 형태로
실행 파일에 포함될 수 있습니다.
/////////////////////////////////////////////////////////////////////////////
기타 참고:
응용 프로그램 마법사는 "TODO:"를 사용하여 추가하거나 사용자 지정해야 하는
소스 코드 부분을 나타냅니다.
응용 프로그램이 공유 DLL에서 MFC를 사용하는 경우 해당 MFC DLL을
재배포해야 합니다. 그리고 응용 프로그램이 운영 체제의 로캘과
다른 언어를 사용하는 경우 해당 지역화된 리소스인 MFC80XXX.DLL을
재배포해야 합니다. 이 두가지 항목에 대한 자세한 내용은
MSDN 설명서의 Visual C++ 응용 프로그램 재배포 항목을
참조하십시오.
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,187 @@
#include "stdafx.h"
#include <winsock2.h>
#include <windows.h>
#include "RegFunctions.h"
#include <fstream>
bool Registry::WriteString(const char *FileName_In, const char *Section_In,
const char *KeyName_In, const char *Value_In)
{
return 0 != WritePrivateProfileString(Section_In, KeyName_In, Value_In, FileName_In);
}
unsigned long Registry::ReadInt(const char *FileName_In, const char *Section_In, const char *KeyName_In)
{
return static_cast<unsigned long>(GetPrivateProfileInt(Section_In, KeyName_In, 0, FileName_In));
}
bool Registry::ReadString(const char *FileName_In, const char *Section_In,
const char *KeyName_In, char *Buffer_Out, int nBufferSize)
{
return 0 != GetPrivateProfileString(Section_In, KeyName_In,
NULL, Buffer_Out, nBufferSize, FileName_In);
}
bool Registry::WriteStruct(const char *FileName_In, const char *Section_In,
const char *KeyName_In, void *Value_In, const int Size_in)
{
return 0 != WritePrivateProfileStruct(Section_In, KeyName_In, Value_In, Size_in, FileName_In);
}
bool Registry::ReadStruct(const char *FileName_In, const char *Section_In,
const char *KeyName_In, void *Value_Out, const int Size_in)
{
return 0 != GetPrivateProfileStruct(Section_In, KeyName_In, Value_Out, Size_in, FileName_In);
}
Registry::CSetupFile::CSetupFile()
{
}
Registry::CSetupFile::CSetupFile(const char* szFileName)
{
Open(szFileName);
}
Registry::CSetupFile::~CSetupFile()
{
}
inline unsigned long sdbmHash(const unsigned char *str)
{
unsigned long hash = 0;
int c;
while (c = *str++) { hash = c + (hash << 6) + (hash << 16) - hash; }
return hash;
}
bool Registry::CSetupFile::Open(const char* szFileName)
{
std::string fileLine;
std::string szSection;
std::string szKey;
std::string szValue;
fileLine.reserve(4096);
szSection.reserve(1024);
szKey.reserve(1024);
szValue.reserve(4096);
std::fstream file(szFileName, std::ios_base::in);
std::string::size_type nPosition = std::string::npos;
std::string::size_type nEndPosition = std::string::npos;
std::string::size_type nDataPosition = std::string::npos;
std::string::size_type nDataEndPosition = std::string::npos;
unsigned long dwSectionValue = 0;
if(file.is_open())
{
while(std::getline(file, fileLine))
{
nPosition = fileLine.find_first_not_of(" \r\n\t");
if(std::string::npos != nPosition)
{
if('[' == fileLine[nPosition])
{
// 섹션명임
nEndPosition = fileLine.find_first_of(']', nPosition);
if(std::string::npos != nEndPosition)
{
szSection.assign(fileLine.begin() + nPosition + 1,
fileLine.begin() + nEndPosition);
dwSectionValue = sdbmHash(reinterpret_cast<const unsigned char*>(szSection.c_str()));
}
}
else if(0 != fileLine.compare(nPosition, sizeof(char) * 2, "//"))
{
// 주석 아님
nEndPosition = fileLine.find_first_of('=', nPosition);
if(std::string::npos != nEndPosition)
{
// nEndPosition 좌우로 Key - Value Pair임.
nDataEndPosition = fileLine.find_last_not_of("= \t", nEndPosition);
if(std::string::npos != nDataEndPosition)
{
// 키 읽어옴.
szKey.assign(fileLine.begin() + nPosition,
fileLine.begin() + nDataEndPosition + 1);
nDataPosition = fileLine.find_first_not_of("= \t", nEndPosition);
if(std::string::npos != nDataPosition)
{
nDataEndPosition = fileLine.find_last_not_of(" \r\n\t");
if(std::string::npos != nDataEndPosition)
{
// 값 읽어옴
m_SetupMap.insert(SetupMap::value_type(
sdbmHash(reinterpret_cast<const unsigned char*>(szKey.c_str())) + dwSectionValue,
Data(szSection, szKey,
std::string(fileLine.begin() + nDataPosition, fileLine.begin() + nDataEndPosition + 1))));
}
}
}
}
}
}
}
}
return false;
}
void Registry::CSetupFile::Clear()
{
m_SetupMap.clear();
}
const char* Registry::CSetupFile::GetString(const char* szSection, const char* szKey,
const char* szDefaultValue)
{
DWORD dwHashValue = sdbmHash(reinterpret_cast<const unsigned char*>(szSection))
+ sdbmHash(reinterpret_cast<const unsigned char*>(szKey));
std::pair<SetupMap::iterator, SetupMap::iterator> pos_pair = m_SetupMap.equal_range(dwHashValue);
for(; pos_pair.first != pos_pair.second; ++pos_pair.first)
{
Data& data = pos_pair.first->second;
if(0 == data.m_szSection.compare(szSection) &&
0 == data.m_szKey.compare(szKey))
{
return data.m_szValue.c_str();
}
}
return szDefaultValue;
}
unsigned int Registry::CSetupFile::GetInt(const char* szSection, const char* szKey,
unsigned int nDefaultValue)
{
const char* szStr = GetString(szSection, szKey);
if(0 != szStr)
{
return atoi(szStr);
}
return nDefaultValue;
}

View File

@@ -0,0 +1,59 @@
#ifndef _REGISTRY_FUNCTIONS_H_
#define _REGISTRY_FUNCTIONS_H_
#include <map>
#include <string>
namespace Registry
{
bool WriteString(const char *FileName_In, const char *Section_In,
const char *KeyName_In, const char *Value_In);
unsigned long ReadInt(const char *FileName_In,
const char *Section_In, const char *KeyName_In);
bool ReadString(const char *FileName_In, const char *Section_In,
const char *KeyName_In, char *Buffer_Out, int nBufferSize);
bool WriteStruct(const char *FileName_In, const char *Section_In,
const char *KeyName_In, void *Value_In, const int Size_in);
bool ReadStruct(const char *FileName_In, const char *Section_In,
const char *KeyName_In, void *Value_Out, const int Size_in);
class CSetupFile
{
public:
CSetupFile();
CSetupFile(const char* szFileName);
~CSetupFile();
bool Open(const char* szFileName);
void Clear();
const char* GetString(const char* szSection, const char* szKey, const char* szDefaultValue = 0);
unsigned int GetInt(const char* szSection, const char* szKey, unsigned int nDefaultValue = 0);
private:
struct Data
{
std::string m_szSection;
std::string m_szKey;
std::string m_szValue;
Data(const std::string& szSection, const std::string& szKey, const std::string& szValue)
: m_szSection(szSection), m_szKey(szKey), m_szValue(szValue)
{
}
};
typedef std::multimap<unsigned long, Data> SetupMap;
SetupMap m_SetupMap;
};
};
#endif

View File

@@ -0,0 +1,702 @@
// 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
static COLORREF ColorTable[16] = { RGB( 0, 0, 0), // Black
RGB(255, 255, 255), // White
RGB(255, 255, 255), // ChatNormal
RGB(141, 180, 244), // ChatParty
RGB(255, 255, 255), // ChatFriend
RGB(255, 229, 57), // ChatGuild
RGB(255, 255, 255), // ChatStall
RGB( 53, 218, 193), // ChatShout
RGB(220, 220, 220), // ChatAdminNormal
RGB(255, 128, 64), // ChatAdminShout
RGB(255, 128, 239), // ChatWhisper
RGB(255, 0, 255), // ChatNotice
RGB(204, 128, 255), // ChatTrade
RGB( 38, 255, 38), // Call : 운영자를 부르는 유저의 목소리-_ -a
RGB(255, 0, 255), // GMReport
RGB( 0, 0, 0) }; // BackColor
BEGIN_MESSAGE_MAP(CXListBox, CListBox)
//{{AFX_MSG_MAP(CXListBox)
ON_WM_LBUTTONDBLCLK()
ON_WM_CONTEXTMENU()
ON_COMMAND(ID_EDIT_SELECT_ALL, OnEditSelectAll)
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_EDIT_CLEAR, OnEditClear)
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
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)
{
CDC* pDC = CDC::FromHandle(lpDIS->hDC);
COLORREF oldtextcolor, oldbackgroundcolor;
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],
(int)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 = (int)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, true);
}
//////////////////////////////////////////////////////////////////////////////
// AddLine
void CXListBox::AddLine(Color tc, Color bc, LPCTSTR lpszLine, BOOL bAutoScroll)
{
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 < 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 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(bAutoScroll && (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, true);
}
//////////////////////////////////////////////////////////////////////////////
// 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,93 @@
// 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,
ChatNormal, ChatParty, ChatFriend, ChatGuild, ChatStall, ChatShout,
ChatAdminNormal, ChatAdminShout, ChatWhisper, ChatNotice, ChatTrade, Call, GMReport, BackColor
};
void EnableColor(BOOL bEnable);
// Operations
public:
void AddLine(Color tc, Color bc, LPCTSTR lpszLine, BOOL bAutoScroll = TRUE);
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);
void SetContextMenuId(UINT nId) { m_nContextMenuId = nId; }
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 OnContextMenu(CWnd* pWnd, 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()
};
#endif
///////////////////////////////////////////////////////////////////////////////

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,13 @@
//
// ChatParser.RC2 - Microsoft Visual C++에서 직접 편집하지 않는 리소스
//
#ifdef APSTUDIO_INVOKED
#error 이 파일은 Microsoft Visual C++에서 편집할 수 없습니다.
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// 여기에 수동으로 편집한 리소스를 추가합니다.
/////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,31 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ChatParser.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_CHATPARSER_DIALOG 102
#define IDR_MAINFRAME 128
#define IDC_OPEN_FILENAME 1000
#define IDC_OPENFILE 1001
#define IDC_FINDLIST 1002
#define IDC_CHATLIST 1003
#define IDC_OLDVERSION 1004
#define IDC_SERVERID 1005
#define IDC_ZONEID 1006
#define IDC_ZONEID2 1007
#define IDC_CHATTYPE 1007
#define IDC_FINDNAME 1008
#define IDC_FINDNAMECHK 1009
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1009
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,76 @@
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다.
// ChatParser.pch는 미리 컴파일된 헤더가 됩니다.
// stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다.
#include "stdafx.h"
#include "ChatParserSetup.h"
/// \brief 섹션명과 키로 ini 셋업 파일에서 셋팅된 값 얻기
/// \param szSection 얻고자하는 값이 속한 섹션명
/// \param szKey 얻고자 하는 값에 매칭되는 키
const char* GetMyINIString(const char* szSection, const char* szKey)
{
const char* szResult = CChatParserSetup::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;
}
const int GetChatType(const char* szType)
{
int iCount = 17;
char* strFind[] = {
"NORMAL",
"PARTY",
"FRIEND",
"GUILD",
"CLIENT_LOG",
"STALL",
"SHOUT",
"ADMIN_NORMAL_CHAT",
"ADMIN_SHOUT",
"WHISPER",
"TRADE",
"CAMP_SHOP",
"NOTIFY_CHAR_INFO",
"FIND_PARTY",
"ENEMY_CHECK",
"DICE",
"NOTICE"
};
int FindID[] = {
NORMAL,
PARTY,
FRIEND,
GUILD,
CLIENT_LOG,
STALL,
SHOUT,
ADMIN_NORMAL_CHAT,
ADMIN_SHOUT,
WHISPER,
TRADE,
CAMP_SHOP,
NOTIFY_CHAR_INFO,
FIND_PARTY,
ENEMY_CHECK,
DICE,
NOTICE
};
for(int i = 0; i < iCount; ++i)
{
if(strcmp(szType, strFind[i]) == 0)
return FindID[i]+1;
}
return 0;
}

View File

@@ -0,0 +1,111 @@
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
// 들어 있는 포함 파일입니다.
#pragma once
#ifndef _SECURE_ATL
#define _SECURE_ATL 1
#endif
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
#endif
// 아래 지정된 플랫폼에 우선하는 플랫폼을 대상으로 하는 경우 다음 정의를 수정하십시오.
// 다른 플랫폼에 사용되는 해당 값의 최신 정보는 MSDN을 참조하십시오.
#ifndef WINVER // Windows XP 이상에서만 기능을 사용할 수 있습니다.
#define WINVER 0x0501 // 다른 버전의 Windows에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#ifndef _WIN32_WINNT // Windows XP 이상에서만 기능을 사용할 수 있습니다.
#define _WIN32_WINNT 0x0501 // 다른 버전의 Windows에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#ifndef _WIN32_WINDOWS // Windows 98 이상에서만 기능을 사용할 수 있습니다.
#define _WIN32_WINDOWS 0x0410 // Windows Me 이상에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#ifndef _WIN32_IE // IE 6.0 이상에서만 기능을 사용할 수 있습니다.
#define _WIN32_IE 0x0600 // 다른 버전의 IE에 맞도록 적합한 값으로 변경해 주십시오.
#endif
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 일부 CString 생성자는 명시적으로 선언됩니다.
// MFC의 공통 부분과 무시 가능한 경고 메시지에 대한 숨기기를 해제합니다.
#define _AFX_ALL_WARNINGS
#include <afxwin.h> // MFC 핵심 및 표준 구성 요소입니다.
#include <afxext.h> // MFC 확장입니다.
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // Internet Explorer 4 공용 컨트롤에 대한 MFC 지원입니다.
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // Windows 공용 컨트롤에 대한 MFC 지원입니다.
#endif // _AFX_NO_AFXCMN_SUPPORT
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
#pragma warning(disable : 4996) // vs2005에서 추가됨. 보안상의 이유로 더 이상 사용되지 않는 MFC나 ATL 함수를 사용하는 경우에도 C4996이 발생할 수 있습니다
enum ChatCmdType
{
NORMAL = 0, // 현재 캐릭터 좌표를 가지고 판단.
PARTY = 1, // 파티 채팅
FRIEND = 2, // 친구 채팅 (이름 char[16] * m_cNum - MAX 100개)
GUILD = 3, // 길드 채팅
CLIENT_LOG = 5,
STALL = 6, // 노점상 채팅 (이름 char[16] * m_cNum - MAX 10개)
SHOUT = 7, // 외치기
ADMIN_NORMAL_CHAT = 8, // 운영자 통상 채팅 (Ack로만 사용)
ADMIN_SHOUT = 9, // 운영자 외치기 (Ack로만 사용)
WHISPER = 10, // 이 번호는 쓰이지 않는다.Whisper는 별도의 패킷을 사용하기 때문이다. 단, 로그시에 쓰인다.
TRADE = 11, // 외치기와 동일 (색 구분용으로 다른 커맨드로 만듬)
CAMP_SHOP = 12, // 길드 요새 상점 채팅 (이름 char[16] * m_cNum - MAX 10개)
NOTIFY_CHAR_INFO = 13, // 운영자 명령 hp
FIND_PARTY = 14, // 파티 찾기
ENEMY_CHECK = 15, // 적아군 식별.
DICE = 16, // 주사위 채팅 (파티채팅과 동일)
GMREPORT = 17, // 지엠 채팅
NOTICE = 255,
PktChatMaxSize = 180
};
const char* GetMyINIString(const char* szSection, const char* szKey);
const int GetChatType(const char* szType);