LosaDev source snapshot 2019
This commit is contained in:
commit
c198676e97
20588 files changed
+8812878
No files matched your search
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BillingInfoList", "BillingInfoList\BillingInfoList.vcxproj", "{7E0D6193-D7F6-4BC5-AAFB-3E2361C24027}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7E0D6193-D7F6-4BC5-AAFB-3E2361C24027}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7E0D6193-D7F6-4BC5-AAFB-3E2361C24027}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7E0D6193-D7F6-4BC5-AAFB-3E2361C24027}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7E0D6193-D7F6-4BC5-AAFB-3E2361C24027}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,94 @@
|
||||
|
||||
// BillingInfoList.cpp : 응용 프로그램에 대한 클래스 동작을 정의합니다.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "BillingInfoList.h"
|
||||
#include "BillingInfoListDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
|
||||
// CBillingInfoListApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CBillingInfoListApp, CWinApp)
|
||||
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CBillingInfoListApp 생성
|
||||
|
||||
CBillingInfoListApp::CBillingInfoListApp()
|
||||
{
|
||||
// 다시 시작 관리자 지원
|
||||
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
|
||||
|
||||
// TODO: 여기에 생성 코드를 추가합니다.
|
||||
// InitInstance에 모든 중요한 초기화 작업을 배치합니다.
|
||||
}
|
||||
|
||||
|
||||
// 유일한 CBillingInfoListApp 개체입니다.
|
||||
|
||||
CBillingInfoListApp theApp;
|
||||
|
||||
|
||||
// CBillingInfoListApp 초기화
|
||||
|
||||
BOOL CBillingInfoListApp::InitInstance()
|
||||
{
|
||||
// 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을
|
||||
// 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControlsEx()가 필요합니다.
|
||||
// InitCommonControlsEx()를 사용하지 않으면 창을 만들 수 없습니다.
|
||||
INITCOMMONCONTROLSEX InitCtrls;
|
||||
InitCtrls.dwSize = sizeof(InitCtrls);
|
||||
// 응용 프로그램에서 사용할 모든 공용 컨트롤 클래스를 포함하도록
|
||||
// 이 항목을 설정하십시오.
|
||||
InitCtrls.dwICC = ICC_WIN95_CLASSES;
|
||||
InitCommonControlsEx(&InitCtrls);
|
||||
|
||||
CWinApp::InitInstance();
|
||||
|
||||
|
||||
AfxEnableControlContainer();
|
||||
|
||||
// 대화 상자에 셸 트리 뷰 또는
|
||||
// 셸 목록 뷰 컨트롤이 포함되어 있는 경우 셸 관리자를 만듭니다.
|
||||
CShellManager *pShellManager = new CShellManager;
|
||||
|
||||
// 표준 초기화
|
||||
// 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면
|
||||
// 아래에서 필요 없는 특정 초기화
|
||||
// 루틴을 제거해야 합니다.
|
||||
// 해당 설정이 저장된 레지스트리 키를 변경하십시오.
|
||||
// TODO: 이 문자열을 회사 또는 조직의 이름과 같은
|
||||
// 적절한 내용으로 수정해야 합니다.
|
||||
SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램"));
|
||||
|
||||
CBillingInfoListDlg dlg(m_lpCmdLine);
|
||||
m_pMainWnd = &dlg;
|
||||
INT_PTR nResponse = dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
// TODO: 여기에 [확인]을 클릭하여 대화 상자가 없어질 때 처리할
|
||||
// 코드를 배치합니다.
|
||||
}
|
||||
else if (nResponse == IDCANCEL)
|
||||
{
|
||||
// TODO: 여기에 [취소]를 클릭하여 대화 상자가 없어질 때 처리할
|
||||
// 코드를 배치합니다.
|
||||
}
|
||||
|
||||
// 위에서 만든 셸 관리자를 삭제합니다.
|
||||
if (pShellManager != NULL)
|
||||
{
|
||||
delete pShellManager;
|
||||
}
|
||||
|
||||
// 대화 상자가 닫혔으므로 응용 프로그램의 메시지 펌프를 시작하지 않고 응용 프로그램을 끝낼 수 있도록 FALSE를
|
||||
// 반환합니다.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
|
||||
// BillingInfoList.h : PROJECT_NAME 응용 프로그램에 대한 주 헤더 파일입니다.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error "PCH에 대해 이 파일을 포함하기 전에 'stdafx.h'를 포함합니다."
|
||||
#endif
|
||||
|
||||
#include "resource.h" // 주 기호입니다.
|
||||
|
||||
|
||||
// CBillingInfoListApp:
|
||||
// 이 클래스의 구현에 대해서는 BillingInfoList.cpp을 참조하십시오.
|
||||
//
|
||||
|
||||
class CBillingInfoListApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CBillingInfoListApp();
|
||||
|
||||
// 재정의입니다.
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
|
||||
// 구현입니다.
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
extern CBillingInfoListApp theApp;
|
||||
Binary file not shown.
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7E0D6193-D7F6-4BC5-AAFB-3E2361C24027}</ProjectGuid>
|
||||
<RootNamespace>BillingInfoList</RootNamespace>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IntDir>./$(ProjectName)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>
|
||||
</AdditionalDependencies>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0412</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0412</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\BillingInfoList.ico" />
|
||||
<None Include="res\BillingInfoList.rc2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="BillingInfoList.h" />
|
||||
<ClInclude Include="BillingInfoListDlg.h" />
|
||||
<ClInclude Include="cFile.h" />
|
||||
<ClInclude Include="define.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BillingInfoList.cpp" />
|
||||
<ClCompile Include="BillingInfoListDlg.cpp" />
|
||||
<ClCompile Include="cFile.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="BillingInfoList.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties RESOURCE_FILE="BillingInfoList.rc" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="소스 파일">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="헤더 파일">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="리소스 파일">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Main">
|
||||
<UniqueIdentifier>{8b3e1285-3304-466e-ba71-07730c088d0d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\BillingInfoList.rc2">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</None>
|
||||
<None Include="res\BillingInfoList.ico">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="BillingInfoList.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BillingInfoListDlg.h">
|
||||
<Filter>Main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="cFile.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="define.h">
|
||||
<Filter>Main</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BillingInfoList.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BillingInfoListDlg.cpp">
|
||||
<Filter>Main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="cFile.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="BillingInfoList.rc">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,151 @@
|
||||
|
||||
// BillingInfoListDlg.h : 헤더 파일
|
||||
//
|
||||
|
||||
// CBillingInfoListDlg 대화 상자
|
||||
#include "afxwin.h"
|
||||
class CBillingInfoListDlg : public CDialogEx
|
||||
{
|
||||
// 생성입니다.
|
||||
public:
|
||||
|
||||
CBillingInfoListDlg(const TCHAR* strParameter, CWnd* pParent = NULL); // 표준 생성자입니다.
|
||||
|
||||
public:
|
||||
|
||||
float m_fChangeCash;
|
||||
int m_iEtcItemValue;
|
||||
int m_iDecoItem;
|
||||
int m_iHero_Normal;
|
||||
int m_iHero_Rare;
|
||||
int m_iHero_Premium;
|
||||
int m_iChange;
|
||||
|
||||
// 빌링
|
||||
std::map<int, CString> m_GoodsInfoMap;
|
||||
typedef std::vector< SoldierInfo > vSoldierInfo;
|
||||
vSoldierInfo m_vSoldierInfo;
|
||||
|
||||
int m_iMortmainCharGoodsNoValue;
|
||||
DWORDVec m_vPackageEtcItemShortTypeList;
|
||||
DWORDVec m_vPackageExtraItemMachineCodeList;
|
||||
|
||||
|
||||
// 아이템 이름리스트
|
||||
std::map<int, CString> m_mapItemName;
|
||||
|
||||
// 기타아이템
|
||||
float fMortmainCharMultiplyCash;
|
||||
float fMortmainPremiumCharMultiplyCash;
|
||||
float fMortmainRareCharMultiplyCash;
|
||||
|
||||
typedef std::vector< LimitData* > vLimitData; // vector을 다른것으로 대체할때 INI Reload 개선 필요
|
||||
vLimitData m_vPesoLimitDataList;
|
||||
vLimitData m_vCashLimitDataList;
|
||||
vLimitData m_vPremiumCashLimitDataList;
|
||||
vLimitData m_vRareCashLimitDataList;
|
||||
|
||||
std::map<int, CItemEtc*> MapItemEtc;
|
||||
|
||||
// 용병아이템
|
||||
vHeroClassRate m_vecHeroClassRate;
|
||||
std::map<int, PriceData*> m_MapItemClass;
|
||||
|
||||
// 치장아이템
|
||||
typedef std::vector< SexDecoList > vSexDecoList; // vector을 다른것으로 대체할때 INI Reload 개선 필요
|
||||
vSexDecoList m_vSexList;
|
||||
|
||||
//ExtraItem
|
||||
mExtraItem m_mapExtraItem;
|
||||
|
||||
// 팝업스토어상점
|
||||
vPopupItemInfo m_vPopupItemInfo;
|
||||
|
||||
// 세일관련
|
||||
vSaleInfoVector m_vSaleInfoVector;
|
||||
|
||||
// 대화 상자 데이터입니다.
|
||||
enum { IDD = IDD_BILLINGINFOLIST_DIALOG };
|
||||
|
||||
protected:
|
||||
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
|
||||
|
||||
protected:
|
||||
|
||||
// Init Info
|
||||
void LoadChangeItemInfo();
|
||||
|
||||
// INI Read
|
||||
int LoadIntSetting(CString lpAppName, CString lpKeyName, int iDefailt, CString strfullPath);
|
||||
float LoadFloatSetting(CString lpAppName, CString lpKeyName, float fDefailt, CString strfullPath);
|
||||
CString LoadStringSetting(CString lpAppName, CString lpKeyName, CString strDefault, CString strfullPath);
|
||||
|
||||
void ChangeIntSetting(CString lpAppName, CString lpKeyName, int ChangeValue, CString strfullPath);
|
||||
|
||||
// Load
|
||||
void LoadBillingGoods();
|
||||
void LoadBillingEtcItem(CString fullPath);
|
||||
void LoadBillingExtraItem(CString fullPath);
|
||||
|
||||
void LoadItemNameINI(const TCHAR* file);
|
||||
void LoadEtcItemINI(const TCHAR* file);
|
||||
void LoadDecoItemINI(const TCHAR* file);
|
||||
void LoadDecoInfoItemINI(const TCHAR* path);
|
||||
void LoadSoldierItemINI(const TCHAR* file);
|
||||
|
||||
void LoadExtraItemINI(const TCHAR* file);
|
||||
void LoadPopupItemINI(const TCHAR* file);
|
||||
|
||||
// 저장처리시 필요
|
||||
int GetGoodsNoValue( int iLimitSeconds );
|
||||
bool IsPackageItem( int iEtcItemShortType );
|
||||
bool IsPackageItemExtra( int iExtraItemMachineCode );
|
||||
int GetClassRate(int iClass);
|
||||
CString GetGoodsName( int iGoodsNo);
|
||||
DWORD ConvertYYMMDDHHMMToDate( WORD wYear, WORD wMonth, WORD wDay, WORD wHour, WORD wMinute );
|
||||
bool IsCheckAlive( SYSTEMTIME st , DWORD dwStartDate, DWORD dwEndDate );
|
||||
int GetCash( ItemType eItemType, int iType1, int iType2 );
|
||||
|
||||
// 저장
|
||||
void SaveEtcItemTotal();
|
||||
void SaveEtcItemActive();
|
||||
|
||||
void SaveDecoItemTotal();
|
||||
void SaveDecoItemActive();
|
||||
|
||||
void SaveSoldierItemTotal();
|
||||
void SaveSoldierItemActive();
|
||||
|
||||
void SaveExtraItemTotal();
|
||||
void SaveExtraItemActive();
|
||||
|
||||
void SavePopupItemTotal();
|
||||
void SavePopupItemActive();
|
||||
|
||||
// 구현입니다.
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
CString m_strParameter;
|
||||
|
||||
// 생성된 메시지 맵 함수
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
afx_msg void OnBnClickedEtcitem();
|
||||
afx_msg void OnBnClickedDecoitem();
|
||||
afx_msg void OnBnClickedSoldier();
|
||||
afx_msg void OnBnClickedExtraitem();
|
||||
afx_msg void OnBnClickedPopup();
|
||||
afx_msg void OnBnClickedTotal();
|
||||
afx_msg void OnBnClickedItemtotal();
|
||||
afx_msg void OnBnClickedItemetc();
|
||||
afx_msg void OnBnClickedItemdeco();
|
||||
afx_msg void OnBnClickedItemsoldier();
|
||||
afx_msg void OnBnClickedItemextra();
|
||||
afx_msg void OnBnClickedItemPopup();
|
||||
CStatic text_total;
|
||||
};
|
||||
@@ -0,0 +1,100 @@
|
||||
================================================================================
|
||||
MFC 라이브러리 : BillingInfoList 프로젝트 개요
|
||||
================================================================================
|
||||
|
||||
응용 프로그램 마법사에서 이 BillingInfoList 응용 프로그램을
|
||||
만들었습니다. 이 응용 프로그램은 MFC의 기본 사용법을 보여 줄 뿐만 아니라 응용
|
||||
프로그램작성을 위한 기본 구조를 제공합니다.
|
||||
|
||||
이 파일에는 BillingInfoList 응용 프로그램을 구성하는 각 파일에 대한
|
||||
요약 설명이 포함되어 있습니다.
|
||||
|
||||
BillingInfoList.vcxproj
|
||||
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 주 프로젝트 파일입니다.
|
||||
파일을 생성한 Visual C++ 버전에 대한 정보와 응용 프로그램 마법사를 사용하여 선택한
|
||||
플랫폼, 구성 및 프로젝트 기능에 대한 정보가 들어 있습니다.
|
||||
|
||||
BillingInfoList.vcxproj.filters
|
||||
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 필터 파일입니다.
|
||||
이 파일에는 프로젝트의 파일과 필터 간의 연결 정보가 들어 있습니다. 이러한
|
||||
연결은 특정 노드에서 유사한 확장명으로 그룹화된 파일을 표시하기 위해
|
||||
IDE에서 사용됩니다. 예를 들어 ".cpp" 파일은 "소스 파일" 필터와 연결되어
|
||||
있습니다.
|
||||
|
||||
|
||||
BillingInfoList.h
|
||||
응용 프로그램의 기본 헤더 파일입니다. 여기에는 다른 프로젝트 관련
|
||||
헤더(Resource.h 포함)가 들어 있고 CBillingInfoListApp 응용 프로그램
|
||||
클래스를 선언합니다.
|
||||
|
||||
BillingInfoList.cpp
|
||||
응용 프로그램 클래스 CBillingInfoListApp이(가) 들어 있는 기본 응용 프로그램
|
||||
소스 파일입니다.
|
||||
|
||||
BillingInfoList.rc
|
||||
프로그램에서 사용하는 모든 Microsoft Windows 리소스의 목록입니다.
|
||||
여기에는 RES 하위 디렉터리에 저장된 아이콘, 비트맵 및 커서가
|
||||
포함됩니다. 이 파일은 Microsoft Visual C++에서 직접
|
||||
편집할 수 있습니다. 프로젝트 리소스는 1042에 있습니다.
|
||||
|
||||
res\BillingInfoList.ico
|
||||
응용 프로그램의 아이콘으로 사용되는 아이콘 파일입니다. 이 아이콘은
|
||||
주 리소스 파일인 BillingInfoList.rc에 의해 포함됩니다.
|
||||
|
||||
res\BillingInfoList.rc2
|
||||
이 파일에는 Microsoft Visual C++ 이외의 다른 도구에서 편집한 리소스가
|
||||
들어 있습니다. 리소스 편집기로 편집할 수 없는 모든 리소스는
|
||||
이 파일에 넣어야 합니다.
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
응용 프로그램 마법사에서 하나의 대화 상자 클래스가 만들어집니다.
|
||||
|
||||
BillingInfoListDlg.h, BillingInfoListDlg.cpp - 대화 상자
|
||||
이 파일에는 CBillingInfoListDlg 클래스가 들어 있습니다. 이 클래스는
|
||||
응용 프로그램의 주 대화 상자 동작을 정의합니다. 대화 상자의 템플릿은
|
||||
Microsoft Visual C++에서 편집할 수 있는 BillingInfoList.rc에 있습니다.
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
기타 기능:
|
||||
|
||||
ActiveX 컨트롤
|
||||
응용 프로그램에서 ActiveX 컨트롤을 사용할 수 있도록 지원합니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
기타 표준 파일:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
이 파일은 미리 컴파일된 헤더 파일(PCH)인 BillingInfoList.pch와
|
||||
미리 컴파일된 형식 파일인 StdAfx.obj를 빌드하는 데 사용됩니다.
|
||||
|
||||
Resource.h
|
||||
새 리소스 ID를 정의하는 표준 헤더 파일입니다.
|
||||
Microsoft Visual C++에서 이 파일을 읽고 업데이트합니다.
|
||||
|
||||
BillingInfoList.manifest
|
||||
응용 프로그램 매니페스트 파일은 Windows XP에서 특정 버전의 Side-by-Side
|
||||
어셈블리에 대한 응용 프로그램 종속성을 설명하는 데 사용됩니다. 로더는 이 정보를
|
||||
사용하여 어셈블리 캐시에서 적절한 어셈블리를 로드하거나 응용 프로그램에서 전용
|
||||
어셈블리를 로드합니다. 응용 프로그램 매니페스트는 응용 프로그램 실행 파일과 같은
|
||||
폴더에 설치된 외부 .manifest 파일로 재배포를 위해 포함되거나 리소스의 형태로
|
||||
실행 파일에 포함될 수 있습니다.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
기타 참고:
|
||||
|
||||
응용 프로그램 마법사는 "TODO:"를 사용하여 추가하거나 사용자 지정해야 하는
|
||||
소스 코드 부분을 나타냅니다.
|
||||
|
||||
응용 프로그램이 공유 DLL에서 MFC를 사용하는 경우 해당 MFC DLL을
|
||||
재배포해야 합니다. 그리고 응용 프로그램이 운영 체제의 로캘과
|
||||
다른 언어를 사용하는 경우 해당 지역화된 리소스인 MFC100XXX.DLL을
|
||||
재배포해야 합니다. 이 두가지 항목에 대한 자세한 내용은
|
||||
MSDN 설명서의 Visual C++ 응용 프로그램 재배포 항목을
|
||||
참조하십시오.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,271 @@
|
||||
// cFile.cpp: implementation of the cFile class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "cFile.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
cFile::cFile() : m_hFile(INVALID_HANDLE_VALUE), m_dwSizeLow(0), m_dwSizeHigh(0)
|
||||
{
|
||||
}
|
||||
|
||||
cFile::cFile(LPCTSTR fileName, DWORD dwMode, DWORD dwShareMode, DWORD dwCreationDisposition) : m_hFile(INVALID_HANDLE_VALUE), m_dwSizeLow(0), m_dwSizeHigh(0)
|
||||
{
|
||||
Open(fileName, dwMode, dwShareMode, dwCreationDisposition);
|
||||
}
|
||||
|
||||
cFile::~cFile()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// operation
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
BOOL cFile::Open(const TCHAR* fileName, DWORD dwMode, DWORD dwShareMode, DWORD dwCreationDisposition)
|
||||
{
|
||||
Close();
|
||||
|
||||
m_hFile = CreateFile( reinterpret_cast<LPCTSTR>(fileName),
|
||||
dwMode,
|
||||
dwShareMode,
|
||||
NULL,
|
||||
dwCreationDisposition,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
|
||||
if(m_hFile == INVALID_HANDLE_VALUE) return FALSE;
|
||||
|
||||
return (m_hFile == INVALID_HANDLE_VALUE) ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
void cFile::Close()
|
||||
{
|
||||
if(m_hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
CloseHandle(m_hFile);
|
||||
m_hFile = NULL;
|
||||
}
|
||||
|
||||
m_dwSizeLow = 0;
|
||||
m_dwSizeHigh = 0;
|
||||
}
|
||||
|
||||
BOOL cFile::Move(DWORD dwOrigin, LONG lOffset)
|
||||
{
|
||||
if(m_hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD dwResult = SetFilePointer( m_hFile,
|
||||
lOffset,
|
||||
NULL,
|
||||
dwOrigin);
|
||||
return (dwResult == 0xFFFFFFFF) ? FALSE : TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DWORD cFile::GetFileSize()
|
||||
{
|
||||
if(m_dwSizeLow != 0)
|
||||
return m_dwSizeLow;
|
||||
|
||||
DWORD dwError = 0;
|
||||
if(m_hFile != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
m_dwSizeLow = ::GetFileSize(m_hFile, &m_dwSizeHigh);
|
||||
if((INVALID_FILE_SIZE == m_dwSizeLow) &&
|
||||
((dwError = GetLastError()) != NO_ERROR))
|
||||
return 0;
|
||||
}
|
||||
return m_dwSizeLow;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// cFileReader class
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
cFileReader::cFileReader(const TCHAR* fileName) : m_nReadType(-1)
|
||||
{
|
||||
if(fileName != NULL)
|
||||
{
|
||||
Open(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL cFileReader::Open(const TCHAR* fileName)
|
||||
{
|
||||
if(cFile::Open(fileName, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING))
|
||||
{
|
||||
return (GetBOM() > 0) ? TRUE : FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL cFileReader::Read(BYTE* buffer, const DWORD dwLength)
|
||||
{
|
||||
DWORD dwWritten = 0;
|
||||
if(m_hFile == INVALID_HANDLE_VALUE) return FALSE;
|
||||
|
||||
if(ReadFile( m_hFile,
|
||||
buffer,
|
||||
dwLength,
|
||||
&dwWritten,
|
||||
NULL))
|
||||
{
|
||||
if(dwLength == dwWritten) return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL cFileReader::Convert(const BYTE* bufferA, const int lengthA, BYTE* bufferB, const int lengthB)
|
||||
{
|
||||
switch(m_nReadType)
|
||||
{
|
||||
case FILEFORMAT_ANSI :
|
||||
CopyMemory(bufferB, bufferA, (lengthA > lengthB) ? lengthB : lengthA);
|
||||
return TRUE;
|
||||
|
||||
case FILEFORMAT_UNICODE_UTF8 :
|
||||
CopyMemory(bufferB, bufferA, (lengthA > lengthB) ? lengthB : lengthA);
|
||||
return TRUE;
|
||||
|
||||
case FILEFORMAT_UNICODE_LE :
|
||||
WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)bufferA, lengthA, (LPSTR)bufferB, lengthB, NULL, NULL);
|
||||
return TRUE;
|
||||
|
||||
case FILEFORMAT_UNICODE_BE :
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int cFileReader::GetBOM()
|
||||
{
|
||||
if((-1) == m_nReadType)
|
||||
{
|
||||
Move(FILE_BEGIN, 0);
|
||||
|
||||
WORD BOM = 0;
|
||||
if(Read(reinterpret_cast<BYTE*>(&BOM), sizeof(WORD)))
|
||||
{
|
||||
switch(BOM)
|
||||
{
|
||||
case 0xFEFF :
|
||||
m_nReadType = FILEFORMAT_UNICODE_LE;
|
||||
Move(FILE_BEGIN, 2);
|
||||
break;
|
||||
|
||||
case 0xFFFE :
|
||||
m_nReadType = 0; //FILEFORMAT_UNICODE_BE; not supported
|
||||
Move(FILE_BEGIN, 2);
|
||||
break;
|
||||
|
||||
case 0xBBEF :
|
||||
m_nReadType = FILEFORMAT_UNICODE_UTF8;
|
||||
Move(FILE_BEGIN, 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
m_nReadType = FILEFORMAT_ANSI;
|
||||
Move(FILE_BEGIN, 0);
|
||||
break;
|
||||
}
|
||||
return m_nReadType;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return m_nReadType;
|
||||
}
|
||||
|
||||
DWORD cFileReader::GetFileSize()
|
||||
{
|
||||
if(0 == m_dwSizeLow)
|
||||
{
|
||||
cFile::GetFileSize();
|
||||
|
||||
switch(m_nReadType)
|
||||
{
|
||||
case FILEFORMAT_UNICODE_LE :
|
||||
case FILEFORMAT_UNICODE_BE :
|
||||
m_dwSizeLow -= (2);
|
||||
break;
|
||||
|
||||
case FILEFORMAT_UNICODE_UTF8 :
|
||||
m_dwSizeLow -= (3);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return m_dwSizeLow;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// cFileWriter class
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
cFileWriter::cFileWriter(const TCHAR* fileName)
|
||||
{
|
||||
if(fileName != NULL)
|
||||
{
|
||||
Open(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL cFileWriter::Open(const TCHAR* fileName)
|
||||
{
|
||||
if(cFile::Open(fileName, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, CREATE_ALWAYS))
|
||||
{
|
||||
WriteHeader();
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL cFileWriter::Write(const BYTE* buffer, const DWORD dwLength)
|
||||
{
|
||||
if(dwLength == 0)
|
||||
return TRUE;
|
||||
|
||||
DWORD dwBytes = 0;
|
||||
if(WriteFile( m_hFile,
|
||||
buffer,
|
||||
dwLength,
|
||||
&dwBytes,
|
||||
NULL))
|
||||
{
|
||||
return (dwBytes == dwLength) ? TRUE : FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL cFileWriter::WriteFormat(const TCHAR* format, ...)
|
||||
{
|
||||
TCHAR buffer[4096];
|
||||
|
||||
va_list marker;
|
||||
va_start(marker, format);
|
||||
_vstprintf_s(buffer, _countof(buffer), format, marker);
|
||||
va_end(marker);
|
||||
|
||||
return Write(reinterpret_cast<BYTE*>(buffer), (_tcslen(buffer) * sizeof(TCHAR)));
|
||||
}
|
||||
|
||||
void cFileWriter::WriteHeader()
|
||||
{
|
||||
#ifdef _UNICODE
|
||||
Move(FILE_BEGIN, 0);
|
||||
|
||||
WORD BOM = 0xFEFF;
|
||||
Write(reinterpret_cast<BYTE*>(&BOM), sizeof(BOM));
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
// cFile
|
||||
class cFile
|
||||
{
|
||||
public:
|
||||
cFile();
|
||||
cFile(LPCTSTR fileName, DWORD dwMode, DWORD dwShareMode, DWORD dwCreationDisposition);
|
||||
virtual ~cFile();
|
||||
|
||||
public:
|
||||
BOOL Open(const TCHAR* fileName, DWORD dwMode, DWORD dwShareMode, DWORD dwCreationDisposition);
|
||||
void Close();
|
||||
|
||||
BOOL Move(DWORD dwOrigin, LONG lOffset);
|
||||
virtual DWORD GetFileSize();
|
||||
|
||||
enum SaveFileFormat
|
||||
{
|
||||
FILEFORMAT_ANSI = 1,
|
||||
FILEFORMAT_UNICODE_UTF8,
|
||||
FILEFORMAT_UNICODE_LE,
|
||||
FILEFORMAT_UNICODE_BE,
|
||||
};
|
||||
|
||||
protected:
|
||||
HANDLE m_hFile;
|
||||
DWORD m_dwSizeLow, m_dwSizeHigh;
|
||||
};
|
||||
|
||||
// cFileReader
|
||||
class cFileReader : public cFile
|
||||
{
|
||||
public:
|
||||
cFileReader(const TCHAR* fileName=NULL);
|
||||
|
||||
public:
|
||||
BOOL Open(const TCHAR* fileName);
|
||||
|
||||
BOOL Read(BYTE* buffer, const DWORD dwLength);
|
||||
BOOL Convert(const BYTE* bufferA, const int lengthA, BYTE* bufferB, const int lengthB);
|
||||
|
||||
int GetBOM();
|
||||
|
||||
virtual DWORD GetFileSize();
|
||||
|
||||
private:
|
||||
int m_nReadType;
|
||||
};
|
||||
|
||||
// cFileWriter
|
||||
class cFileWriter : public cFile
|
||||
{
|
||||
public:
|
||||
cFileWriter(const TCHAR* fileName=NULL);
|
||||
|
||||
public:
|
||||
BOOL Open(const TCHAR* fileName);
|
||||
|
||||
BOOL Write(const BYTE* buffer, const DWORD dwLength);
|
||||
BOOL WriteFormat(const TCHAR* format, ...);
|
||||
|
||||
void WriteHeader();
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
[ChangeInfo]
|
||||
; 기본값을 100으로 한다.
|
||||
ChangeCash = 2.3571
|
||||
etcitem = 100
|
||||
decoItem = 100
|
||||
|
||||
Class_Max = 3
|
||||
|
||||
Class_1Start = 1
|
||||
Class_1End = 1
|
||||
Class_1Rate = 70
|
||||
|
||||
Class_2Start = 2
|
||||
Class_2End = 10
|
||||
Class_2Rate = 50
|
||||
|
||||
Class_32Start = 20
|
||||
Class_3End = 30
|
||||
Class_3Rate = 10
|
||||
|
||||
normal_char = 100
|
||||
rare_char = 100
|
||||
premium_char = 100
|
||||
|
||||
Change = 1
|
||||
@@ -0,0 +1,319 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define COMPARE(x,min,max) (((x)>=(min))&&((x)<(max)))
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 기타관련 ///
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
class CEtcValue
|
||||
{
|
||||
public:
|
||||
int iValue; // 갯수
|
||||
int iPeso; // 돈
|
||||
int iCash; // 캐쉬
|
||||
int iActive; // 실행여부
|
||||
};
|
||||
|
||||
|
||||
class CItemEtc
|
||||
{
|
||||
public:
|
||||
CString strName; // 이름
|
||||
int iType; // type
|
||||
|
||||
std::vector<CEtcValue*> EtcValueList;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 치장관련 ///
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
typedef std::vector<DWORD> DWORDVec;
|
||||
typedef struct tagSoldierInfo
|
||||
{
|
||||
int m_iLimitSeconds;
|
||||
int m_iGoodsNoValue;
|
||||
|
||||
tagSoldierInfo()
|
||||
{
|
||||
m_iLimitSeconds = 0;
|
||||
m_iGoodsNoValue = 0;
|
||||
}
|
||||
}SoldierInfo;
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef struct tagDecoData
|
||||
{
|
||||
CString m_szName;
|
||||
int m_iDecoCode;
|
||||
int m_iPeso;
|
||||
int m_iCash;
|
||||
int m_iBonusPeso;
|
||||
int m_iSellPeso;
|
||||
bool m_bActive;
|
||||
int m_iLimitLevel;
|
||||
|
||||
int m_iSubscriptionType;
|
||||
|
||||
tagDecoData()
|
||||
{
|
||||
m_iDecoCode = 999999999;
|
||||
m_iPeso = 0;
|
||||
m_iCash = 0;
|
||||
m_iBonusPeso = 0;
|
||||
m_iSellPeso = 0;
|
||||
m_bActive = false;
|
||||
m_iLimitLevel = 0;
|
||||
}
|
||||
}DecoData;
|
||||
typedef std::vector< DecoData > vDecoData; // vector을 다른것으로 대체할때 INI Reload 개선 필요
|
||||
typedef struct tagDecoList
|
||||
{
|
||||
CString m_strTitle;
|
||||
int m_iDecoType;
|
||||
int m_iPackageKeepPeso;
|
||||
vDecoData m_vList;
|
||||
tagDecoList()
|
||||
{
|
||||
m_strTitle = "";
|
||||
m_iDecoType = m_iPackageKeepPeso = 0;
|
||||
}
|
||||
|
||||
}DecoList;
|
||||
typedef std::vector< DecoList > vDecoList; // vector을 다른것으로 대체할때 INI Reload 개선 필요
|
||||
|
||||
typedef std::vector<int> IntVec;
|
||||
typedef struct tagDefaultList
|
||||
{
|
||||
int m_iDecoType;
|
||||
IntVec m_vDecoCodeList;
|
||||
tagDefaultList()
|
||||
{
|
||||
m_iDecoType = 0;
|
||||
}
|
||||
}DefaultList;
|
||||
|
||||
typedef std::vector< DefaultList > vDefaultList; // vector을 다른것으로 대체할때 INI Reload 개선 필요
|
||||
|
||||
|
||||
struct SexDecoList
|
||||
{
|
||||
CString m_szName;
|
||||
CString m_szINI;
|
||||
int m_iSex;
|
||||
|
||||
vDecoList m_vList;
|
||||
vDefaultList m_vDefaultList;
|
||||
SexDecoList()
|
||||
{
|
||||
m_iSex = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
enum ItemType
|
||||
{
|
||||
IT_NONE = -1,
|
||||
IT_CLASS = 0,
|
||||
IT_DECO = 1,
|
||||
IT_ETC = 2,
|
||||
IT_EXTRA_BOX = 3,
|
||||
};
|
||||
|
||||
struct BackUpInfo // 향후 항목 추가를 대비해서 struct로
|
||||
{
|
||||
int m_iCash;
|
||||
int m_iPeso;
|
||||
bool m_bItemActive;
|
||||
|
||||
BackUpInfo()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_iCash = 0;
|
||||
m_iPeso = 0;
|
||||
m_bItemActive = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 용병관련 ///
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
struct HeroClassRate
|
||||
{
|
||||
int m_iStart;
|
||||
int m_iEnd;
|
||||
int m_iRate;
|
||||
|
||||
HeroClassRate()
|
||||
{
|
||||
m_iStart = 0;
|
||||
m_iEnd = 0;
|
||||
m_iRate = 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::vector< HeroClassRate* > vHeroClassRate;
|
||||
|
||||
enum PriceType
|
||||
{
|
||||
PT_NORMAL = 0,
|
||||
PT_PREMIUM = 1,
|
||||
PT_RARE = 2,
|
||||
};
|
||||
struct PriceData
|
||||
{
|
||||
int m_iSetCode;
|
||||
int m_bActive;
|
||||
int m_iBuyCash;
|
||||
PriceType m_eType;
|
||||
|
||||
PriceData()
|
||||
{
|
||||
m_iSetCode = 0;
|
||||
m_bActive = 0;
|
||||
m_iBuyCash = 0;
|
||||
m_eType = PT_NORMAL;
|
||||
}
|
||||
};
|
||||
|
||||
// 기간제 & 영구
|
||||
enum CharPeriodType
|
||||
{
|
||||
CPT_TIME = 0,
|
||||
CPT_MORTMAIN = 1, // 영구
|
||||
CPT_MAX = 2,
|
||||
};
|
||||
|
||||
struct LimitData
|
||||
{
|
||||
int m_iLimitDate;
|
||||
float m_fLimitPricePer;
|
||||
|
||||
LimitData()
|
||||
{
|
||||
m_iLimitDate = 0;
|
||||
m_fLimitPricePer = 1.0f;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 추가관련 ///
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
struct RandomItem
|
||||
{
|
||||
int m_iItemCode;
|
||||
int m_iRandomRate;
|
||||
|
||||
RandomItem()
|
||||
{
|
||||
m_iItemCode = 0;
|
||||
m_iRandomRate = 0;
|
||||
}
|
||||
};
|
||||
typedef std::vector< RandomItem > RandomItemList;
|
||||
|
||||
|
||||
struct ExtraItem
|
||||
{
|
||||
int m_iMachine_code;
|
||||
int m_iType;
|
||||
int m_iActive;
|
||||
int m_iBuyCash;
|
||||
int m_iPackage;
|
||||
CString m_strMachineName;
|
||||
RandomItemList m_vRandomItemList;
|
||||
|
||||
ExtraItem()
|
||||
{
|
||||
m_iMachine_code = 0;
|
||||
m_iType = 0;
|
||||
m_iActive = 0;
|
||||
m_iBuyCash = 0;
|
||||
m_strMachineName.Empty();
|
||||
m_vRandomItemList.clear();
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::map<int, ExtraItem*> mExtraItem;
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 특별상점관련 ///
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
struct sPopupItemInfo
|
||||
{
|
||||
int m_iActive;
|
||||
|
||||
int m_iIndex;
|
||||
int m_iPresentType;
|
||||
int m_iPresentValue1;
|
||||
int m_iPresentValue2;
|
||||
int m_iCash;
|
||||
int m_iPrevCash;
|
||||
int m_iDisCount;
|
||||
};
|
||||
|
||||
typedef std::vector< sPopupItemInfo* > vPopupItemInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
/// 특별상점관련 ///
|
||||
////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
struct SaleInfo
|
||||
{
|
||||
ItemType m_eItemType;
|
||||
int m_iType1;
|
||||
int m_iType2;
|
||||
int m_iStartDate;
|
||||
int m_iEndDate;
|
||||
int m_iCash;
|
||||
bool m_bActive;
|
||||
|
||||
SaleInfo()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_eItemType = IT_NONE;
|
||||
m_iType1 = 0;
|
||||
m_iType2 = 0;
|
||||
m_iStartDate = 0;
|
||||
m_iEndDate = 0;
|
||||
m_iCash = 0;
|
||||
m_bActive = false;
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::vector< SaleInfo* > vSaleInfoVector;
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
|
||||
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다.
|
||||
// BillingInfoList.pch는 미리 컴파일된 헤더가 됩니다.
|
||||
// stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
|
||||
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
|
||||
// 들어 있는 포함 파일입니다.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef _SECURE_ATL
|
||||
#define _SECURE_ATL 1
|
||||
#endif
|
||||
|
||||
#ifndef VC_EXTRALEAN
|
||||
#define VC_EXTRALEAN // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
|
||||
#endif
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 일부 CString 생성자는 명시적으로 선언됩니다.
|
||||
|
||||
// MFC의 공통 부분과 무시 가능한 경고 메시지에 대한 숨기기를 해제합니다.
|
||||
#define _AFX_ALL_WARNINGS
|
||||
|
||||
#include <afxwin.h> // MFC 핵심 및 표준 구성 요소입니다.
|
||||
#include <afxext.h> // MFC 확장입니다.
|
||||
|
||||
|
||||
#include <afxdisp.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
|
||||
|
||||
#include <afxcontrolbars.h> // MFC의 리본 및 컨트롤 막대 지원
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#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_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
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "cFile.h"
|
||||
#include "define.h"
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// 포함 SDKDDKVer.h는 사용 가능한 Windows 플랫폼 중 버전이 가장 높은 플랫폼을 정의합니다.
|
||||
|
||||
// 이전 Windows 플랫폼에 대해 응용 프로그램을 빌드하려는 경우에는 SDKDDKVer.h를 포함하기 전에
|
||||
// WinSDKVer.h를 포함하고 _WIN32_WINNT 매크로를 지원하려는 플랫폼으로 설정하십시오.
|
||||
|
||||
#include <SDKDDKVer.h>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CTPKTDefineToStringParser", "CTPKTDefineToStringParser\CTPKTDefineToStringParser.csproj", "{4F3072CE-C320-4CB0-8B6C-BDAAB1BE35FB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4F3072CE-C320-4CB0-8B6C-BDAAB1BE35FB}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{4F3072CE-C320-4CB0-8B6C-BDAAB1BE35FB}.Debug|x86.Build.0 = Debug|x86
|
||||
{4F3072CE-C320-4CB0-8B6C-BDAAB1BE35FB}.Release|x86.ActiveCfg = Release|x86
|
||||
{4F3072CE-C320-4CB0-8B6C-BDAAB1BE35FB}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4F3072CE-C320-4CB0-8B6C-BDAAB1BE35FB}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CTPKTDefineToStringParser</RootNamespace>
|
||||
<AssemblyName>CTPKTDefineToStringParser</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Globalization;
|
||||
|
||||
namespace CTPKTDefineToStringParser
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
List<string> writeLine = new List<string>();
|
||||
|
||||
writeLine.Add("#ifndef ___PROTOCOL_HELPER_H__");
|
||||
writeLine.Add("#define ___PROTOCOL_HELPER_H__");
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("#include \"Protocol.h\"");
|
||||
writeLine.Add("\r\n");
|
||||
|
||||
MakeClientToServerPacketForProtocolHelper(writeLine, args);
|
||||
MakeServerToServerPacketForProtocolHelper(writeLine, args);
|
||||
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("#endif");
|
||||
|
||||
System.IO.File.WriteAllLines(args[1], writeLine.ToArray());
|
||||
}
|
||||
|
||||
public static void MakeClientToServerPacketForProtocolHelper(List<string> writeLine, string[] args)
|
||||
{
|
||||
writeLine.Add("#define GetStringOfCTPCKPacket(packetID, p) \\");
|
||||
writeLine.Add(" switch( packetID ) \\");
|
||||
writeLine.Add(" { \\");
|
||||
|
||||
int counter = 0;
|
||||
string line;
|
||||
|
||||
System.IO.StreamReader readFile = new System.IO.StreamReader(args[0]);
|
||||
|
||||
while ((line = readFile.ReadLine()) != null)
|
||||
{
|
||||
if (!line.Contains("#define CTPK") && !line.Contains("#define CUPK"))
|
||||
continue;
|
||||
|
||||
if (line.Contains("//"))
|
||||
continue;
|
||||
|
||||
if (!line.Contains("0x"))
|
||||
continue;
|
||||
|
||||
string[] strings = line.Split(new string[] { " ", "0x" }, StringSplitOptions.None);
|
||||
|
||||
string packetString = RemoveSpecialCharacters(strings[1]);
|
||||
|
||||
{
|
||||
writeLine.Add(" case " + packetString + ": \\");
|
||||
writeLine.Add(" (p) = " + "\"" + packetString + "\"; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
}
|
||||
|
||||
Console.WriteLine(line);
|
||||
counter++;
|
||||
}
|
||||
|
||||
{
|
||||
writeLine.Add(" default: \\");
|
||||
writeLine.Add(" char buf[100]; \\");
|
||||
writeLine.Add(" sprintf(buf, \"0x%x\", packetID); \\");
|
||||
writeLine.Add(" (p) = buf; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
writeLine.Add(" } \\");
|
||||
}
|
||||
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("\r\n");
|
||||
|
||||
readFile.Close();
|
||||
}
|
||||
|
||||
public static void MakeServerToServerPacketForProtocolHelper(List<string> writeLine, string[] args)
|
||||
{
|
||||
writeLine.Add("#define GetStringOfSSTPKPacket(packetID, p) \\");
|
||||
writeLine.Add(" switch( packetID ) \\");
|
||||
writeLine.Add(" { \\");
|
||||
|
||||
|
||||
int counter = 0;
|
||||
string line;
|
||||
|
||||
System.IO.StreamReader readFile = new System.IO.StreamReader(args[0]);
|
||||
while ((line = readFile.ReadLine()) != null)
|
||||
{
|
||||
if (!line.Contains("#define SSTPK"))
|
||||
continue;
|
||||
|
||||
if (line.Contains("//"))
|
||||
continue;
|
||||
|
||||
if (!line.Contains("0x"))
|
||||
continue;
|
||||
|
||||
string[] strings = line.Split(new string[] { " ", "0x" }, StringSplitOptions.None);
|
||||
|
||||
string packetString = RemoveSpecialCharacters(strings[1]);
|
||||
|
||||
{
|
||||
writeLine.Add(" case " + packetString + ": \\");
|
||||
writeLine.Add(" (p) = " + "\"" + packetString + "\"; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
}
|
||||
|
||||
Console.WriteLine(line);
|
||||
counter++;
|
||||
}
|
||||
|
||||
{
|
||||
writeLine.Add(" default: \\");
|
||||
writeLine.Add(" char buf[100]; \\");
|
||||
writeLine.Add(" sprintf(buf, \"0x%x\", packetID); \\");
|
||||
writeLine.Add(" (p) = buf; \\");
|
||||
writeLine.Add(" break; \\");
|
||||
writeLine.Add(" } \\");
|
||||
}
|
||||
|
||||
writeLine.Add("\r\n");
|
||||
writeLine.Add("\r\n");
|
||||
|
||||
readFile.Close();
|
||||
}
|
||||
|
||||
public static string RemoveSpecialCharacters(string str)
|
||||
{
|
||||
return Regex.Replace(str, "[^a-zA-Z0-9_.]+", "", RegexOptions.Compiled);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
|
||||
// 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이 특성 값을 변경하십시오.
|
||||
[assembly: AssemblyTitle("CTPKTDefineToStringParser")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CTPKTDefineToStringParser")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("95af633d-fa6f-4b30-b266-62a8ea92860f")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
|
||||
// 지정되도록 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INIChecker", "INIChecker\INIChecker.vcxproj", "{281CAE6C-AD69-45E9-9EA8-B71AD2D519A9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{281CAE6C-AD69-45E9-9EA8-B71AD2D519A9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{281CAE6C-AD69-45E9-9EA8-B71AD2D519A9}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{281CAE6C-AD69-45E9-9EA8-B71AD2D519A9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{281CAE6C-AD69-45E9-9EA8-B71AD2D519A9}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
// INIChecker.cpp : 응용 프로그램에 대한 클래스 동작을 정의합니다.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "INIChecker.h"
|
||||
#include "INICheckerDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
|
||||
// CINICheckerApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CINICheckerApp, CWinApp)
|
||||
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CINICheckerApp 생성
|
||||
|
||||
CINICheckerApp::CINICheckerApp()
|
||||
{
|
||||
// 다시 시작 관리자 지원
|
||||
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
|
||||
|
||||
// TODO: 여기에 생성 코드를 추가합니다.
|
||||
// InitInstance에 모든 중요한 초기화 작업을 배치합니다.
|
||||
}
|
||||
|
||||
|
||||
// 유일한 CINICheckerApp 개체입니다.
|
||||
|
||||
CINICheckerApp theApp;
|
||||
|
||||
|
||||
// CINICheckerApp 초기화
|
||||
|
||||
BOOL CINICheckerApp::InitInstance()
|
||||
{
|
||||
// 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을
|
||||
// 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControlsEx()가 필요합니다.
|
||||
// InitCommonControlsEx()를 사용하지 않으면 창을 만들 수 없습니다.
|
||||
INITCOMMONCONTROLSEX InitCtrls;
|
||||
InitCtrls.dwSize = sizeof(InitCtrls);
|
||||
// 응용 프로그램에서 사용할 모든 공용 컨트롤 클래스를 포함하도록
|
||||
// 이 항목을 설정하십시오.
|
||||
InitCtrls.dwICC = ICC_WIN95_CLASSES;
|
||||
InitCommonControlsEx(&InitCtrls);
|
||||
|
||||
CWinApp::InitInstance();
|
||||
|
||||
|
||||
// 대화 상자에 셸 트리 뷰 또는
|
||||
// 셸 목록 뷰 컨트롤이 포함되어 있는 경우 셸 관리자를 만듭니다.
|
||||
CShellManager *pShellManager = new CShellManager;
|
||||
|
||||
// 표준 초기화
|
||||
// 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면
|
||||
// 아래에서 필요 없는 특정 초기화
|
||||
// 루틴을 제거해야 합니다.
|
||||
// 해당 설정이 저장된 레지스트리 키를 변경하십시오.
|
||||
// TODO: 이 문자열을 회사 또는 조직의 이름과 같은
|
||||
// 적절한 내용으로 수정해야 합니다.
|
||||
SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램"));
|
||||
|
||||
CINICheckerDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
INT_PTR nResponse = dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
// TODO: 여기에 [확인]을 클릭하여 대화 상자가 없어질 때 처리할
|
||||
// 코드를 배치합니다.
|
||||
}
|
||||
else if (nResponse == IDCANCEL)
|
||||
{
|
||||
// TODO: 여기에 [취소]를 클릭하여 대화 상자가 없어질 때 처리할
|
||||
// 코드를 배치합니다.
|
||||
}
|
||||
|
||||
// 위에서 만든 셸 관리자를 삭제합니다.
|
||||
if (pShellManager != NULL)
|
||||
{
|
||||
delete pShellManager;
|
||||
}
|
||||
|
||||
// 대화 상자가 닫혔으므로 응용 프로그램의 메시지 펌프를 시작하지 않고 응용 프로그램을 끝낼 수 있도록 FALSE를
|
||||
// 반환합니다.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
// INIChecker.h : PROJECT_NAME 응용 프로그램에 대한 주 헤더 파일입니다.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error "PCH에 대해 이 파일을 포함하기 전에 'stdafx.h'를 포함합니다."
|
||||
#endif
|
||||
|
||||
#include "resource.h" // 주 기호입니다.
|
||||
|
||||
|
||||
// CINICheckerApp:
|
||||
// 이 클래스의 구현에 대해서는 INIChecker.cpp을 참조하십시오.
|
||||
//
|
||||
|
||||
class CINICheckerApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CINICheckerApp();
|
||||
|
||||
// 재정의입니다.
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
|
||||
// 구현입니다.
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
extern CINICheckerApp theApp;
|
||||
Binary file not shown.
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{281CAE6C-AD69-45E9-9EA8-B71AD2D519A9}</ProjectGuid>
|
||||
<RootNamespace>INIChecker</RootNamespace>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<UseOfMfc>Static</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<UseOfMfc>Static</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>C:\Boost\include\boost-1_47;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\Boost\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>C:\Boost\include\boost-1_47;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>C:\Boost\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>MFC;WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0412</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>MFC;WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0412</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\INIChecker.ico" />
|
||||
<None Include="res\INIChecker.rc2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="INIChecker.h" />
|
||||
<ClInclude Include="INICheckerDlg.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="INIChecker.cpp" />
|
||||
<ClCompile Include="INICheckerDlg.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="INIChecker.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties RESOURCE_FILE="INIChecker.rc" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="소스 파일">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="헤더 파일">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="리소스 파일">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\INIChecker.rc2">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</None>
|
||||
<None Include="res\INIChecker.ico">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="INIChecker.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INICheckerDlg.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="INIChecker.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INICheckerDlg.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="INIChecker.rc">
|
||||
<Filter>리소스 파일</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,189 @@
|
||||
|
||||
// INICheckerDlg.cpp : 구현 파일
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "INIChecker.h"
|
||||
#include "INICheckerDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
// boost
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/ini_parser.hpp>
|
||||
|
||||
// common
|
||||
#include "../../../src/include/common.h"
|
||||
#include "../../../src/ioINILoader/ioINILoader.h"
|
||||
|
||||
// lib
|
||||
#ifdef _DEBUG
|
||||
#pragma comment( lib, "../../../../programming/lib/INID.lib" )
|
||||
#else
|
||||
#pragma comment( lib, "../../../../programming/lib/INI.lib" )
|
||||
#endif
|
||||
|
||||
// 응용 프로그램 정보에 사용되는 CAboutDlg 대화 상자입니다.
|
||||
|
||||
class CAboutDlg : public CDialogEx
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// 대화 상자 데이터입니다.
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
|
||||
|
||||
// 구현입니다.
|
||||
protected:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD)
|
||||
{
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogEx::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CINICheckerDlg 대화 상자
|
||||
|
||||
|
||||
|
||||
|
||||
CINICheckerDlg::CINICheckerDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialogEx(CINICheckerDlg::IDD, pParent)
|
||||
{
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
}
|
||||
|
||||
void CINICheckerDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogEx::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CINICheckerDlg, CDialogEx)
|
||||
ON_WM_SYSCOMMAND()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_QUERYDRAGICON()
|
||||
ON_WM_DROPFILES()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CINICheckerDlg 메시지 처리기
|
||||
|
||||
BOOL CINICheckerDlg::OnInitDialog()
|
||||
{
|
||||
CDialogEx::OnInitDialog();
|
||||
|
||||
// 시스템 메뉴에 "정보..." 메뉴 항목을 추가합니다.
|
||||
|
||||
// IDM_ABOUTBOX는 시스템 명령 범위에 있어야 합니다.
|
||||
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||||
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||||
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
BOOL bNameValid;
|
||||
CString strAboutMenu;
|
||||
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||||
ASSERT(bNameValid);
|
||||
if (!strAboutMenu.IsEmpty())
|
||||
{
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// 이 대화 상자의 아이콘을 설정합니다. 응용 프로그램의 주 창이 대화 상자가 아닐 경우에는
|
||||
// 프레임워크가 이 작업을 자동으로 수행합니다.
|
||||
SetIcon(m_hIcon, TRUE); // 큰 아이콘을 설정합니다.
|
||||
SetIcon(m_hIcon, FALSE); // 작은 아이콘을 설정합니다.
|
||||
|
||||
// TODO: 여기에 추가 초기화 작업을 추가합니다.
|
||||
|
||||
return TRUE; // 포커스를 컨트롤에 설정하지 않으면 TRUE를 반환합니다.
|
||||
}
|
||||
|
||||
void CINICheckerDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||||
{
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialogEx::OnSysCommand(nID, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
// 대화 상자에 최소화 단추를 추가할 경우 아이콘을 그리려면
|
||||
// 아래 코드가 필요합니다. 문서/뷰 모델을 사용하는 MFC 응용 프로그램의 경우에는
|
||||
// 프레임워크에서 이 작업을 자동으로 수행합니다.
|
||||
|
||||
void CINICheckerDlg::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
|
||||
{
|
||||
CDialogEx::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
// 사용자가 최소화된 창을 끄는 동안에 커서가 표시되도록 시스템에서
|
||||
// 이 함수를 호출합니다.
|
||||
HCURSOR CINICheckerDlg::OnQueryDragIcon()
|
||||
{
|
||||
return static_cast<HCURSOR>(m_hIcon);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CINICheckerDlg::OnDropFiles(HDROP hDropInfo)
|
||||
{
|
||||
// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.
|
||||
TCHAR pathName[ 512 ];
|
||||
int files = DragQueryFile( hDropInfo, 0xFFFFFFFF, pathName, _countof( pathName ) );
|
||||
if( files > 0 )
|
||||
{
|
||||
DragQueryFile( hDropInfo, 0, pathName, _countof( pathName ) );
|
||||
}
|
||||
|
||||
ioINILoader kLoader;
|
||||
if( kLoader.LoadFile( pathName ) == TRUE )
|
||||
{
|
||||
AfxMessageBox( _T("Complete"), MB_OK );
|
||||
}
|
||||
kLoader.RemoveFile( pathName );
|
||||
|
||||
CDialogEx::OnDropFiles(hDropInfo);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
// INICheckerDlg.h : 헤더 파일
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
// CINICheckerDlg 대화 상자
|
||||
class CINICheckerDlg : public CDialogEx
|
||||
{
|
||||
// 생성입니다.
|
||||
public:
|
||||
CINICheckerDlg(CWnd* pParent = NULL); // 표준 생성자입니다.
|
||||
|
||||
// 대화 상자 데이터입니다.
|
||||
enum { IDD = IDD_INICHECKER_DIALOG };
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 지원입니다.
|
||||
|
||||
|
||||
// 구현입니다.
|
||||
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:
|
||||
afx_msg void OnDropFiles(HDROP hDropInfo);
|
||||
};
|
||||
@@ -0,0 +1,93 @@
|
||||
================================================================================
|
||||
MFC 라이브러리 : INIChecker 프로젝트 개요
|
||||
================================================================================
|
||||
|
||||
응용 프로그램 마법사에서 이 INIChecker 응용 프로그램을
|
||||
만들었습니다. 이 응용 프로그램은 MFC의 기본 사용법을 보여 줄 뿐만 아니라 응용
|
||||
프로그램작성을 위한 기본 구조를 제공합니다.
|
||||
|
||||
이 파일에는 INIChecker 응용 프로그램을 구성하는 각 파일에 대한
|
||||
요약 설명이 포함되어 있습니다.
|
||||
|
||||
INIChecker.vcxproj
|
||||
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 주 프로젝트 파일입니다.
|
||||
파일을 생성한 Visual C++ 버전에 대한 정보와 응용 프로그램 마법사를 사용하여 선택한
|
||||
플랫폼, 구성 및 프로젝트 기능에 대한 정보가 들어 있습니다.
|
||||
|
||||
INIChecker.vcxproj.filters
|
||||
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 필터 파일입니다.
|
||||
이 파일에는 프로젝트의 파일과 필터 간의 연결 정보가 들어 있습니다. 이러한
|
||||
연결은 특정 노드에서 유사한 확장명으로 그룹화된 파일을 표시하기 위해
|
||||
IDE에서 사용됩니다. 예를 들어 ".cpp" 파일은 "소스 파일" 필터와 연결되어
|
||||
있습니다.
|
||||
|
||||
|
||||
INIChecker.h
|
||||
응용 프로그램의 기본 헤더 파일입니다. 여기에는 다른 프로젝트 관련
|
||||
헤더(Resource.h 포함)가 들어 있고 CINICheckerApp 응용 프로그램
|
||||
클래스를 선언합니다.
|
||||
|
||||
INIChecker.cpp
|
||||
응용 프로그램 클래스 CINICheckerApp이(가) 들어 있는 기본 응용 프로그램
|
||||
소스 파일입니다.
|
||||
|
||||
INIChecker.rc
|
||||
프로그램에서 사용하는 모든 Microsoft Windows 리소스의 목록입니다.
|
||||
여기에는 RES 하위 디렉터리에 저장된 아이콘, 비트맵 및 커서가
|
||||
포함됩니다. 이 파일은 Microsoft Visual C++에서 직접
|
||||
편집할 수 있습니다. 프로젝트 리소스는 1042에 있습니다.
|
||||
|
||||
res\INIChecker.ico
|
||||
응용 프로그램의 아이콘으로 사용되는 아이콘 파일입니다. 이 아이콘은
|
||||
주 리소스 파일인 INIChecker.rc에 의해 포함됩니다.
|
||||
|
||||
res\INIChecker.rc2
|
||||
이 파일에는 Microsoft Visual C++ 이외의 다른 도구에서 편집한 리소스가
|
||||
들어 있습니다. 리소스 편집기로 편집할 수 없는 모든 리소스는
|
||||
이 파일에 넣어야 합니다.
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
응용 프로그램 마법사에서 하나의 대화 상자 클래스가 만들어집니다.
|
||||
|
||||
INICheckerDlg.h, INICheckerDlg.cpp - 대화 상자
|
||||
이 파일에는 CINICheckerDlg 클래스가 들어 있습니다. 이 클래스는
|
||||
응용 프로그램의 주 대화 상자 동작을 정의합니다. 대화 상자의 템플릿은
|
||||
Microsoft Visual C++에서 편집할 수 있는 INIChecker.rc에 있습니다.
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
기타 표준 파일:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
이 파일은 미리 컴파일된 헤더 파일(PCH)인 INIChecker.pch와
|
||||
미리 컴파일된 형식 파일인 StdAfx.obj를 빌드하는 데 사용됩니다.
|
||||
|
||||
Resource.h
|
||||
새 리소스 ID를 정의하는 표준 헤더 파일입니다.
|
||||
Microsoft Visual C++에서 이 파일을 읽고 업데이트합니다.
|
||||
|
||||
INIChecker.manifest
|
||||
응용 프로그램 매니페스트 파일은 Windows XP에서 특정 버전의 Side-by-Side
|
||||
어셈블리에 대한 응용 프로그램 종속성을 설명하는 데 사용됩니다. 로더는 이 정보를
|
||||
사용하여 어셈블리 캐시에서 적절한 어셈블리를 로드하거나 응용 프로그램에서 전용
|
||||
어셈블리를 로드합니다. 응용 프로그램 매니페스트는 응용 프로그램 실행 파일과 같은
|
||||
폴더에 설치된 외부 .manifest 파일로 재배포를 위해 포함되거나 리소스의 형태로
|
||||
실행 파일에 포함될 수 있습니다.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
기타 참고:
|
||||
|
||||
응용 프로그램 마법사는 "TODO:"를 사용하여 추가하거나 사용자 지정해야 하는
|
||||
소스 코드 부분을 나타냅니다.
|
||||
|
||||
응용 프로그램이 공유 DLL에서 MFC를 사용하는 경우 해당 MFC DLL을
|
||||
재배포해야 합니다. 그리고 응용 프로그램이 운영 체제의 로캘과
|
||||
다른 언어를 사용하는 경우 해당 지역화된 리소스인 MFC100XXX.DLL을
|
||||
재배포해야 합니다. 이 두가지 항목에 대한 자세한 내용은
|
||||
MSDN 설명서의 Visual C++ 응용 프로그램 재배포 항목을
|
||||
참조하십시오.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
|
||||
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다.
|
||||
// INIChecker.pch는 미리 컴파일된 헤더가 됩니다.
|
||||
// stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
|
||||
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
|
||||
// 들어 있는 포함 파일입니다.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef _SECURE_ATL
|
||||
#define _SECURE_ATL 1
|
||||
#endif
|
||||
|
||||
#ifndef VC_EXTRALEAN
|
||||
#define VC_EXTRALEAN // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
|
||||
#endif
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#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
|
||||
|
||||
#include <afxcontrolbars.h> // MFC의 리본 및 컨트롤 막대 지원
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#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_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
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// 포함 SDKDDKVer.h는 사용 가능한 Windows 플랫폼 중 버전이 가장 높은 플랫폼을 정의합니다.
|
||||
|
||||
// 이전 Windows 플랫폼에 대해 응용 프로그램을 빌드하려는 경우에는 SDKDDKVer.h를 포함하기 전에
|
||||
// WinSDKVer.h를 포함하고 _WIN32_WINNT 매크로를 지원하려는 플랫폼으로 설정하십시오.
|
||||
|
||||
#include <SDKDDKVer.h>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtest", "libtest\libtest.vcxproj", "{201A7015-1664-4C02-BC30-8B99D2403B42}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{201A7015-1664-4C02-BC30-8B99D2403B42}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{201A7015-1664-4C02-BC30-8B99D2403B42}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{201A7015-1664-4C02-BC30-8B99D2403B42}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{201A7015-1664-4C02-BC30-8B99D2403B42}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,214 @@
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "ioDataChunk.h"
|
||||
|
||||
ioDataChunk::ioDataChunk()
|
||||
{
|
||||
m_pData = NULL;
|
||||
m_pPos = NULL;
|
||||
m_pEnd = NULL;
|
||||
m_iSize = 0;
|
||||
}
|
||||
|
||||
ioDataChunk::~ioDataChunk()
|
||||
{
|
||||
SAFEDELETEARRAY(m_pData);
|
||||
}
|
||||
|
||||
BYTE* ioDataChunk::Allocate( int iSize, const BYTE *pPtr )
|
||||
{
|
||||
assert( iSize > 0 );
|
||||
|
||||
SAFEDELETEARRAY( m_pData );
|
||||
m_pPos = NULL;
|
||||
m_pEnd = NULL;
|
||||
m_iSize = 0;
|
||||
|
||||
m_pData = new BYTE[ iSize + 1 ]; // +1 is for null
|
||||
if( m_pData )
|
||||
{
|
||||
m_pData[iSize] = '\0';
|
||||
|
||||
m_pPos = m_pData;
|
||||
m_pEnd = m_pData + iSize;
|
||||
m_iSize = iSize;
|
||||
|
||||
if( pPtr )
|
||||
{
|
||||
memcpy( m_pData, pPtr, iSize );
|
||||
}
|
||||
}
|
||||
|
||||
return m_pData;
|
||||
}
|
||||
|
||||
bool ioDataChunk::AllocateFromFile( const char *szName )
|
||||
{
|
||||
Clear();
|
||||
|
||||
HANDLE hFile = CreateFile( szName,
|
||||
GENERIC_READ,
|
||||
0,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
|
||||
NULL );
|
||||
|
||||
if( INVALID_HANDLE_VALUE == hFile )
|
||||
return false;
|
||||
|
||||
DWORD dwFileSize = GetFileSize(hFile, NULL);
|
||||
if( INVALID_FILE_SIZE == dwFileSize )
|
||||
{
|
||||
CloseHandle( hFile );
|
||||
return false;
|
||||
}
|
||||
|
||||
m_pData = new BYTE[ dwFileSize + 1 ]; // +1 is for null
|
||||
m_pData[dwFileSize] = '\0';
|
||||
|
||||
DWORD dwReadedSize = 0;
|
||||
BOOL bRet = ReadFile( hFile,
|
||||
m_pData,
|
||||
dwFileSize,
|
||||
&dwReadedSize,
|
||||
NULL );
|
||||
|
||||
if( FALSE == bRet )
|
||||
{
|
||||
SAFEDELETEARRAY(m_pData);
|
||||
CloseHandle( hFile );
|
||||
return false;
|
||||
}
|
||||
|
||||
m_iSize = dwFileSize;
|
||||
m_pPos = m_pData;
|
||||
m_pEnd = m_pData + dwFileSize;
|
||||
|
||||
CloseHandle( hFile );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ioDataChunk::Clear()
|
||||
{
|
||||
SAFEDELETEARRAY( m_pData );
|
||||
m_iSize = 0;
|
||||
}
|
||||
|
||||
int ioDataChunk::Read( void *pBuf, int iSize )
|
||||
{
|
||||
int iCnt = iSize;
|
||||
if( m_pPos + iSize > m_pEnd )
|
||||
iCnt = m_pEnd - m_pPos;
|
||||
|
||||
if( iCnt > 0 )
|
||||
{
|
||||
memcpy( pBuf, (const void*)m_pPos, iCnt );
|
||||
m_pPos += iCnt;
|
||||
}
|
||||
|
||||
return iCnt;
|
||||
}
|
||||
|
||||
void ioDataChunk::Seek( int iPos )
|
||||
{
|
||||
if( iPos <= m_iSize )
|
||||
{
|
||||
m_pPos = m_pData + iPos;
|
||||
}
|
||||
}
|
||||
|
||||
bool ioDataChunk::IsEOF() const
|
||||
{
|
||||
if( m_pPos >= m_pEnd )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int ioDataChunk::ReadUpTo( void *pBuf, int iSize, const char* pDelim )
|
||||
{
|
||||
int iPos = strcspn( (const char*)m_pPos, pDelim );
|
||||
if( iPos > iSize )
|
||||
iPos = iSize;
|
||||
|
||||
if( m_pPos + iPos > m_pEnd )
|
||||
iPos = m_pEnd - m_pPos;
|
||||
|
||||
if( iPos > 0 )
|
||||
{
|
||||
memcpy( pBuf, (const void*)m_pPos, iPos );
|
||||
}
|
||||
|
||||
m_pPos += iPos + 1;
|
||||
|
||||
return iPos;
|
||||
}
|
||||
|
||||
int ioDataChunk::SkipUpTo( const char *pDelim )
|
||||
{
|
||||
int iPos = strcspn( (const char*)m_pPos, pDelim );
|
||||
|
||||
if( m_pPos + iPos > m_pEnd )
|
||||
iPos = m_pEnd - m_pPos;
|
||||
|
||||
m_pPos += iPos + 1;
|
||||
|
||||
return iPos;
|
||||
}
|
||||
|
||||
void ioDataChunk::GetLine( std::string &line, bool bTrim )
|
||||
{
|
||||
char pBuf[512];
|
||||
|
||||
int iCount = ReadUpTo( pBuf, 511 );
|
||||
pBuf[iCount] = '\0';
|
||||
|
||||
line = pBuf;
|
||||
|
||||
if( bTrim )
|
||||
{
|
||||
int iLen = line.length();
|
||||
|
||||
int lSpace, rSpace;
|
||||
lSpace = rSpace = 0;
|
||||
|
||||
int i=0;
|
||||
for(int i=0 ;
|
||||
i<iLen && ( line.at(i) == ' ' || line.at(i) == '\t' || line.at(i) == '\r' ) ;
|
||||
++lSpace, i++ );
|
||||
|
||||
if( lSpace < iLen )
|
||||
{
|
||||
for(int i= iLen-1 ;
|
||||
i>=0 && ( line.at(i) == ' ' || line.at(i) == '\t' || line.at(i) == '\r' ) ;
|
||||
rSpace++, i-- );
|
||||
}
|
||||
|
||||
line = line.substr( lSpace, iLen - lSpace - rSpace );
|
||||
}
|
||||
}
|
||||
|
||||
void ioDataChunk::SkipToNextOpenBrace()
|
||||
{
|
||||
std::string line = "";
|
||||
|
||||
while( !IsEOF() && line !="{" )
|
||||
{
|
||||
GetLine( line );
|
||||
}
|
||||
}
|
||||
|
||||
void ioDataChunk::SkipToNextCloseBrace()
|
||||
{
|
||||
std::string line = "";
|
||||
|
||||
while( !IsEOF() && line.substr(0,1) != "}" )
|
||||
{
|
||||
GetLine( line );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
|
||||
#ifndef _ioDataChunk_h_
|
||||
#define _ioDataChunk_h_
|
||||
|
||||
class ioDataChunk
|
||||
{
|
||||
private:
|
||||
BYTE *m_pData;
|
||||
BYTE *m_pPos;
|
||||
BYTE *m_pEnd;
|
||||
|
||||
int m_iSize;
|
||||
|
||||
public:
|
||||
BYTE* Allocate( int iSize, const BYTE *pPtr = NULL );
|
||||
bool AllocateFromFile( const char *szName );
|
||||
int Read( void *pBuf, int iSize );
|
||||
void Seek( int iPos );
|
||||
void Clear();
|
||||
|
||||
public:
|
||||
int ReadUpTo( void *pBuf, int iSize, const char* pDelim = "\n" );
|
||||
int SkipUpTo( const char* pDelim = "\n" );
|
||||
|
||||
void SkipToNextOpenBrace();
|
||||
void SkipToNextCloseBrace();
|
||||
|
||||
public:
|
||||
void GetLine( std::string &line, bool bTrim = true );
|
||||
bool IsEOF() const;
|
||||
|
||||
public:
|
||||
inline const BYTE* GetPtr() const { return m_pData; }
|
||||
inline BYTE* GetPtr() { return m_pData; }
|
||||
|
||||
inline int GetSize() const { return m_iSize; }
|
||||
|
||||
public:
|
||||
ioDataChunk();
|
||||
~ioDataChunk();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,298 @@
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "ioINIParser.h"
|
||||
#include "ioINILoader.h"
|
||||
#include <strsafe.h>
|
||||
|
||||
ioINILoader::ioINILoader()
|
||||
{
|
||||
ZeroMemory( m_szFileName, MAX_PATH );
|
||||
ZeroMemory( m_szTitle, MAX_PATH );
|
||||
m_pParser = NULL;
|
||||
}
|
||||
|
||||
ioINILoader::ioINILoader( const char *szFileName , bool bMemoryParsing )
|
||||
{
|
||||
ZeroMemory( m_szFileName, MAX_PATH );
|
||||
ZeroMemory( m_szTitle, MAX_PATH );
|
||||
|
||||
GetCurrentDirectory( MAX_PATH, m_szFileName );
|
||||
StringCbCat( m_szFileName, sizeof( m_szFileName ), "\\" );
|
||||
StringCbCat( m_szFileName, sizeof( m_szFileName ), szFileName );
|
||||
|
||||
m_pParser = NULL;
|
||||
|
||||
if(bMemoryParsing)
|
||||
{
|
||||
DoMemoryParsing();
|
||||
}
|
||||
}
|
||||
|
||||
ioINILoader::ioINILoader( const char *szPath, const char *szFileName , bool bMemoryParsing )
|
||||
{
|
||||
ZeroMemory( m_szFileName, MAX_PATH );
|
||||
ZeroMemory( m_szTitle, MAX_PATH );
|
||||
|
||||
StringCbPrintf( m_szFileName, sizeof( m_szFileName ), "%s/%s", szPath, szFileName );
|
||||
m_pParser = NULL;
|
||||
|
||||
if(bMemoryParsing)
|
||||
{
|
||||
DoMemoryParsing();
|
||||
}
|
||||
}
|
||||
|
||||
ioINILoader::~ioINILoader()
|
||||
{
|
||||
SAFEDELETE( m_pParser );
|
||||
}
|
||||
|
||||
void ioINILoader::SetFileName( const char *szFileName , bool bMemoryParsing )
|
||||
{
|
||||
StringCbCopy( m_szFileName, sizeof( m_szFileName ), szFileName );
|
||||
SAFEDELETE( m_pParser );
|
||||
|
||||
if(bMemoryParsing)
|
||||
{
|
||||
DoMemoryParsing();
|
||||
}
|
||||
}
|
||||
|
||||
void ioINILoader::SetTitle( const char *szTitle )
|
||||
{
|
||||
StringCbCopy( m_szTitle, sizeof( m_szTitle ), szTitle );
|
||||
}
|
||||
|
||||
bool ioINILoader::DoMemoryParsing()
|
||||
{
|
||||
SAFEDELETE( m_pParser );
|
||||
|
||||
m_pParser = new ioINIParser;
|
||||
if( m_pParser->ParsingFile( m_szFileName ) )
|
||||
return true;
|
||||
|
||||
SAFEDELETE( m_pParser );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ioINILoader::DoMemoryParsingFromMemory( ioTextStream &rkStream )
|
||||
{
|
||||
SAFEDELETE( m_pParser );
|
||||
m_pParser = new ioINIParser;
|
||||
m_pParser->ParseINI( rkStream );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ioINILoader::LoadBool( const char *szTitle, const char *szKeyName, bool bDefault )
|
||||
{
|
||||
int iValue = 0;
|
||||
if( bDefault )
|
||||
{
|
||||
iValue = 1;
|
||||
}
|
||||
|
||||
if( m_pParser )
|
||||
{
|
||||
const char *szValue = m_pParser->GetValue( szTitle, szKeyName );
|
||||
if( szValue )
|
||||
{
|
||||
iValue = atoi( szValue );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iValue = GetPrivateProfileInt( szTitle, szKeyName, iValue, m_szFileName );
|
||||
}
|
||||
|
||||
if( iValue != 0 )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
int ioINILoader::LoadInt( const char *szTitle, const char *szKeyName, int iDefault )
|
||||
{
|
||||
int iValue = iDefault;
|
||||
if( m_pParser )
|
||||
{
|
||||
const char *szValue = m_pParser->GetValue( szTitle, szKeyName );
|
||||
if( szValue )
|
||||
{
|
||||
iValue = atoi( szValue );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
iValue = GetPrivateProfileInt( szTitle, szKeyName, iDefault, m_szFileName );
|
||||
}
|
||||
|
||||
return iValue;
|
||||
}
|
||||
|
||||
float ioINILoader::LoadFloat( const char *szTitle, const char *szKeyName, float fDefault )
|
||||
{
|
||||
float fValue = fDefault;
|
||||
|
||||
if( m_pParser )
|
||||
{
|
||||
const char *szValue = m_pParser->GetValue( szTitle, szKeyName );
|
||||
if( szValue )
|
||||
fValue = atof( szValue );
|
||||
else
|
||||
fValue = fDefault;
|
||||
}
|
||||
else
|
||||
{
|
||||
char szBuf[MAX_PATH];
|
||||
GetPrivateProfileString( szTitle, szKeyName, "", szBuf, MAX_PATH, m_szFileName );
|
||||
if( strcmp( szBuf, "" ) )
|
||||
fValue = (float)atof( szBuf );
|
||||
else
|
||||
fValue = fDefault;
|
||||
}
|
||||
|
||||
return fValue;
|
||||
}
|
||||
|
||||
void ioINILoader::LoadVector( const char *szTitle, Vector3 &vVec )
|
||||
{
|
||||
vVec.x = LoadFloat( szTitle, "X", 0.0f );
|
||||
vVec.y = LoadFloat( szTitle, "Y", 0.0f );
|
||||
vVec.z = LoadFloat( szTitle, "Z", 0.0f );
|
||||
}
|
||||
|
||||
void ioINILoader::LoadString( const char *szTitle,
|
||||
const char *szKeyName,
|
||||
const char *szDefault,
|
||||
char *szBuf,
|
||||
int iBufLen )
|
||||
{
|
||||
if( m_pParser )
|
||||
{
|
||||
const char *szValue = m_pParser->GetValue( szTitle, szKeyName );
|
||||
if( szValue )
|
||||
{
|
||||
StringCbCopyN( szBuf, iBufLen, szValue, iBufLen - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
StringCbCopyN( szBuf, iBufLen, szDefault, iBufLen - 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GetPrivateProfileString( szTitle, szKeyName, szDefault, szBuf, iBufLen, m_szFileName );
|
||||
}
|
||||
}
|
||||
|
||||
bool ioINILoader::LoadBool( const char *szKeyName, bool bDefault )
|
||||
{
|
||||
return LoadBool( m_szTitle, szKeyName, bDefault );
|
||||
}
|
||||
|
||||
int ioINILoader::LoadInt( const char *szKeyName, int iDefault )
|
||||
{
|
||||
return LoadInt( m_szTitle, szKeyName, iDefault );
|
||||
}
|
||||
|
||||
float ioINILoader::LoadFloat( const char *szKeyName, float fDefault )
|
||||
{
|
||||
return LoadFloat( m_szTitle, szKeyName, fDefault );
|
||||
}
|
||||
|
||||
void ioINILoader::LoadVector( Vector3 &vVec )
|
||||
{
|
||||
LoadVector( m_szTitle, vVec );
|
||||
}
|
||||
|
||||
void ioINILoader::LoadString( const char *szKeyName,
|
||||
const char *szDefault,
|
||||
char *szBuf,
|
||||
int iBufLen )
|
||||
{
|
||||
LoadString( m_szTitle, szKeyName, szDefault, szBuf, iBufLen );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveString( const char *szTitle, const char *szKeyName, const char *szBuf )
|
||||
{
|
||||
WritePrivateProfileString( szTitle, szKeyName, szBuf, m_szFileName );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveInt( const char *szTitle, const char *szKeyName, int iValue )
|
||||
{
|
||||
char szBuf[MAX_PATH]="";
|
||||
StringCbPrintf( szBuf, sizeof( szBuf ), "%d", iValue );
|
||||
|
||||
WritePrivateProfileString( szTitle, szKeyName, szBuf, m_szFileName );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveFloat( const char *szTitle, const char *szKeyName, float fValue, bool bNoLimit )
|
||||
{
|
||||
char szBuf[MAX_PATH]="";
|
||||
|
||||
if( bNoLimit )
|
||||
{
|
||||
StringCbPrintf( szBuf, sizeof( szBuf ), "%f", fValue );
|
||||
}
|
||||
else
|
||||
{
|
||||
StringCbPrintf( szBuf, sizeof( szBuf ), "%.2f", fValue );
|
||||
}
|
||||
|
||||
WritePrivateProfileString( szTitle, szKeyName, szBuf, m_szFileName );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveBool( const char *szTitle, const char *szKeyName, bool bValue )
|
||||
{
|
||||
if( bValue )
|
||||
{
|
||||
WritePrivateProfileString( szTitle, szKeyName, "1", m_szFileName );
|
||||
}
|
||||
else
|
||||
{
|
||||
WritePrivateProfileString( szTitle, szKeyName, "0", m_szFileName );
|
||||
}
|
||||
}
|
||||
|
||||
void ioINILoader::SaveVector( const char *szTitle, const Vector3 &vVec )
|
||||
{
|
||||
char szBuf[MAX_PATH]="";
|
||||
|
||||
StringCbPrintf( szBuf, sizeof( szBuf ), "%.2f", vVec.x );
|
||||
WritePrivateProfileString( szTitle, "X", szBuf, m_szFileName );
|
||||
|
||||
StringCbPrintf( szBuf, sizeof( szBuf ), "%.2f", vVec.y );
|
||||
WritePrivateProfileString( szTitle, "Y", szBuf, m_szFileName );
|
||||
|
||||
StringCbPrintf( szBuf, sizeof( szBuf ), "%.2f", vVec.z );
|
||||
WritePrivateProfileString( szTitle, "Z", szBuf, m_szFileName );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveString( const char *szKeyName, const char *szBuf )
|
||||
{
|
||||
SaveString( m_szTitle, szKeyName, szBuf );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveInt( const char *szKeyName, int iValue )
|
||||
{
|
||||
SaveInt( m_szTitle, szKeyName, iValue );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveFloat( const char *szKeyName, float fValue, bool bNoLimit )
|
||||
{
|
||||
SaveFloat( m_szTitle, szKeyName, fValue, bNoLimit );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveBool( const char *szKeyName, bool bValue )
|
||||
{
|
||||
SaveBool( m_szTitle, szKeyName, bValue );
|
||||
}
|
||||
|
||||
void ioINILoader::SaveVector( const Vector3 &vVec )
|
||||
{
|
||||
SaveVector( m_szTitle, vVec );
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
|
||||
#ifndef _ioINILoader_h_
|
||||
#define _ioINILoader_h_
|
||||
|
||||
class ioINIParser;
|
||||
class ioTextStream;
|
||||
|
||||
class ioINILoader
|
||||
{
|
||||
private:
|
||||
char m_szFileName[MAX_PATH];
|
||||
char m_szTitle[MAX_PATH];
|
||||
|
||||
ioINIParser *m_pParser;
|
||||
|
||||
public:
|
||||
void SetFileName( const char *szFileName , bool bMemoryParsing = true);
|
||||
void SetTitle( const char *szTitle );
|
||||
|
||||
bool DoMemoryParsing();
|
||||
bool DoMemoryParsingFromMemory( ioTextStream &rkStream );
|
||||
|
||||
const char* GetFileName() const { return m_szFileName; }
|
||||
const char* GetTitle() const { return m_szTitle; }
|
||||
|
||||
public:
|
||||
bool LoadBool( const char *szTitle, const char *szKeyName, bool bDefault );
|
||||
int LoadInt( const char *szTitle, const char *szKeyName, int iDefault );
|
||||
float LoadFloat( const char *szTitle, const char *szKeyName, float fDefault );
|
||||
void LoadVector( const char *szTitle, Vector3 &vVec );
|
||||
void LoadString( const char *szTitle,
|
||||
const char *szKeyName,
|
||||
const char *szDefault,
|
||||
char *szBuf,
|
||||
int iBufLen );
|
||||
|
||||
public:
|
||||
bool LoadBool( const char *szKeyName, bool bDefault );
|
||||
int LoadInt( const char *szKeyName, int iDefault );
|
||||
float LoadFloat( const char *szKeyName, float fDefault );
|
||||
void LoadVector( Vector3 &vVec );
|
||||
void LoadString( const char *szKeyName,
|
||||
const char *szDefault,
|
||||
char *szBuf,
|
||||
int iBufLen );
|
||||
|
||||
public:
|
||||
void SaveString( const char *szTitle, const char *szKeyName, const char *szBuf );
|
||||
void SaveInt( const char *szTitle, const char *szKeyName, int iValue );
|
||||
void SaveFloat( const char *szTitle, const char *szKeyName, float fValue, bool bNoLimit = false );
|
||||
void SaveBool( const char *szTitle, const char *szKeyName, bool bValue );
|
||||
void SaveVector( const char *szTitle, const Vector3 &vVec );
|
||||
|
||||
public:
|
||||
void SaveString( const char *szKeyName, const char *szBuf );
|
||||
void SaveInt( const char *szKeyName, int iValue );
|
||||
void SaveFloat( const char *szKeyName, float fValue, bool bNoLimit = false );
|
||||
void SaveBool( const char *szKeyName, bool bValue );
|
||||
void SaveVector( const Vector3 &vVec );
|
||||
|
||||
public:
|
||||
ioINILoader();
|
||||
ioINILoader( const char *szFileName , bool bMemoryParsing = true );
|
||||
ioINILoader( const char *szPath, const char *szFileName , bool bMemoryParsing = true );
|
||||
~ioINILoader();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,245 @@
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "ioINIParser.h"
|
||||
|
||||
#include "ioStream.h"
|
||||
//#include "../Window.h"
|
||||
//#include "../MainProcess.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
ioINIParser::ioINIParser()
|
||||
{
|
||||
m_pPreList = NULL;
|
||||
}
|
||||
|
||||
ioINIParser::~ioINIParser()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
bool ioINIParser::ParsingFile( const char *szFileName )
|
||||
{
|
||||
Clear();
|
||||
|
||||
ioTextStream kStream;
|
||||
if( !kStream.OpenFile( szFileName ) )
|
||||
{
|
||||
//LOG.PrintTimeAndLog( LOG_DEBUG_LEVEL, "ioINIParser::Parsing - %s Load Failed", szFileName );
|
||||
return false;
|
||||
}
|
||||
|
||||
ParseINI( kStream );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ioINIParser::ParseINI( ioTextStream &rkStream )
|
||||
{
|
||||
std::string line, lastline;
|
||||
|
||||
while( !rkStream.IsEOF() )
|
||||
{
|
||||
if( lastline.empty() || lastline.at(0) != '[' )
|
||||
{
|
||||
rkStream.GetLine( line );
|
||||
}
|
||||
else
|
||||
{
|
||||
line = lastline;
|
||||
lastline.at(0) = '\0';
|
||||
}
|
||||
|
||||
if( line.length() == 0 || line.at(0) != '[' )
|
||||
continue;
|
||||
|
||||
lastline = ParseTitle( line, rkStream );
|
||||
}
|
||||
}
|
||||
|
||||
std::string ioINIParser::ParseTitle( const std::string &szTitle, ioTextStream &rkStream )
|
||||
{
|
||||
string line;
|
||||
|
||||
KeyList *pKeyList = new KeyList;
|
||||
if( !pKeyList )
|
||||
return line;
|
||||
|
||||
while( !rkStream.IsEOF() )
|
||||
{
|
||||
rkStream.GetLine( line );
|
||||
|
||||
if( line.length() == 0 || line.at(0) == ';' )
|
||||
continue;
|
||||
|
||||
if( line.at(0) == '[' ) // New Title
|
||||
break;
|
||||
|
||||
ParseKey( line, pKeyList );
|
||||
}
|
||||
|
||||
if( !pKeyList->empty() )
|
||||
{
|
||||
string szTitleText = szTitle.substr( 1, szTitle.length() - 2 );
|
||||
|
||||
ioStringConverter::toLowerCase( szTitleText );
|
||||
|
||||
m_TitleList.insert( TitleList::value_type( ioHashString(szTitleText.c_str()), pKeyList ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
delete pKeyList;
|
||||
}
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
void ioINIParser::ParseKey( const std::string &line, KeyList *pKeyList )
|
||||
{
|
||||
const StringVector &vecparams = ioStringConverter::Split( line, "=", 1 );
|
||||
if( vecparams.size() != 2 || vecparams[0].empty() )
|
||||
return;
|
||||
|
||||
string szKeyName, szValue;
|
||||
|
||||
string::size_type i, tSize;
|
||||
tSize = vecparams[0].length();
|
||||
for(i=tSize-1 ; i>=0 ; i-- )
|
||||
{
|
||||
if( vecparams[0].at(i) != ' ' &&
|
||||
vecparams[0].at(i) != '\t' &&
|
||||
vecparams[0].at(i) != '\r' )
|
||||
{
|
||||
szKeyName = vecparams[0].substr( 0, i+1 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
tSize = vecparams[1].length();
|
||||
for(i=0 ; i<tSize ; i++ )
|
||||
{
|
||||
if( vecparams[1].at(i) != ' ' &&
|
||||
vecparams[1].at(i) != '\t' &&
|
||||
vecparams[1].at(i) != '\r' )
|
||||
{
|
||||
szValue = vecparams[1].substr( i );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !szKeyName.empty() && !szValue.empty() )
|
||||
{
|
||||
ioStringConverter::toLowerCase( szKeyName );
|
||||
pKeyList->insert( KeyList::value_type( ioHashString(szKeyName.c_str()), szValue ) );
|
||||
}
|
||||
}
|
||||
|
||||
void ioINIParser::Clear()
|
||||
{
|
||||
TitleList::iterator iter;
|
||||
for( iter=m_TitleList.begin() ; iter!=m_TitleList.end() ; ++iter )
|
||||
{
|
||||
delete iter->second;
|
||||
}
|
||||
m_TitleList.clear();
|
||||
|
||||
m_PreTitle.Clear();
|
||||
m_pPreList = NULL;
|
||||
}
|
||||
|
||||
int ioINIParser::GetNumTotalTitle() const
|
||||
{
|
||||
return m_TitleList.size();
|
||||
}
|
||||
|
||||
int ioINIParser::GetNumTotalKey( int iTitleIdx ) const
|
||||
{
|
||||
if( COMPARE( iTitleIdx, 0, GetNumTotalTitle() ) )
|
||||
{
|
||||
TitleList::const_iterator iter = m_TitleList.begin();
|
||||
std::advance( iter, iTitleIdx );
|
||||
return iter->second->size();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* ioINIParser::GetTitle( int iIdx ) const
|
||||
{
|
||||
if( COMPARE( iIdx, 0, GetNumTotalTitle() ) )
|
||||
{
|
||||
TitleList::const_iterator iter = m_TitleList.begin();
|
||||
std::advance( iter, iIdx );
|
||||
return iter->first.c_str();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* ioINIParser::GetKey( int iTitle, int iKey ) const
|
||||
{
|
||||
if( COMPARE( iTitle, 0, GetNumTotalTitle() ) )
|
||||
{
|
||||
TitleList::const_iterator iter = m_TitleList.begin();
|
||||
std::advance( iter, iTitle );
|
||||
|
||||
int iNumKey = iter->second->size();
|
||||
if( COMPARE( iKey, 0, iNumKey ) )
|
||||
{
|
||||
KeyList::const_iterator iKeyIter = iter->second->begin();
|
||||
std::advance( iKeyIter, iKey );
|
||||
return iKeyIter->first.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* ioINIParser::GetValue( int iTitle, int iKey ) const
|
||||
{
|
||||
const char *pTitle = GetTitle( iTitle );
|
||||
const char *pKey = GetKey( iTitle, iKey );
|
||||
|
||||
return GetValue( pTitle, pKey );
|
||||
}
|
||||
|
||||
const char* ioINIParser::GetValue( const char *szTitle, const char *szKeyName ) const
|
||||
{
|
||||
char szLowTitle[MAX_PATH];
|
||||
strcpy_s( szLowTitle, szTitle );
|
||||
_strlwr_s( szLowTitle, sizeof(szLowTitle) );
|
||||
m_szTitleBuf = szLowTitle;
|
||||
|
||||
KeyList *pCurList = NULL;
|
||||
if( m_pPreList && m_PreTitle == m_szTitleBuf )
|
||||
{
|
||||
pCurList = m_pPreList;
|
||||
}
|
||||
else
|
||||
{
|
||||
TitleList::const_iterator iter = m_TitleList.find( m_szTitleBuf );
|
||||
if( iter != m_TitleList.end() )
|
||||
{
|
||||
pCurList = iter->second;
|
||||
|
||||
m_PreTitle = m_szTitleBuf;
|
||||
m_pPreList = pCurList;
|
||||
}
|
||||
}
|
||||
|
||||
if( pCurList )
|
||||
{
|
||||
char szLowKey[MAX_PATH];
|
||||
strcpy_s( szLowKey, szKeyName );
|
||||
_strlwr_s( szLowKey, sizeof(szLowKey) );
|
||||
m_szKeyNameBuf = szLowKey;
|
||||
|
||||
KeyList::const_iterator iKey = pCurList->find( m_szKeyNameBuf );
|
||||
if( iKey != pCurList->end() )
|
||||
return iKey->second.c_str();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
|
||||
#ifndef _ioINIParser_h_
|
||||
#define _ioINIParser_h_
|
||||
|
||||
|
||||
class ioTextStream;
|
||||
|
||||
class ioINIParser
|
||||
{
|
||||
private:
|
||||
typedef std::map< ioHashString, std::string > KeyList;
|
||||
typedef std::map< ioHashString, KeyList* > TitleList;
|
||||
|
||||
TitleList m_TitleList;
|
||||
|
||||
mutable ioHashString m_PreTitle; // 이전에 사용한 타이틀 캐시용도
|
||||
mutable KeyList *m_pPreList;
|
||||
|
||||
mutable ioHashString m_szTitleBuf;
|
||||
mutable ioHashString m_szKeyNameBuf;
|
||||
|
||||
public:
|
||||
bool ParsingFile( const char *szFileName );
|
||||
void ParseINI( ioTextStream &rkStream );
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
std::string ParseTitle( const std::string &szTitle, ioTextStream &rkStream );
|
||||
void ParseKey( const std::string &line, KeyList *pKeyList );
|
||||
|
||||
public:
|
||||
int GetNumTotalTitle() const;
|
||||
int GetNumTotalKey( int iTitle ) const;
|
||||
|
||||
public: // 없으면 ""
|
||||
const char* GetTitle( int iIdx ) const;
|
||||
const char* GetKey( int iTitle, int iKey ) const;
|
||||
|
||||
public: // 없으면 NULL
|
||||
const char* GetValue( int iTitle, int iKey ) const;
|
||||
const char* GetValue( const char *szTitle, const char *szKeyName ) const;
|
||||
|
||||
public:
|
||||
ioINIParser();
|
||||
~ioINIParser();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ioStream.h"
|
||||
|
||||
ioTextStream::ioTextStream()
|
||||
{
|
||||
}
|
||||
|
||||
ioTextStream::~ioTextStream()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
bool ioTextStream::OpenFile( const char *szFileName )
|
||||
{
|
||||
return m_DataChunk.AllocateFromFile( szFileName );
|
||||
}
|
||||
|
||||
BYTE* ioTextStream::OpenMemory( int iSize, BYTE *pBuf )
|
||||
{
|
||||
return m_DataChunk.Allocate( iSize, pBuf );
|
||||
}
|
||||
|
||||
void ioTextStream::Clear()
|
||||
{
|
||||
m_DataChunk.Clear();
|
||||
}
|
||||
|
||||
const BYTE* ioTextStream::GetPtr() const
|
||||
{
|
||||
return m_DataChunk.GetPtr();
|
||||
}
|
||||
|
||||
BYTE* ioTextStream::GetPtr()
|
||||
{
|
||||
return m_DataChunk.GetPtr();
|
||||
}
|
||||
|
||||
int ioTextStream::GetSize() const
|
||||
{
|
||||
return m_DataChunk.GetSize();
|
||||
}
|
||||
|
||||
int ioTextStream::ReadUpTo( void *pBuf, int iSize, const char* pDelim )
|
||||
{
|
||||
return m_DataChunk.ReadUpTo( pBuf, iSize, pDelim );
|
||||
}
|
||||
|
||||
int ioTextStream::SkipUpTo( const char* pDelim )
|
||||
{
|
||||
return m_DataChunk.SkipUpTo( pDelim );
|
||||
}
|
||||
|
||||
void ioTextStream::SkipToNextOpenBrace()
|
||||
{
|
||||
m_DataChunk.SkipToNextOpenBrace();
|
||||
}
|
||||
|
||||
void ioTextStream::SkipToNextCloseBrace()
|
||||
{
|
||||
m_DataChunk.SkipToNextCloseBrace();
|
||||
}
|
||||
|
||||
void ioTextStream::GetLine( std::string &line, bool bTrim )
|
||||
{
|
||||
m_DataChunk.GetLine( line, bTrim );
|
||||
}
|
||||
|
||||
bool ioTextStream::IsEOF() const
|
||||
{
|
||||
return m_DataChunk.IsEOF();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
|
||||
#ifndef _ioStream_h_
|
||||
#define _ioStream_h_
|
||||
|
||||
#include "ioDataChunk.h"
|
||||
|
||||
class ioStream
|
||||
{
|
||||
public:
|
||||
virtual bool OpenFile( const char *szFileName ) = 0;
|
||||
virtual BYTE* OpenMemory( int iSize, BYTE *pBuf = NULL ) = 0;
|
||||
virtual void Clear() = 0;
|
||||
|
||||
public:
|
||||
virtual const BYTE* GetPtr() const = 0;
|
||||
virtual BYTE* GetPtr() = 0;
|
||||
virtual int GetSize() const = 0;
|
||||
|
||||
public:
|
||||
ioStream(){}
|
||||
virtual ~ioStream(){}
|
||||
};
|
||||
|
||||
|
||||
class ioTextStream : public ioStream
|
||||
{
|
||||
protected:
|
||||
ioDataChunk m_DataChunk;
|
||||
|
||||
public:
|
||||
virtual bool OpenFile( const char *szFileName );
|
||||
virtual BYTE* OpenMemory( int iSize, BYTE *pBuf = NULL );
|
||||
virtual void Clear();
|
||||
|
||||
public:
|
||||
virtual const BYTE* GetPtr() const;
|
||||
virtual BYTE* GetPtr();
|
||||
virtual int GetSize() const;
|
||||
|
||||
public:
|
||||
int ReadUpTo( void *pBuf, int iSize, const char* pDelim = "\n" );
|
||||
int SkipUpTo( const char* pDelim = "\n" );
|
||||
|
||||
void SkipToNextOpenBrace();
|
||||
void SkipToNextCloseBrace();
|
||||
|
||||
public:
|
||||
void GetLine( std::string &line, bool bTrim = true );
|
||||
bool IsEOF() const;
|
||||
|
||||
|
||||
public:
|
||||
ioTextStream();
|
||||
virtual ~ioTextStream();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
========================================================================
|
||||
콘솔 응용 프로그램 : libtest 프로젝트 개요
|
||||
========================================================================
|
||||
|
||||
응용 프로그램 마법사에서 이 libtest 응용 프로그램을 만들었습니다.
|
||||
|
||||
libtest 응용 프로그램을 구성하는 각 파일에 대한
|
||||
요약 설명이 포함되어 있습니다.
|
||||
|
||||
|
||||
libtest.vcxproj
|
||||
응용 프로그램 마법사를 사용하여 생성한 VC++ 프로젝트의 기본 프로젝트 파일입니다.
|
||||
파일을 생성한 Visual C++ 버전에 대한 정보와 응용 프로그램 마법사를 사용하여 선택한 플랫폼,
|
||||
구성 및 프로젝트 기능에 대한 정보가 포함되어 있습니다.
|
||||
|
||||
libtest.vcxproj.filters
|
||||
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 필터 파일입니다.
|
||||
이 파일에는 프로젝트의 파일과 필터 간의 연결 정보가 들어 있습니다.
|
||||
이러한 연결은 특정 노드에서 유사한 확장명으로 그룹화된 파일을 표시하기 위해 IDE에서
|
||||
사용됩니다. 예를 들어 ".cpp" 파일은 "소스 파일" 필터와 연결되어 있습니다.
|
||||
|
||||
libtest.cpp
|
||||
기본 응용 프로그램 소스 파일입니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
기타 표준 파일:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
이 파일은 미리 컴파일된 헤더(PCH) 파일 libtest.pch와
|
||||
미리 컴파일된 형식(PCT) 파일 StdAfx.obj를 빌드하는 데 사용됩니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
기타 참고:
|
||||
|
||||
응용 프로그램 마법사에서 사용하는 "TODO:" 주석은 사용자가 추가하거나 사용자 지정해야 하는
|
||||
소스 코드 부분을 나타냅니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,196 @@
|
||||
#include "stdafx.h"
|
||||
#include "ioHashString.h"
|
||||
|
||||
ioHashString::ioHashString()
|
||||
{
|
||||
m_iCapacity = DEFAULT_CAPACITY;
|
||||
m_pString = new char[ m_iCapacity ];
|
||||
|
||||
Clear();
|
||||
|
||||
m_dwHashCode = CalcHashCode( m_pString );
|
||||
}
|
||||
|
||||
ioHashString::ioHashString( const char* str ) : m_pString(NULL)
|
||||
{
|
||||
m_iLength = strlen( str );
|
||||
|
||||
int iCapacity = max( m_iLength + 1, DEFAULT_CAPACITY );
|
||||
ReAllocCapacity( iCapacity );
|
||||
|
||||
strcpy_s( m_pString, iCapacity, str );
|
||||
m_dwHashCode = CalcHashCode( str );
|
||||
}
|
||||
|
||||
ioHashString::ioHashString( const ioHashString &rhs ) : m_pString(NULL)
|
||||
{
|
||||
m_iLength = rhs.Length();
|
||||
|
||||
ReAllocCapacity( rhs.m_iCapacity );
|
||||
|
||||
strcpy_s( m_pString, rhs.m_iCapacity, rhs.m_pString );
|
||||
m_dwHashCode = rhs.m_dwHashCode;
|
||||
}
|
||||
|
||||
ioHashString::~ioHashString()
|
||||
{
|
||||
if( m_pString )
|
||||
{
|
||||
delete[] m_pString;
|
||||
m_pString = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool ioHashString::IsEmpty() const
|
||||
{
|
||||
return ( m_iLength == 0 );
|
||||
}
|
||||
|
||||
int ioHashString::Length() const
|
||||
{
|
||||
return m_iLength;
|
||||
}
|
||||
|
||||
void ioHashString::Clear()
|
||||
{
|
||||
memset( m_pString, 0, m_iCapacity );
|
||||
m_iLength = 0;
|
||||
}
|
||||
|
||||
const char* ioHashString::c_str() const
|
||||
{
|
||||
return m_pString;
|
||||
}
|
||||
|
||||
void ioHashString::ReAllocCapacity( int iNewCapacity )
|
||||
{
|
||||
if( m_pString )
|
||||
{
|
||||
delete[] m_pString;
|
||||
m_pString = NULL;
|
||||
}
|
||||
|
||||
m_iCapacity = iNewCapacity;
|
||||
m_pString = new char[iNewCapacity];
|
||||
}
|
||||
|
||||
DWORD ioHashString::CalcHashCode( const char *str )
|
||||
{
|
||||
DWORD dwLen, dwCh, dwResult;
|
||||
|
||||
dwLen = strlen( str );
|
||||
dwResult = HASH_CONST;
|
||||
|
||||
for( DWORD i=0; i<dwLen ; i++ )
|
||||
{
|
||||
dwCh = (DWORD)str[i];
|
||||
dwResult = ((dwResult<< 5) + dwResult) + dwCh; // hash * 33 + ch
|
||||
}
|
||||
|
||||
return dwResult;
|
||||
}
|
||||
|
||||
DWORD ioHashString::GetHashCode() const
|
||||
{
|
||||
return m_dwHashCode;
|
||||
}
|
||||
|
||||
void ioHashString::MakeLower()
|
||||
{
|
||||
if( m_pString )
|
||||
{
|
||||
_strlwr_s( m_pString, m_iCapacity );
|
||||
m_dwHashCode = CalcHashCode( m_pString );
|
||||
}
|
||||
}
|
||||
|
||||
void ioHashString::MakeUpper()
|
||||
{
|
||||
if( m_pString )
|
||||
{
|
||||
_strupr_s( m_pString, m_iCapacity );
|
||||
m_dwHashCode = CalcHashCode( m_pString );
|
||||
}
|
||||
}
|
||||
|
||||
bool ioHashString::operator<( const ioHashString &rhs ) const
|
||||
{
|
||||
if( m_dwHashCode != rhs.m_dwHashCode )
|
||||
return ( m_dwHashCode < rhs.m_dwHashCode );
|
||||
|
||||
return ( strcmp( m_pString, rhs.m_pString ) < 0 );
|
||||
}
|
||||
|
||||
char ioHashString::At( int i ) const
|
||||
{
|
||||
if( m_iLength < i || !m_pString )
|
||||
{
|
||||
assert( false );
|
||||
return 0;
|
||||
}
|
||||
|
||||
return m_pString[i];
|
||||
}
|
||||
|
||||
ioHashString& ioHashString::operator=( const ioHashString &rhs )
|
||||
{
|
||||
m_iLength = rhs.Length();
|
||||
if( m_iCapacity < m_iLength + 1 )
|
||||
{
|
||||
ReAllocCapacity( m_iLength + 1 );
|
||||
}
|
||||
|
||||
strcpy_s(m_pString, m_iCapacity, rhs.m_pString );
|
||||
m_dwHashCode = rhs.m_dwHashCode;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
ioHashString& ioHashString::operator=( const char *szText )
|
||||
{
|
||||
m_iLength = strlen( szText );
|
||||
if( m_iCapacity < m_iLength + 1 )
|
||||
{
|
||||
ReAllocCapacity( m_iLength + 1 );
|
||||
}
|
||||
|
||||
strcpy_s( m_pString, m_iCapacity, szText );
|
||||
m_dwHashCode = CalcHashCode( szText );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool ioHashString::operator==( const ioHashString &rhs ) const
|
||||
{
|
||||
if( m_dwHashCode != rhs.m_dwHashCode )
|
||||
return false;
|
||||
|
||||
if( strcmp( m_pString, rhs.m_pString ) != 0 )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ioHashString::operator==( const char *szText ) const
|
||||
{
|
||||
if( strcmp( m_pString, szText ) != 0 )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ioHashString::operator!=( const ioHashString &rhs ) const
|
||||
{
|
||||
if( *this == rhs )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ioHashString::operator!=( const char *szText ) const
|
||||
{
|
||||
if( *this == szText )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
#ifndef _ioHashString_h_
|
||||
#define _ioHashString_h_
|
||||
|
||||
#define HASH_CONST 5381
|
||||
|
||||
#ifdef THAILAND_LONG_ID
|
||||
#define DEFAULT_CAPACITY 44 // SetReturnData() size을 사용하므로 ID_NUM_PLUS_ONE 길이 보다 길어야함
|
||||
#else
|
||||
#define DEFAULT_CAPACITY 32 // SetReturnData() size을 사용하므로 ID_NUM_PLUS_ONE 길이 보다 길어야함
|
||||
#endif
|
||||
|
||||
// Original version is www.gamza.net
|
||||
|
||||
class ioHashString
|
||||
{
|
||||
private:
|
||||
char *m_pString;
|
||||
DWORD m_dwHashCode;
|
||||
int m_iLength;
|
||||
int m_iCapacity;
|
||||
|
||||
private:
|
||||
void ReAllocCapacity( int iNewCapacity );
|
||||
|
||||
public:
|
||||
void Clear();
|
||||
|
||||
bool IsEmpty() const;
|
||||
int Length() const;
|
||||
char At( int i ) const;
|
||||
|
||||
DWORD GetHashCode() const;
|
||||
const char* c_str() const;
|
||||
|
||||
void MakeLower();
|
||||
void MakeUpper();
|
||||
|
||||
public:
|
||||
static DWORD CalcHashCode( const char *str );
|
||||
|
||||
public:
|
||||
bool operator < ( const ioHashString &rhs ) const;
|
||||
|
||||
ioHashString& operator=( const ioHashString &rhs );
|
||||
ioHashString& operator=( const char *szText );
|
||||
|
||||
bool operator==( const ioHashString &rhs ) const;
|
||||
bool operator==( const char *szText ) const;
|
||||
|
||||
bool operator!=( const ioHashString &rhs ) const;
|
||||
bool operator!=( const char *szText ) const;
|
||||
|
||||
public:
|
||||
ioHashString();
|
||||
ioHashString( const char *str );
|
||||
ioHashString( const ioHashString &rhs );
|
||||
~ioHashString();
|
||||
};
|
||||
|
||||
typedef std::vector< ioHashString > ioHashStringVec;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
[NETWORK]
|
||||
CSPORT = 20000
|
||||
SSPORT = 20001
|
||||
MSPORT = 7139
|
||||
|
||||
DBIP = 172.20.20.110
|
||||
DBPORT = 30911
|
||||
|
||||
;DBIP = 172.20.20.110
|
||||
;DBPORT = 30000
|
||||
|
||||
LOGDBIP = 172.20.20.73
|
||||
LOGDBSTARTPORT = 30001
|
||||
LOGDBMaxPortCnt= 1
|
||||
|
||||
LOGSERVERIP = 172.20.20.75
|
||||
LOGSERVERPORT = 14009
|
||||
|
||||
|
||||
MainServerIP = 172.20.20.110
|
||||
MainServerPORT = 40000
|
||||
|
||||
BillingRelayServerIP = 172.20.20.75
|
||||
; MY
|
||||
;BillingRelayServerIP = 172.20.20.59
|
||||
BillingRelayServerStartPort = 14010
|
||||
BillingRelayServerMaxPortCnt= 1
|
||||
|
||||
;60분마다 DB에 판매량 Select
|
||||
[ClassPrice]
|
||||
LoadTime = 60
|
||||
|
||||
[MemoryPool]
|
||||
server_pool = 10
|
||||
|
||||
battleroom_pool = 1000
|
||||
ladderteam_pool = 3000
|
||||
room_pool = 1000
|
||||
channel_pool = 5000
|
||||
user_pool = 1000
|
||||
limit_user = 1000
|
||||
|
||||
[SECURITY]
|
||||
ON = 1
|
||||
ONE_SEC_RCV = 1000
|
||||
|
||||
[FEATURE]
|
||||
NAME=아마1 존
|
||||
ARRAY = 1
|
||||
MainSleepMS = 1
|
||||
;DefaultiniLoad = 0
|
||||
|
||||
[HACK]
|
||||
check_min_time = 7000
|
||||
check_max_time = 12000
|
||||
check_less_count = 1
|
||||
check_over_count = 0
|
||||
check_less_over_count = 0
|
||||
check_total_count = 0
|
||||
|
||||
[SpeedHackQuiz]
|
||||
max_answer_chance = 3
|
||||
client_answer_time = 15000
|
||||
server_answer_time = 16000
|
||||
|
||||
first_max_operand_size = 2
|
||||
second_max_operand_size = 2
|
||||
max_operator_type = 1
|
||||
|
||||
[AbuseQuiz]
|
||||
max_answer_chance = 3
|
||||
client_answer_time = 30000
|
||||
server_answer_time = 31000
|
||||
|
||||
first_max_operand_size = 2
|
||||
second_max_operand_size = 1
|
||||
max_operator_type = 1
|
||||
|
||||
[AddExerciseCharIndex]
|
||||
; 연습용병 index는 4284967295 ~ 4294967294 까지 천만개를 사용.
|
||||
; 지금 서버에서는 4284967295 + start_add_exercise_char_index 부터 4284967295 + end_add_exercise_char_index 까지 사용
|
||||
; limit_user 숫자만큼 할당
|
||||
max_index = 1000
|
||||
|
||||
[Xtrap]
|
||||
; Xtrap 서버 기능 사용 유무 0 미사용 , 1사용
|
||||
use = 0
|
||||
|
||||
[Local]
|
||||
; 119483910 : 한국버전
|
||||
Version = 119483910
|
||||
|
||||
|
||||
; INFINITE 1일경우 Max 갯수 = INFI_Max값으로..
|
||||
[SendBuffer Count]
|
||||
;Min = 1
|
||||
;Max = 10
|
||||
Min = 10
|
||||
Max = 1000
|
||||
|
||||
|
||||
; Nagle Time은 10 ~ 30 ms로 설정. 유저가 렉으로 판단하지 않을정도의 적당한 수치를 찾아서..
|
||||
; 레퍼런스 카운트 역시 SendBuffer가 너무 많이 쌓이지 않게 적당한 수치로 설정.
|
||||
[Nagle]
|
||||
Nagle_Time = 100
|
||||
Nagle_RefCnt = 55
|
||||
@@ -0,0 +1,287 @@
|
||||
// libtest.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다.
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
void ini_file_load();
|
||||
void ini_file_load_quest();
|
||||
void SetQuestData( DWORD dwMainIndex, DWORD dwSubIndex, ioINILoader &rkLoader );
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
//_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
|
||||
//_CrtSetBreakAlloc( 80 );
|
||||
|
||||
/*for( int i = 0 ; i < 3 ; ++i )
|
||||
{
|
||||
ini_file_load();
|
||||
ini_file_load_quest();
|
||||
}
|
||||
cout << "end..." << endl;*/
|
||||
|
||||
{
|
||||
ioINILoader kLoader;
|
||||
kLoader.SetFileName( "Gameserverinfo.ini" );
|
||||
|
||||
// 파일 바로 읽기.
|
||||
bool boolvalue = kLoader.ReadBool( "security", "on", 0 );
|
||||
int intvalue = kLoader.ReadInt( "memorypool", "server_pool", 777 );
|
||||
float floatvalue = kLoader.ReadFloat( "classprice", "loadtime", 0 );
|
||||
char buff[ 256 ];
|
||||
int len = 256;
|
||||
kLoader.ReadString( "feature", "name", "", buff, len );
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
ioINILoader kLoader2( "Gameserverinfo.ini" );
|
||||
|
||||
// 전체 reload
|
||||
//kLoader2.ReloadFile( "Gameserverinfo.ini" );
|
||||
|
||||
// 부분 reload [feature]
|
||||
kLoader2.ReloadFile( "Gameserverinfo.ini", "feature" );
|
||||
|
||||
//
|
||||
kLoader2.SetTitle( "feature" );
|
||||
int arrayint = kLoader2.LoadInt( "Array", 0 );
|
||||
|
||||
//remove
|
||||
//kLoader2.RemoveFile( "Gameserverinfo.ini" );
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
cin >> i;
|
||||
|
||||
//_CrtDumpMemoryLeaks();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ini_file_load()
|
||||
{
|
||||
DWORD time = GetTickCount();
|
||||
|
||||
int value = 0;
|
||||
int temp[ 65535 ] = { 0, };
|
||||
|
||||
// 게임서버 ini파일 로드
|
||||
ioINILoader kLoader( "sp2_monster_treasure_card.ini" );
|
||||
|
||||
int i = 0;
|
||||
char szKey[MAX_PATH], szBuf[MAX_PATH];
|
||||
kLoader.SetTitle( "common" );
|
||||
|
||||
// 선물 리스트
|
||||
int iMaxTable = kLoader.LoadInt( "max_table", 0 );
|
||||
for(i = 0;i < iMaxTable;i++)
|
||||
{
|
||||
sprintf_s( szKey, "table%d", i + 1 );
|
||||
kLoader.SetTitle( szKey );
|
||||
|
||||
// 공용
|
||||
kLoader.LoadString( "present_name", "", szBuf, MAX_PATH );
|
||||
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_state", 0 );
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_ment", 0 );
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_period", 0 );
|
||||
|
||||
int iMaxPresent = kLoader.LoadInt( "max_present", 0 );
|
||||
for(int k = 0;k < iMaxPresent;k++)
|
||||
{
|
||||
sprintf_s( szKey, "present%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_type", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_value1", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_value2", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
// 장비 선물의 기간+강화값 랜덤 리스트
|
||||
kLoader.SetTitle( "common" );
|
||||
iMaxTable = kLoader.LoadInt( "max_extraitem_rand_table", 0 );
|
||||
for(i = 0;i < iMaxTable;i++)
|
||||
{
|
||||
sprintf_s( szKey, "extraitem_rand_table%d", i + 1 );
|
||||
kLoader.SetTitle( szKey );
|
||||
|
||||
int k = 0;
|
||||
int iMaxLimitDate = kLoader.LoadInt( "max_limit_date", 0 );
|
||||
for(k = 0;k < iMaxLimitDate;k++)
|
||||
{
|
||||
sprintf_s( szKey, "limit_date%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "limit_date%d_value", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
|
||||
int iMaxReinforceDate = kLoader.LoadInt( "max_reinforce", 0 );
|
||||
for(k = 0;k < iMaxReinforceDate;k++)
|
||||
{
|
||||
sprintf_s( szKey, "reinforce%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "reinforce%d_value", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
DWORD result = GetTickCount() - time;
|
||||
cout << "sp2_monster_treasure_card result : " << result << endl;
|
||||
}
|
||||
|
||||
void ini_file_load_quest()
|
||||
{
|
||||
DWORD time = GetTickCount();
|
||||
|
||||
ioINILoader kLoader( "sp2_quest_info.ini" );
|
||||
kLoader.SetTitle( "common" );
|
||||
|
||||
int iMaxQuest = kLoader.LoadInt( "max_quest", 0 );
|
||||
for(int i = 0;i < iMaxQuest;i++)
|
||||
{
|
||||
char szTitle[MAX_PATH] = "";
|
||||
sprintf_s( szTitle, "quest%d", i + 1 );
|
||||
kLoader.SetTitle( szTitle );
|
||||
|
||||
char szClassName[MAX_PATH] = "";
|
||||
kLoader.LoadString( "class_name", "", szClassName, MAX_PATH );
|
||||
|
||||
DWORD dwMainIndex = kLoader.LoadInt( "main_index", 0 );
|
||||
int iMaxSubQuest = kLoader.LoadInt( "max_sub_quest", 0 );
|
||||
for(int j = 0;j < iMaxSubQuest;j++)
|
||||
{
|
||||
SetQuestData( dwMainIndex, j + 1, kLoader );
|
||||
}
|
||||
}
|
||||
|
||||
DWORD result = GetTickCount() - time;
|
||||
cout << "sp2_quest_info result : " << result << endl;
|
||||
}
|
||||
|
||||
void SetQuestData( DWORD dwMainIndex, DWORD dwSubIndex, ioINILoader &rkLoader )
|
||||
{
|
||||
int value = 0;
|
||||
int temp[ 65535 ] = { 0, };
|
||||
|
||||
DWORD m_dwMainIndex = dwMainIndex;
|
||||
DWORD m_dwSubIndex = dwSubIndex;
|
||||
|
||||
char szKey[MAX_PATH] = "";
|
||||
char szBuf[MAX_PATH] = "";
|
||||
sprintf_s( szKey, "sub%d_title", m_dwSubIndex );
|
||||
rkLoader.LoadString( szKey, "", szBuf, MAX_PATH );
|
||||
//m_szTitle = szBuf;
|
||||
|
||||
sprintf_s( szKey, "sub%d_perform_type", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_oneday_style", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadBool( szKey, false );
|
||||
|
||||
sprintf_s( szKey, "sub%d_repeat_style", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadBool( szKey, false );
|
||||
|
||||
sprintf_s( szKey, "sub%d_guild_style", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadBool( szKey, false );
|
||||
|
||||
sprintf_s( szKey, "sub%d_pcroom_style", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadBool( szKey, false );
|
||||
|
||||
sprintf_s( szKey, "sub%d_channeling_type", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, -1 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_occur_value", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_occur_mode", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, -1 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_occur_room_style", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, -1 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_complete_value", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_complete_mode", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, -1 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_complete_room_style", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, -1 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_period_hour", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
//m_vRewardPresent.clear();
|
||||
sprintf_s( szKey, "sub%d_max_reward", m_dwSubIndex );
|
||||
int iMaxReward = rkLoader.LoadInt( szKey, 0 );
|
||||
int i = 0;
|
||||
for(;i < iMaxReward;i++)
|
||||
{
|
||||
sprintf_s( szKey, "sub%d_reward_present%d", m_dwSubIndex, i + 1 );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
|
||||
sprintf_s( szKey, "sub%d_prev_main_index", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_prev_sub_index", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_next_main_index", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_next_sub_index", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_complete_game_alarm", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadBool( szKey, false );
|
||||
|
||||
sprintf_s( szKey, "sub%d_complete_web_alarm", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadBool( szKey, false );
|
||||
|
||||
//m_CustomValue.clear();
|
||||
int iDefCustom = -999999999;
|
||||
for(i = 0;i < 50;i++)
|
||||
{
|
||||
sprintf_s( szKey, "sub%d_custom_value%d", m_dwSubIndex, i + 1 );
|
||||
int iCustomValue = rkLoader.LoadInt( szKey, iDefCustom );
|
||||
if( iCustomValue == iDefCustom )
|
||||
break;
|
||||
//m_CustomValue.push_back( iCustomValue );
|
||||
}
|
||||
|
||||
// 이벤트 퀘스트 시간 로드
|
||||
sprintf_s( szKey, "sub%d_start_year", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_start_month", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_start_date", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_start_hour", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_end_year", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_end_month", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_end_date", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "sub%d_end_hour", m_dwSubIndex );
|
||||
temp[ value++ ] = rkLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{201A7015-1664-4C02-BC30-8B99D2403B42}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>libtest</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<ReferencePath>$(ReferencePath)</ReferencePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="INILoader\ioDataChunk.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INILoader\ioINILoader.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INILoader\ioINIParser.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INILoader\ioStream.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="Util\ioHashString.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="INILoader\ioDataChunk.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INILoader\ioINILoader.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INILoader\ioINIParser.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INILoader\ioStream.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libtest.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Util\ioHashString.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="소스 파일">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="헤더 파일">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="리소스 파일">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="INILoader">
|
||||
<UniqueIdentifier>{095b0d9b-d70e-4b50-967d-e4a68e8780ca}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Util">
|
||||
<UniqueIdentifier>{c7feb027-7e05-4707-b5e8-e519ea9d130f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INILoader\ioDataChunk.h">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INILoader\ioINILoader.h">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INILoader\ioINIParser.h">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="INILoader\ioStream.h">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Util\ioHashString.h">
|
||||
<Filter>Util</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="libtest.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INILoader\ioDataChunk.cpp">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INILoader\ioINILoader.cpp">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INILoader\ioINIParser.cpp">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="INILoader\ioStream.cpp">
|
||||
<Filter>INILoader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Util\ioHashString.cpp">
|
||||
<Filter>Util</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,51 @@
|
||||
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다.
|
||||
// libtest.pch는 미리 컴파일된 헤더가 됩니다.
|
||||
// stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: 필요한 추가 헤더는
|
||||
// 이 파일이 아닌 STDAFX.H에서 참조합니다.
|
||||
|
||||
namespace ioStringConverter
|
||||
{
|
||||
|
||||
StringVector Split( const string ¶m, const string &delims, int iMaxSplit )
|
||||
{
|
||||
StringVector ret;
|
||||
int iNumSplits = 0;
|
||||
|
||||
size_t iStart, iPos;
|
||||
iStart = 0;
|
||||
|
||||
do
|
||||
{
|
||||
iPos = param.find_first_of( delims, iStart );
|
||||
if( iPos == iStart )
|
||||
{
|
||||
iStart = iPos + 1;
|
||||
}
|
||||
else if( iPos == param.npos || ( iMaxSplit && iNumSplits == iMaxSplit ) )
|
||||
{
|
||||
ret.push_back( param.substr(iStart) );
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.push_back( param.substr( iStart, iPos - iStart ) );
|
||||
iStart = iPos + 1;
|
||||
}
|
||||
|
||||
iStart = param.find_first_not_of( delims, iStart );
|
||||
++iNumSplits;
|
||||
}while( iPos != param.npos );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void toLowerCase( std::string &str )
|
||||
{
|
||||
std::transform( str.begin(), str.end(), str.begin(), tolower );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
|
||||
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
|
||||
// 들어 있는 포함 파일입니다.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
|
||||
// TODO: 프로그램에 필요한 추가 헤더는 여기에서 참조합니다.
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
#include <stdlib.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <assert.h>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
typedef std::vector< std::string > StringVector;
|
||||
|
||||
#include "Util\ioHashString.h"
|
||||
|
||||
namespace ioStringConverter
|
||||
{
|
||||
StringVector Split( const std::string ¶m,
|
||||
const std::string &delims,
|
||||
int iMaxSplit = 0 );
|
||||
void toLowerCase( std::string &str );
|
||||
}
|
||||
|
||||
#define COMPARE(x,min,max) (((x)>=(min))&&((x)<(max)))
|
||||
#define SAFEDELETE(x) if(x != NULL) { delete x; x = NULL; }
|
||||
#define SAFEDELETEARRAY(x) if(x != NULL) { delete [] x; x = NULL; }
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
|
||||
struct Vector3
|
||||
{
|
||||
float x,y,z;
|
||||
|
||||
Vector3(){}
|
||||
Vector3( float _x, float _y, float _z )
|
||||
{
|
||||
x = _x;
|
||||
y = _y;
|
||||
z = _z;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define use_lib
|
||||
|
||||
#ifdef use_lib
|
||||
|
||||
// typedef
|
||||
typedef std::basic_string<TCHAR> tstring;
|
||||
|
||||
#include "../../../src/include/common.h"
|
||||
#include "../../../src/ioINILoader/ioINILoader.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#pragma comment( lib, "../../../lib/INID.lib" )
|
||||
#else
|
||||
#pragma comment( lib, "../../../lib/INI.lib" )
|
||||
#endif
|
||||
#else
|
||||
|
||||
#include "INILoader\ioINILoader.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// SDKDDKVer.h를 포함하면 최고 수준의 가용성을 가진 Windows 플랫폼이 정의됩니다.
|
||||
|
||||
// 이전 Windows 플랫폼에 대해 응용 프로그램을 빌드하려는 경우에는 SDKDDKVer.h를 포함하기 전에
|
||||
// WinSDKVer.h를 포함하고 _WIN32_WINNT 매크로를 지원하려는 플랫폼으로 설정하십시오.
|
||||
|
||||
#include <SDKDDKVer.h>
|
||||
@@ -0,0 +1,299 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace INILoader
|
||||
{
|
||||
using dicKeyList = Dictionary<String, String>;
|
||||
using dicTitleList = Dictionary<String, Dictionary<String, String>>;
|
||||
public class INILoader
|
||||
{
|
||||
[System.Runtime.InteropServices.DllImport("kernel32")]
|
||||
private static extern long WritePrivateProfileString(String section, String key, String value, String filepath);
|
||||
[System.Runtime.InteropServices.DllImport("kernel32")]
|
||||
private static extern long GetPrivateProfileString(String section, String key, String value, StringBuilder retValue, int size, String filepath);
|
||||
|
||||
public String m_FileName;
|
||||
public String m_szTitle;
|
||||
|
||||
dicTitleList m_TitleList = new dicTitleList();
|
||||
|
||||
bool m_bSaveLog;
|
||||
StreamWriter m_Log;
|
||||
public INILoader()
|
||||
{
|
||||
m_FileName = "";
|
||||
m_szTitle = "";
|
||||
}
|
||||
|
||||
~INILoader()
|
||||
{
|
||||
}
|
||||
|
||||
public INILoader(String szFile, bool save_log)
|
||||
{
|
||||
if (!File.Exists(szFile))
|
||||
return;
|
||||
|
||||
m_bSaveLog = save_log;
|
||||
if( m_bSaveLog )
|
||||
{
|
||||
|
||||
String log_file = Path.GetFileName(szFile);
|
||||
m_Log = new StreamWriter( String.Format( "./{0}.log", log_file ), false, Encoding.Default );
|
||||
}
|
||||
|
||||
m_FileName = szFile;
|
||||
m_szTitle = "";
|
||||
Parsing();
|
||||
}
|
||||
|
||||
public void SetFileName( String szFile )
|
||||
{
|
||||
m_TitleList.Clear();
|
||||
m_FileName = szFile;
|
||||
m_szTitle = "";
|
||||
if (File.Exists(szFile))
|
||||
{
|
||||
Parsing();
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLog(String.Format("ini 파일이 없습니다 : [{0}]", szFile));
|
||||
}
|
||||
}
|
||||
|
||||
public String GetFileName() { return m_FileName; }
|
||||
public void Parsing()
|
||||
{
|
||||
WriteLog("<<< -------------------- INI Load -------------------- >>>");
|
||||
String szLine = String.Empty;
|
||||
String szLastLine = String.Empty;
|
||||
|
||||
StreamReader sr = new StreamReader(m_FileName, Encoding.Default);
|
||||
dicKeyList tempKeyList = new dicKeyList();
|
||||
while (sr.Peek() > -1)
|
||||
{
|
||||
if (szLastLine == String.Empty || szLastLine[0] != '[')
|
||||
{
|
||||
szLine = sr.ReadLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
szLine = szLastLine;
|
||||
szLastLine = String.Empty;
|
||||
}
|
||||
|
||||
szLine = szLine.Replace("\t", "");
|
||||
if (szLine == String.Empty)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (szLine[0] != '[')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
szLastLine = ParseTitle(szLine, ref sr);
|
||||
}
|
||||
|
||||
sr.Close();
|
||||
WriteLog("<<< -------------------- INI Load Complete -------------------- >>>");
|
||||
if( m_bSaveLog )
|
||||
m_Log.Close();
|
||||
}
|
||||
|
||||
private String ParseTitle(String szTitle, ref StreamReader sr)
|
||||
{
|
||||
String szLine = "";
|
||||
dicKeyList tempKeyList = new dicKeyList();
|
||||
while (sr.Peek() > -1)
|
||||
{
|
||||
szLine = sr.ReadLine();
|
||||
szLine = szLine.Replace("\t", "");
|
||||
if (szLine == String.Empty)
|
||||
continue;
|
||||
|
||||
if (szLine[0] == ';')
|
||||
continue;
|
||||
|
||||
if (szLine[0] == '[')
|
||||
break;
|
||||
|
||||
ParseKey(szTitle, szLine, ref tempKeyList);
|
||||
}
|
||||
|
||||
if (tempKeyList.Count > 0)
|
||||
{
|
||||
char[] charSeparators = new char[] { '[', ']' };
|
||||
String[] RetString = szTitle.Split(charSeparators);
|
||||
if( RetString.Length < 3 )
|
||||
WriteLog(String.Format("알수없는 오류 발생 : {0}", szTitle));
|
||||
|
||||
dicKeyList retList;
|
||||
if (!m_TitleList.TryGetValue(RetString[1], out retList))
|
||||
{
|
||||
m_TitleList.Add(RetString[1], tempKeyList);
|
||||
}
|
||||
else
|
||||
{
|
||||
int iCnt = retList.Count;
|
||||
WriteLog(String.Format("중복섹션이 발생했습니다. : {0}", szTitle));
|
||||
}
|
||||
}
|
||||
|
||||
return szLine;
|
||||
}
|
||||
|
||||
private void ParseKey(String szTitle, String szLine, ref dicKeyList KeyList)
|
||||
{
|
||||
char[] charSeparators = new char[] { '=', '\t' };
|
||||
String[] szWord = szLine.Split(charSeparators, 2);
|
||||
if (szWord.Length > 1)
|
||||
{
|
||||
String szKey = szWord[0].Trim();
|
||||
String szValue = szWord[1].Trim();
|
||||
String RetValue;
|
||||
if (!KeyList.TryGetValue(szKey, out RetValue))
|
||||
{
|
||||
KeyList.Add(szKey, szValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
//MessageBox.Show( "이미 있는 키입니다. - "+szKey);
|
||||
WriteLog(String.Format("중복키가 발생했습니다. : {0} {1}", szTitle, szKey));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTitle(String szSection)
|
||||
{
|
||||
m_szTitle = szSection;
|
||||
}
|
||||
|
||||
public void WriteValue(String key, String value)
|
||||
{
|
||||
if (String.IsNullOrEmpty(m_FileName) || String.IsNullOrEmpty(m_szTitle))
|
||||
return;
|
||||
|
||||
WritePrivateProfileString(m_szTitle, key, String.Format(" {0}", value), m_FileName);
|
||||
}
|
||||
|
||||
public void WriteSection(String section, String key, String value)
|
||||
{
|
||||
WritePrivateProfileString(section, key, value, m_FileName);
|
||||
}
|
||||
|
||||
public String GetValue(String key)
|
||||
{
|
||||
if (String.IsNullOrEmpty(m_szTitle))
|
||||
return String.Empty;
|
||||
|
||||
String retValue = "";
|
||||
dicKeyList KeyList;
|
||||
try
|
||||
{
|
||||
if (m_TitleList.TryGetValue(m_szTitle, out KeyList))
|
||||
{
|
||||
if (KeyList.TryGetValue(key, out retValue))
|
||||
return retValue;
|
||||
}
|
||||
}
|
||||
catch /*(System.Exception e)*/
|
||||
{
|
||||
/*MessageBox.Show(e.Message);*/
|
||||
}
|
||||
|
||||
return retValue;
|
||||
}
|
||||
|
||||
public String LoadString(String key, String defVal)
|
||||
{
|
||||
String retVal = GetValue(key);
|
||||
if (String.IsNullOrEmpty(retVal))
|
||||
return defVal;
|
||||
|
||||
return retVal.ToString();
|
||||
}
|
||||
|
||||
public int LoadInt(String key, int defVal)
|
||||
{
|
||||
try
|
||||
{
|
||||
String retVal = GetValue(key);
|
||||
if (String.IsNullOrEmpty(retVal))
|
||||
return defVal;
|
||||
|
||||
return Int32.Parse(retVal);
|
||||
}
|
||||
catch /*(System.Exception e)*/
|
||||
{
|
||||
/*String retVal = GetValue(key);
|
||||
MessageBox.Show( e.Message + "-" + key + retVal );*/
|
||||
}
|
||||
return defVal;
|
||||
}
|
||||
|
||||
public uint LoadUint(String key, uint defVal)
|
||||
{
|
||||
try
|
||||
{
|
||||
String retVal = GetValue(key);
|
||||
if (String.IsNullOrEmpty(retVal))
|
||||
return defVal;
|
||||
|
||||
return uint.Parse(retVal);
|
||||
}
|
||||
catch /*(System.Exception e)*/
|
||||
{
|
||||
/*String retVal = GetValue(key);
|
||||
MessageBox.Show( e.Message + "-" + key + retVal );*/
|
||||
}
|
||||
return defVal;
|
||||
}
|
||||
|
||||
public float LoadFloat(String key, float defVal)
|
||||
{
|
||||
String retVal = GetValue(key);
|
||||
if (String.IsNullOrEmpty(retVal))
|
||||
return defVal;
|
||||
|
||||
return float.Parse(retVal);
|
||||
}
|
||||
|
||||
public bool LoadBool(String key, bool defVal)
|
||||
{
|
||||
try
|
||||
{
|
||||
String retVal = GetValue(key);
|
||||
if (String.IsNullOrEmpty(retVal))
|
||||
return defVal;
|
||||
|
||||
if (int.Parse(retVal) == 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
catch /*(System.Exception e)*/
|
||||
{
|
||||
/*String retVal = GetValue(key);
|
||||
MessageBox.Show(e.Message + " - " + key + " = " + retVal);*/
|
||||
}
|
||||
return defVal;
|
||||
}
|
||||
|
||||
private void WriteLog( String log )
|
||||
{
|
||||
if( !m_bSaveLog )
|
||||
return;
|
||||
|
||||
if( m_Log != null )
|
||||
{
|
||||
m_Log.WriteLine( log );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{1631948F-8810-4D6A-97EF-DDD43ABB2210}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>INILoader</RootNamespace>
|
||||
<AssemblyName>INILoader</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="INILoader.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "INILoader", "INILoader.csproj", "{1631948F-8810-4D6A-97EF-DDD43ABB2210}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{1631948F-8810-4D6A-97EF-DDD43ABB2210}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1631948F-8810-4D6A-97EF-DDD43ABB2210}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1631948F-8810-4D6A-97EF-DDD43ABB2210}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1631948F-8810-4D6A-97EF-DDD43ABB2210}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
|
||||
// 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이 특성 값을 변경하십시오.
|
||||
[assembly: AssemblyTitle("INILoader")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("INILoader")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("7fd9ac1a-5edb-44f3-9476-5797988a35e7")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
|
||||
// 지정되도록 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IniLibMultiThreadTest", "IniLibMultiThreadTest\IniLibMultiThreadTest.vcxproj", "{61CA3213-4209-43C7-BDCD-FD4899DE0EBD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{61CA3213-4209-43C7-BDCD-FD4899DE0EBD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{61CA3213-4209-43C7-BDCD-FD4899DE0EBD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{61CA3213-4209-43C7-BDCD-FD4899DE0EBD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{61CA3213-4209-43C7-BDCD-FD4899DE0EBD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,22 @@
|
||||
// IniLibMultiThreadTest.cpp : 콘솔 응용 프로그램에 대한 진입점을 정의합니다.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
const int count = 10;
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
ioINITestThread* testThread = new ioINITestThread[ count ];
|
||||
|
||||
for(int i = 0; i < count; i++)
|
||||
{
|
||||
testThread[i].Begin();
|
||||
}
|
||||
|
||||
cout << "end..." << endl;
|
||||
cin.ignore();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{61CA3213-4209-43C7-BDCD-FD4899DE0EBD}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>IniLibMultiThreadTest</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ioINITestThread.h" />
|
||||
<ClInclude Include="ioThread.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="IniLibMultiThreadTest.cpp" />
|
||||
<ClCompile Include="ioINITestThread.cpp" />
|
||||
<ClCompile Include="ioThread.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="소스 파일">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="헤더 파일">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="리소스 파일">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ioThread.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ioINITestThread.h">
|
||||
<Filter>헤더 파일</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="IniLibMultiThreadTest.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ioThread.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ioINITestThread.cpp">
|
||||
<Filter>소스 파일</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,38 @@
|
||||
========================================================================
|
||||
콘솔 응용 프로그램 : IniLibMultiThreadTest 프로젝트 개요
|
||||
========================================================================
|
||||
|
||||
응용 프로그램 마법사에서 이 IniLibMultiThreadTest 응용 프로그램을 만들었습니다.
|
||||
|
||||
IniLibMultiThreadTest 응용 프로그램을 구성하는 각 파일에 대한
|
||||
요약 설명이 포함되어 있습니다.
|
||||
|
||||
|
||||
IniLibMultiThreadTest.vcxproj
|
||||
응용 프로그램 마법사를 사용하여 생성한 VC++ 프로젝트의 기본 프로젝트 파일입니다.
|
||||
파일을 생성한 Visual C++ 버전에 대한 정보와 응용 프로그램 마법사를 사용하여 선택한 플랫폼,
|
||||
구성 및 프로젝트 기능에 대한 정보가 포함되어 있습니다.
|
||||
|
||||
IniLibMultiThreadTest.vcxproj.filters
|
||||
응용 프로그램 마법사를 사용하여 생성된 VC++ 프로젝트의 필터 파일입니다.
|
||||
이 파일에는 프로젝트의 파일과 필터 간의 연결 정보가 들어 있습니다.
|
||||
이러한 연결은 특정 노드에서 유사한 확장명으로 그룹화된 파일을 표시하기 위해 IDE에서
|
||||
사용됩니다. 예를 들어 ".cpp" 파일은 "소스 파일" 필터와 연결되어 있습니다.
|
||||
|
||||
IniLibMultiThreadTest.cpp
|
||||
기본 응용 프로그램 소스 파일입니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
기타 표준 파일:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
이 파일은 미리 컴파일된 헤더(PCH) 파일 IniLibMultiThreadTest.pch와
|
||||
미리 컴파일된 형식(PCT) 파일 StdAfx.obj를 빌드하는 데 사용됩니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
기타 참고:
|
||||
|
||||
응용 프로그램 마법사에서 사용하는 "TODO:" 주석은 사용자가 추가하거나 사용자 지정해야 하는
|
||||
소스 코드 부분을 나타냅니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
+164140
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,192 @@
|
||||
#include "StdAfx.h"
|
||||
#include "ioINITestThread.h"
|
||||
|
||||
|
||||
ioINITestThread::ioINITestThread(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ioINITestThread::~ioINITestThread(void)
|
||||
{
|
||||
}
|
||||
|
||||
void ioINITestThread::Run()
|
||||
{
|
||||
DWORD time = GetTickCount();
|
||||
|
||||
int value = 0;
|
||||
int temp[ 65535 ] = { 0, };
|
||||
|
||||
// 게임서버 ini파일 로드
|
||||
ioINILoader kLoader;
|
||||
if( kLoader.LoadFile( "config/sp2_monster_treasure_card.ini" ) == false )
|
||||
//if( kLoader.LoadFile( "config/test.ini" ) == false )
|
||||
{
|
||||
cout << "Ini File Read Error... ThreadID : " << GetCurrentThreadId() << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "success.. " << endl;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
char szKey[MAX_PATH], szBuf[MAX_PATH];
|
||||
kLoader.SetTitle( "common" );
|
||||
|
||||
// 선물 리스트
|
||||
int iMaxTable = kLoader.LoadInt( "max_table", 0 );
|
||||
for(i = 0;i < iMaxTable;i++)
|
||||
{
|
||||
sprintf_s( szKey, "table%d", i + 1 );
|
||||
kLoader.SetTitle( szKey );
|
||||
|
||||
// 공용
|
||||
kLoader.LoadString( "present_name", "", szBuf, MAX_PATH );
|
||||
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_state", 0 );
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_ment", 0 );
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_period", 0 );
|
||||
|
||||
int iMaxPresent = kLoader.LoadInt( "max_present", 0 );
|
||||
for(int k = 0;k < iMaxPresent;k++)
|
||||
{
|
||||
sprintf_s( szKey, "present%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_type", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_value1", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_value2", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
// 장비 선물의 기간+강화값 랜덤 리스트
|
||||
kLoader.SetTitle( "common" );
|
||||
iMaxTable = kLoader.LoadInt( "max_extraitem_rand_table", 0 );
|
||||
for(i = 0;i < iMaxTable;i++)
|
||||
{
|
||||
sprintf_s( szKey, "extraitem_rand_table%d", i + 1 );
|
||||
kLoader.SetTitle( szKey );
|
||||
|
||||
int k = 0;
|
||||
int iMaxLimitDate = kLoader.LoadInt( "max_limit_date", 0 );
|
||||
for(k = 0;k < iMaxLimitDate;k++)
|
||||
{
|
||||
sprintf_s( szKey, "limit_date%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "limit_date%d_value", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
|
||||
int iMaxReinforceDate = kLoader.LoadInt( "max_reinforce", 0 );
|
||||
for(k = 0;k < iMaxReinforceDate;k++)
|
||||
{
|
||||
sprintf_s( szKey, "reinforce%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "reinforce%d_value", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
cout << "ThreadID : " << GetCurrentThreadId() << " ";
|
||||
cout << "sp2_monster_treasure_card result : " << GetTickCount() - time << endl;
|
||||
|
||||
cout << endl;
|
||||
}
|
||||
|
||||
void ioINITestThread::Test()
|
||||
{
|
||||
DWORD time = GetTickCount();
|
||||
|
||||
int value = 0;
|
||||
int temp[ 65535 ] = { 0, };
|
||||
|
||||
// 게임서버 ini파일 로드
|
||||
ioINILoader kLoader;
|
||||
if( kLoader.LoadFile( "config/sp2_monster_treasure_card.ini" ) == false )
|
||||
//if( kLoader.LoadFile( "config/test.ini" ) == false )
|
||||
{
|
||||
cout << "Ini File Read Error... ThreadID : " << GetCurrentThreadId() << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "success.. " << endl;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
char szKey[MAX_PATH], szBuf[MAX_PATH];
|
||||
kLoader.SetTitle( "common" );
|
||||
|
||||
// 선물 리스트
|
||||
int iMaxTable = kLoader.LoadInt( "max_table", 0 );
|
||||
for(i = 0;i < iMaxTable;i++)
|
||||
{
|
||||
sprintf_s( szKey, "table%d", i + 1 );
|
||||
kLoader.SetTitle( szKey );
|
||||
|
||||
// 공용
|
||||
kLoader.LoadString( "present_name", "", szBuf, MAX_PATH );
|
||||
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_state", 0 );
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_ment", 0 );
|
||||
temp[ value++ ] = kLoader.LoadInt( "present_period", 0 );
|
||||
|
||||
int iMaxPresent = kLoader.LoadInt( "max_present", 0 );
|
||||
for(int k = 0;k < iMaxPresent;k++)
|
||||
{
|
||||
sprintf_s( szKey, "present%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_type", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_value1", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "present%d_value2", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
// 장비 선물의 기간+강화값 랜덤 리스트
|
||||
kLoader.SetTitle( "common" );
|
||||
iMaxTable = kLoader.LoadInt( "max_extraitem_rand_table", 0 );
|
||||
for(i = 0;i < iMaxTable;i++)
|
||||
{
|
||||
sprintf_s( szKey, "extraitem_rand_table%d", i + 1 );
|
||||
kLoader.SetTitle( szKey );
|
||||
|
||||
int k = 0;
|
||||
int iMaxLimitDate = kLoader.LoadInt( "max_limit_date", 0 );
|
||||
for(k = 0;k < iMaxLimitDate;k++)
|
||||
{
|
||||
sprintf_s( szKey, "limit_date%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "limit_date%d_value", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
|
||||
int iMaxReinforceDate = kLoader.LoadInt( "max_reinforce", 0 );
|
||||
for(k = 0;k < iMaxReinforceDate;k++)
|
||||
{
|
||||
sprintf_s( szKey, "reinforce%d_rand", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
|
||||
sprintf_s( szKey, "reinforce%d_value", k + 1 );
|
||||
temp[ value++ ] = kLoader.LoadInt( szKey, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
cout << "ThreadID : " << GetCurrentThreadId() << " ";
|
||||
cout << "sp2_monster_treasure_card result : " << GetTickCount() - time << endl;
|
||||
|
||||
cout << endl;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
class ioINITestThread : public ioThread
|
||||
{
|
||||
public:
|
||||
ioINITestThread(void);
|
||||
~ioINITestThread(void);
|
||||
|
||||
public:
|
||||
void Run();
|
||||
|
||||
public:
|
||||
void Test();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "StdAfx.h"
|
||||
#include "ioThread.h"
|
||||
|
||||
|
||||
ioThread::ioThread(void) : m_hThread(0L), m_threadID(0)
|
||||
{
|
||||
}
|
||||
|
||||
ioThread::~ioThread(void)
|
||||
{
|
||||
if(m_hThread)
|
||||
{
|
||||
CloseHandle(m_hThread);
|
||||
m_threadID = 0;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned WINAPI ioThread::HandleRunner(LPVOID parameter)
|
||||
{
|
||||
ioThread *pThread = (ioThread *)parameter;
|
||||
if(pThread == NULL)
|
||||
return 0;
|
||||
|
||||
pThread->Run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL ioThread::Begin()
|
||||
{
|
||||
HANDLE threadHandle = reinterpret_cast<HANDLE>( _beginthreadex(
|
||||
NULL,
|
||||
0,
|
||||
HandleRunner,
|
||||
this,
|
||||
0,
|
||||
&m_threadID ));
|
||||
if(!threadHandle)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
m_hThread = threadHandle;
|
||||
|
||||
return (m_hThread == 0) ? FALSE : TRUE;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
class ioThread
|
||||
{
|
||||
public:
|
||||
ioThread(void);
|
||||
virtual ~ioThread(void);
|
||||
|
||||
private:
|
||||
static unsigned WINAPI HandleRunner(LPVOID parameter);
|
||||
UINT m_threadID;
|
||||
|
||||
protected:
|
||||
HANDLE m_hThread;
|
||||
BOOL m_threadStart;
|
||||
|
||||
public:
|
||||
virtual void Run() = 0; //상속 받은 클래스가 구현한다.
|
||||
|
||||
public:
|
||||
DWORD GetThread() { return m_threadID; }
|
||||
BOOL Begin();
|
||||
|
||||
BOOL IsStart() const { return m_threadStart; }
|
||||
void SetStart(const BOOL state) { m_threadStart = state; }
|
||||
};
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : 표준 포함 파일만 들어 있는 소스 파일입니다.
|
||||
// IniLibMultiThreadTest.pch는 미리 컴파일된 헤더가 됩니다.
|
||||
// stdafx.obj에는 미리 컴파일된 형식 정보가 포함됩니다.
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: 필요한 추가 헤더는
|
||||
// 이 파일이 아닌 STDAFX.H에서 참조합니다.
|
||||
@@ -0,0 +1,27 @@
|
||||
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
|
||||
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
|
||||
// 들어 있는 포함 파일입니다.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
|
||||
// TODO: 프로그램에 필요한 추가 헤더는 여기에서 참조합니다.
|
||||
#include <process.h>
|
||||
#include <Windows.h>
|
||||
#include "ioThread.h"
|
||||
#include "ioINITestThread.h"
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "E:\svn\New_SP2\trunk\programming\src\include\common.h"
|
||||
|
||||
#include "E:\svn\New_SP2\trunk\programming\src\ioINILoader\ioINILoader.h"
|
||||
#pragma comment( lib, "E:\\svn\\New_SP2\\trunk\\programming\\lib\\inid.lib" )
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// SDKDDKVer.h를 포함하면 최고 수준의 가용성을 가진 Windows 플랫폼이 정의됩니다.
|
||||
|
||||
// 이전 Windows 플랫폼에 대해 응용 프로그램을 빌드하려는 경우에는 SDKDDKVer.h를 포함하기 전에
|
||||
// WinSDKVer.h를 포함하고 _WIN32_WINNT 매크로를 지원하려는 플랫폼으로 설정하십시오.
|
||||
|
||||
#include <SDKDDKVer.h>
|
||||
File diff suppressed because it is too large.
Load diff
Generated
+199
@@ -0,0 +1,199 @@
|
||||
namespace ItemDictionary
|
||||
{
|
||||
partial class ItemDictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// 필수 디자이너 변수입니다.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 사용 중인 모든 리소스를 정리합니다.
|
||||
/// </summary>
|
||||
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form 디자이너에서 생성한 코드
|
||||
|
||||
/// <summary>
|
||||
/// 디자이너 지원에 필요한 메서드입니다.
|
||||
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ItemDictionary));
|
||||
this.imagetreeView = new System.Windows.Forms.TreeView();
|
||||
this.item_grideView = new System.Windows.Forms.DataGridView();
|
||||
this.pack_textBox = new System.Windows.Forms.TextBox();
|
||||
this.desc_textBox = new System.Windows.Forms.TextBox();
|
||||
this.TextureBox = new System.Windows.Forms.PictureBox();
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.search_Label = new System.Windows.Forms.ToolStripLabel();
|
||||
this.search_TextBox = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.custom_desc_textBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.item_grideView)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.TextureBox)).BeginInit();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// imagetreeView
|
||||
//
|
||||
this.imagetreeView.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.imagetreeView.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
this.imagetreeView.HideSelection = false;
|
||||
this.imagetreeView.Location = new System.Drawing.Point(10, 40);
|
||||
this.imagetreeView.Name = "imagetreeView";
|
||||
this.imagetreeView.Size = new System.Drawing.Size(410, 512);
|
||||
this.imagetreeView.TabIndex = 1;
|
||||
this.imagetreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.ImageTree_AfterSelect);
|
||||
//
|
||||
// item_grideView
|
||||
//
|
||||
this.item_grideView.AllowUserToAddRows = false;
|
||||
this.item_grideView.AllowUserToDeleteRows = false;
|
||||
this.item_grideView.AllowUserToResizeColumns = false;
|
||||
this.item_grideView.AllowUserToResizeRows = false;
|
||||
this.item_grideView.BackgroundColor = System.Drawing.SystemColors.Window;
|
||||
this.item_grideView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.item_grideView.Location = new System.Drawing.Point(10, 560);
|
||||
this.item_grideView.MultiSelect = false;
|
||||
this.item_grideView.Name = "item_grideView";
|
||||
this.item_grideView.ReadOnly = true;
|
||||
this.item_grideView.RowTemplate.Height = 23;
|
||||
this.item_grideView.Size = new System.Drawing.Size(1280, 380);
|
||||
this.item_grideView.TabIndex = 2;
|
||||
this.item_grideView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.item_CellMouseClick);
|
||||
//
|
||||
// pack_textBox
|
||||
//
|
||||
this.pack_textBox.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.pack_textBox.Location = new System.Drawing.Point(950, 40);
|
||||
this.pack_textBox.Name = "pack_textBox";
|
||||
this.pack_textBox.ReadOnly = true;
|
||||
this.pack_textBox.Size = new System.Drawing.Size(340, 21);
|
||||
this.pack_textBox.TabIndex = 3;
|
||||
//
|
||||
// desc_textBox
|
||||
//
|
||||
this.desc_textBox.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.desc_textBox.Location = new System.Drawing.Point(950, 70);
|
||||
this.desc_textBox.Multiline = true;
|
||||
this.desc_textBox.Name = "desc_textBox";
|
||||
this.desc_textBox.ReadOnly = true;
|
||||
this.desc_textBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.desc_textBox.Size = new System.Drawing.Size(340, 420);
|
||||
this.desc_textBox.TabIndex = 5;
|
||||
//
|
||||
// TextureBox
|
||||
//
|
||||
this.TextureBox.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.TextureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.TextureBox.Location = new System.Drawing.Point(430, 40);
|
||||
this.TextureBox.Name = "TextureBox";
|
||||
this.TextureBox.Size = new System.Drawing.Size(512, 512);
|
||||
this.TextureBox.TabIndex = 0;
|
||||
this.TextureBox.TabStop = false;
|
||||
this.TextureBox.Click += new System.EventHandler(this.TextureBox_Click);
|
||||
//
|
||||
// toolStrip1
|
||||
//
|
||||
this.toolStrip1.AutoSize = false;
|
||||
this.toolStrip1.BackColor = System.Drawing.SystemColors.ActiveCaption;
|
||||
this.toolStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
||||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.search_Label,
|
||||
this.search_TextBox});
|
||||
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.toolStrip1.Name = "toolStrip1";
|
||||
this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
|
||||
this.toolStrip1.Size = new System.Drawing.Size(1301, 35);
|
||||
this.toolStrip1.TabIndex = 10;
|
||||
this.toolStrip1.Text = "toolStrip1";
|
||||
//
|
||||
// search_Label
|
||||
//
|
||||
this.search_Label.Name = "search_Label";
|
||||
this.search_Label.Size = new System.Drawing.Size(34, 32);
|
||||
this.search_Label.Text = "검색:";
|
||||
//
|
||||
// search_TextBox
|
||||
//
|
||||
this.search_TextBox.AutoToolTip = true;
|
||||
this.search_TextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.search_TextBox.Name = "search_TextBox";
|
||||
this.search_TextBox.Size = new System.Drawing.Size(200, 35);
|
||||
this.search_TextBox.ToolTipText = "입력후 엔터를 쳐주세요.";
|
||||
this.search_TextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.search_TextBox_KeyDown);
|
||||
//
|
||||
// custom_desc_textBox
|
||||
//
|
||||
this.custom_desc_textBox.Location = new System.Drawing.Point(950, 530);
|
||||
this.custom_desc_textBox.Name = "custom_desc_textBox";
|
||||
this.custom_desc_textBox.Size = new System.Drawing.Size(340, 21);
|
||||
this.custom_desc_textBox.TabIndex = 11;
|
||||
this.custom_desc_textBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.refresh_custom_desc);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(950, 510);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(41, 12);
|
||||
this.label1.TabIndex = 12;
|
||||
this.label1.Text = "검색어";
|
||||
//
|
||||
// ItemDictionary
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1301, 952);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.custom_desc_textBox);
|
||||
this.Controls.Add(this.toolStrip1);
|
||||
this.Controls.Add(this.TextureBox);
|
||||
this.Controls.Add(this.desc_textBox);
|
||||
this.Controls.Add(this.pack_textBox);
|
||||
this.Controls.Add(this.item_grideView);
|
||||
this.Controls.Add(this.imagetreeView);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.ImeMode = System.Windows.Forms.ImeMode.Hangul;
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "ItemDictionary";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "로스트사가 아이템 사전";
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.Shown += new System.EventHandler(this.Form1_Shown);
|
||||
((System.ComponentModel.ISupportInitialize)(this.item_grideView)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.TextureBox)).EndInit();
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TreeView imagetreeView;
|
||||
private System.Windows.Forms.DataGridView item_grideView;
|
||||
private System.Windows.Forms.TextBox pack_textBox;
|
||||
private System.Windows.Forms.TextBox desc_textBox;
|
||||
private System.Windows.Forms.PictureBox TextureBox;
|
||||
private System.Windows.Forms.ToolStrip toolStrip1;
|
||||
private System.Windows.Forms.ToolStripTextBox search_TextBox;
|
||||
private System.Windows.Forms.ToolStripLabel search_Label;
|
||||
private System.Windows.Forms.TextBox custom_desc_textBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,481 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using S16.Drawing;
|
||||
using XMLLoader;
|
||||
using System.Xml;
|
||||
using INILoader;
|
||||
|
||||
namespace ItemDictionary
|
||||
{
|
||||
public partial class ItemDictionary : Form
|
||||
{
|
||||
String main_path;
|
||||
String cur_pack;
|
||||
List<ItemData> item_data_list;
|
||||
List<PackData> icon_pack_list;
|
||||
List<ItemCustomData> item_custom_list;
|
||||
|
||||
private xmlLoader m_xmlLoader;
|
||||
|
||||
public ItemDictionary()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.SetStyle( ControlStyles.OptimizedDoubleBuffer, true );
|
||||
|
||||
icon_pack_list = new List<PackData>();
|
||||
|
||||
INILoader.INILoader loader = new INILoader.INILoader("./ItemDictionary.ini", false);
|
||||
loader.SetTitle("path");
|
||||
main_path = loader.LoadString( "path", "" );
|
||||
|
||||
m_xmlLoader = new xmlLoader(String.Format("{0}/XML/uiimageset.xml", main_path ) );
|
||||
|
||||
LoadData();
|
||||
|
||||
imagetreeView.SuspendLayout();
|
||||
XmlElement element = m_xmlLoader.GetElement();
|
||||
foreach (XmlNode ImageSetNode in element.ChildNodes)
|
||||
{
|
||||
if (ImageSetNode.Name == "#comment")
|
||||
continue;
|
||||
|
||||
ImageTreeNode node = new ImageTreeNode( "Imageset",
|
||||
"",
|
||||
ImageSetNode.Attributes["Name"].Value,
|
||||
ImageSetNode.Attributes["File"].Value,
|
||||
0, 0, 0, 0, 0, 0 );
|
||||
imagetreeView.Nodes.Add( node );
|
||||
|
||||
String set_name = ImageSetNode.Attributes["Name"].Value.ToString();
|
||||
|
||||
foreach( XmlNode ImageNode in ImageSetNode.ChildNodes )
|
||||
{
|
||||
if (ImageNode.Name == "#comment")
|
||||
continue;
|
||||
int offsetX = 0;
|
||||
int offsetY = 0;
|
||||
foreach ( XmlAttribute att in ImageNode.Attributes )
|
||||
{
|
||||
if( att.Name == "OffsetX" )
|
||||
offsetX = Int32.Parse( att.Value );
|
||||
else if( att.Name == "OffsetY" )
|
||||
offsetY = Int32.Parse( att.Value );
|
||||
}
|
||||
|
||||
String pack_name = String.Format( "{0}#{1}", set_name, ImageNode.Attributes["Name"].Value );
|
||||
ImageTreeNode child_node = new ImageTreeNode( "Image",
|
||||
pack_name,
|
||||
ImageNode.Attributes["Name"].Value,
|
||||
ImageSetNode.Attributes["File"].Value,
|
||||
Int32.Parse( ImageNode.Attributes["X"].Value ),
|
||||
Int32.Parse( ImageNode.Attributes["Y"].Value ),
|
||||
Int32.Parse( ImageNode.Attributes["Width"].Value ),
|
||||
Int32.Parse( ImageNode.Attributes["Height"].Value ),
|
||||
offsetX,
|
||||
offsetY );
|
||||
|
||||
node.Nodes.Add( child_node );
|
||||
|
||||
PackData data;
|
||||
data.file = ImageSetNode.Attributes["File"].Value.ToString();
|
||||
data.pack = pack_name;
|
||||
data.x = Int32.Parse( ImageNode.Attributes["X"].Value );
|
||||
data.y = Int32.Parse( ImageNode.Attributes["Y"].Value );
|
||||
data.width = Int32.Parse( ImageNode.Attributes["Width"].Value );
|
||||
data.height = Int32.Parse( ImageNode.Attributes["Height"].Value );
|
||||
data.offset_x = offsetX;
|
||||
data.offset_y = offsetY;
|
||||
icon_pack_list.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
imagetreeView.Sort();
|
||||
|
||||
imagetreeView.ResumeLayout(false);
|
||||
}
|
||||
|
||||
private void RefreshTextureBox( String _path )
|
||||
{
|
||||
if( Path.GetExtension(_path) != ".dds" )
|
||||
return;
|
||||
|
||||
String path = String.Format( "{0}/resource/texture/{1}", main_path, _path );
|
||||
if (File.Exists(path) == false)
|
||||
{
|
||||
TextureBox.Image = null;
|
||||
return;
|
||||
}
|
||||
|
||||
TextureBox.Image = null;
|
||||
|
||||
DDSImage image = new DDSImage(File.ReadAllBytes(path));
|
||||
if( image.BitmapImage.Width > 512 || image.BitmapImage.Height > 512 )
|
||||
{
|
||||
TextureBox.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
TextureBox.Image = image.BitmapImage;
|
||||
}
|
||||
else
|
||||
{
|
||||
TextureBox.SizeMode = PictureBoxSizeMode.Normal;
|
||||
TextureBox.Image = image.BitmapImage;
|
||||
}
|
||||
}
|
||||
|
||||
private void TextureBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
if( String.IsNullOrEmpty(cur_pack) )
|
||||
return;
|
||||
|
||||
MouseEventArgs me = e as MouseEventArgs;
|
||||
Point pos = me.Location;
|
||||
foreach ( PackData data in icon_pack_list )
|
||||
{
|
||||
|
||||
if( data.file != cur_pack )
|
||||
continue;
|
||||
|
||||
Rectangle rec = new Rectangle( data.x, data.y, data.width, data.height );
|
||||
if( rec.Contains(pos) )
|
||||
{
|
||||
RefreshTextureBox(cur_pack);
|
||||
|
||||
Graphics g = Graphics.FromImage(TextureBox.Image);
|
||||
|
||||
Pen pen = new Pen(Color.Red, 2);
|
||||
g.DrawRectangle(pen, data.x, data.y, data.width, data.height);
|
||||
|
||||
//MessageBox.Show( data.pack );
|
||||
|
||||
String[] token = data.pack.Split('#');
|
||||
FocusTreeViewNode( token[0], token[1] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ImageTree_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
TreeView tree = (TreeView)sender;
|
||||
|
||||
if (tree.SelectedNode.Parent == null)
|
||||
{
|
||||
ImageTreeNode node = tree.SelectedNode as ImageTreeNode;
|
||||
RefreshTextureBox( node.file );
|
||||
SetDesc("");
|
||||
cur_pack = node.file;
|
||||
}
|
||||
else
|
||||
{
|
||||
ImageTreeNode parent_node = tree.SelectedNode.Parent as ImageTreeNode;
|
||||
ImageTreeNode node = tree.SelectedNode as ImageTreeNode;
|
||||
SetDesc(node.pack_name);
|
||||
|
||||
PackData data = icon_pack_list.Find( p => p.pack == node.pack_name );
|
||||
|
||||
RefreshTextureBox( data.file );
|
||||
Graphics g = Graphics.FromImage(TextureBox.Image);
|
||||
|
||||
Pen pen = new Pen(Color.Red, 2);
|
||||
g.DrawRectangle(pen, data.x, data.y, data.width, data.height);
|
||||
|
||||
cur_pack = parent_node.file;
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
if( item_data_list == null )
|
||||
item_data_list = new List<ItemData>();
|
||||
else
|
||||
item_data_list.Clear();
|
||||
|
||||
LoadItemData();
|
||||
LoadExtraItemData();
|
||||
LoadSkillData();
|
||||
LoadMedalData();
|
||||
LoadQuestData();
|
||||
LoadEtcItemData();
|
||||
LoadCostumeData();
|
||||
LoadAccessoryData();
|
||||
LoadDecoManData();
|
||||
LoadDecoWomanData();
|
||||
LoadCustomDesc();
|
||||
|
||||
/*StreamWriter sw = new StreamWriter("test.txt");
|
||||
foreach( ItemData data in item_data_list )
|
||||
{
|
||||
String line = String.Format( "{0},{1},{2},{3}", data.pack_name, data.name, data.desc, "" );
|
||||
sw.WriteLine(line);
|
||||
}
|
||||
sw.Close();*/
|
||||
|
||||
item_grideView.SuspendLayout();
|
||||
item_grideView.RowHeadersVisible = false;
|
||||
item_grideView.Rows.Clear();
|
||||
item_grideView.Columns.Add("pack", "팩");
|
||||
item_grideView.Columns.Add("type", "타입");
|
||||
item_grideView.Columns.Add("name", "이름");
|
||||
item_grideView.Columns.Add("desc", "설명");
|
||||
item_grideView.ResumeLayout(false);
|
||||
}
|
||||
|
||||
private void SetGridView( List<ItemData> list )
|
||||
{
|
||||
item_grideView.SuspendLayout();
|
||||
item_grideView.Rows.Clear();
|
||||
|
||||
foreach (ItemData data in list)
|
||||
{
|
||||
DataGridViewRow r = item_grideView.Rows[item_grideView.Rows.Add(new DataGridViewRow())];
|
||||
r.Cells["pack"].Value = data.pack_name;
|
||||
r.Cells["type"].Value = data.type;
|
||||
r.Cells["name"].Value = data.name;
|
||||
r.Cells["desc"].Value = data.desc;
|
||||
}
|
||||
|
||||
item_grideView.AutoResizeColumns();
|
||||
item_grideView.ResumeLayout(false);
|
||||
}
|
||||
|
||||
private void FocusTreeViewNode( String value1, String value2 )
|
||||
{
|
||||
if( String.IsNullOrEmpty(value2) )
|
||||
{
|
||||
TreeNode[] node = imagetreeView.Nodes.Find(value1, false);
|
||||
if (node.Length > 0)
|
||||
{
|
||||
imagetreeView.SelectedNode = node[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode[] parent_node = imagetreeView.Nodes.Find(value1, false);
|
||||
if (parent_node.Length > 0)
|
||||
{
|
||||
TreeNode[] node = parent_node[0].Nodes.Find(value2, false);
|
||||
if (node.Length > 0)
|
||||
{
|
||||
imagetreeView.SelectedNode = node[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void item_CellMouseClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if( e.RowIndex < 0 )
|
||||
return;
|
||||
|
||||
DataGridViewCell cell = (DataGridViewCell)item_grideView.Rows[e.RowIndex].Cells["pack"];
|
||||
PackData data = icon_pack_list.Find( p => p.pack == cell.Value.ToString() );
|
||||
|
||||
if( String.IsNullOrEmpty(data.pack) )
|
||||
{
|
||||
MessageBox.Show("!?");
|
||||
return;
|
||||
}
|
||||
|
||||
RefreshTextureBox( data.file );
|
||||
if( !String.IsNullOrEmpty(data.pack) )
|
||||
{
|
||||
Graphics g = Graphics.FromImage(TextureBox.Image);
|
||||
|
||||
Pen pen = new Pen(Color.Red, 2);
|
||||
g.DrawRectangle(pen, data.x, data.y, data.width, data.height);
|
||||
|
||||
SetDesc(data.pack);
|
||||
|
||||
String[] token = data.pack.Split('#');
|
||||
if( token.Length == 1 )
|
||||
{
|
||||
FocusTreeViewNode( token[0], "" );
|
||||
|
||||
}
|
||||
else if( token.Length == 2 )
|
||||
{
|
||||
FocusTreeViewNode( token[0], token[1] );
|
||||
}
|
||||
|
||||
cur_pack = data.file;
|
||||
}
|
||||
}
|
||||
|
||||
private void search_TextBox_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if( e.KeyCode != Keys.Return )
|
||||
return;
|
||||
|
||||
if (String.IsNullOrEmpty(search_TextBox.Text))
|
||||
return;
|
||||
|
||||
List<ItemData> list = new List<ItemData>();
|
||||
|
||||
foreach (ItemData data in item_data_list)
|
||||
{
|
||||
if (data.name.Contains(search_TextBox.Text))
|
||||
{
|
||||
list.Add(data);
|
||||
}
|
||||
else if (data.desc.Contains(search_TextBox.Text))
|
||||
{
|
||||
list.Add(data);
|
||||
}
|
||||
else if (data.type.Contains(search_TextBox.Text))
|
||||
{
|
||||
list.Add(data);
|
||||
}
|
||||
else if( Regex.IsMatch(data.pack_name, search_TextBox.Text, RegexOptions.IgnoreCase) )
|
||||
{
|
||||
list.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
String search_pack_name = String.Empty;
|
||||
foreach (ItemCustomData data in item_custom_list)
|
||||
{
|
||||
if (data.desc.Contains(search_TextBox.Text))
|
||||
{
|
||||
search_pack_name = data.pack_name;
|
||||
}
|
||||
|
||||
if (!String.IsNullOrEmpty(search_pack_name))
|
||||
{
|
||||
ItemData item_data = list.Find(p => p.pack_name == search_pack_name);
|
||||
if (String.IsNullOrEmpty(item_data.pack_name))
|
||||
{
|
||||
ItemData temp = new ItemData();
|
||||
temp.pack_name = search_pack_name;
|
||||
list.Add(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (PackData data in icon_pack_list)
|
||||
{
|
||||
|
||||
if (Regex.IsMatch(data.pack, search_TextBox.Text, RegexOptions.IgnoreCase))
|
||||
{
|
||||
ItemData item_data = list.Find(p => p.pack_name == data.pack);
|
||||
if (String.IsNullOrEmpty(item_data.pack_name))
|
||||
{
|
||||
ItemData temp = new ItemData();
|
||||
temp.pack_name = data.pack;
|
||||
list.Add(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (list.Count > 0)
|
||||
{
|
||||
SetGridView(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show( "검색결과가 없습니다.", "검색실패", MessageBoxButtons.OK, MessageBoxIcon.Information );
|
||||
}
|
||||
}
|
||||
|
||||
private void refresh_custom_desc(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode != Keys.Return)
|
||||
return;
|
||||
|
||||
if (String.IsNullOrEmpty(pack_textBox.Text))
|
||||
return;
|
||||
|
||||
bool is_refresh = false;
|
||||
for( int i=0; i<item_custom_list.Count; ++i )
|
||||
{
|
||||
if( item_custom_list[i].pack_name == pack_textBox.Text )
|
||||
{
|
||||
ItemCustomData data;
|
||||
data.pack_name = pack_textBox.Text;
|
||||
data.desc = custom_desc_textBox.Text;
|
||||
item_custom_list[i] = data;
|
||||
is_refresh = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( !is_refresh && !String.IsNullOrEmpty(custom_desc_textBox.Text) )
|
||||
{
|
||||
ItemCustomData data;
|
||||
data.pack_name = pack_textBox.Text;
|
||||
data.desc = custom_desc_textBox.Text;
|
||||
item_custom_list.Add(data);
|
||||
}
|
||||
|
||||
SaveCustomDesc();
|
||||
}
|
||||
|
||||
private void Form1_Shown(object sender, EventArgs e)
|
||||
{
|
||||
search_TextBox.Focus();
|
||||
}
|
||||
|
||||
private void SetDesc( String pack_name )
|
||||
{
|
||||
PackData data = icon_pack_list.Find( p => p.pack == pack_name );
|
||||
|
||||
pack_textBox.Clear();
|
||||
desc_textBox.Clear();
|
||||
|
||||
if( !String.IsNullOrEmpty(data.pack) )
|
||||
{
|
||||
pack_textBox.Text = data.pack;
|
||||
|
||||
String info = String.Format("[이미지정보]{0}",Environment.NewLine);
|
||||
info += String.Format("위치 : {0}, {1}{2}", data.x, data.y, Environment.NewLine);
|
||||
info += String.Format("크기 : {0}*{1}{2}", data.width, data.height, Environment.NewLine);
|
||||
info += String.Format("옵셋 : {0}, {1}", data.offset_x, data.offset_y);
|
||||
desc_textBox.Text = info;
|
||||
|
||||
int add_count = 0;
|
||||
List<ItemData> item_datas = item_data_list.FindAll( p => p.pack_name == pack_name );
|
||||
foreach( ItemData item_data in item_datas )
|
||||
{
|
||||
String desc = String.Format( "{0} / {1} 아이콘{2}{3}{4}", item_data.name, item_data.type, Environment.NewLine, Environment.NewLine, item_data.desc );
|
||||
desc_textBox.Text += Environment.NewLine;
|
||||
desc_textBox.Text += Environment.NewLine;
|
||||
desc_textBox.Text += "------------------------------------------------";
|
||||
desc_textBox.Text += Environment.NewLine;
|
||||
desc_textBox.Text += desc;
|
||||
add_count++;
|
||||
if( add_count >= 10 )
|
||||
{
|
||||
desc_textBox.Text += Environment.NewLine;
|
||||
desc_textBox.Text += Environment.NewLine;
|
||||
desc_textBox.Text += "------------------------------------------------";
|
||||
desc_textBox.Text += Environment.NewLine;
|
||||
desc_textBox.Text += String.Format( "사용하는 위치가 너무 많아 검색을 종료합니다." );
|
||||
desc_textBox.Text += Environment.NewLine;
|
||||
desc_textBox.Text += String.Format( "총 사용량 {0}건.", item_datas.Count );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ItemCustomData custom_data = item_custom_list.Find( p => p.pack_name == pack_name );
|
||||
if( !String.IsNullOrEmpty(custom_data.pack_name) )
|
||||
{
|
||||
custom_desc_textBox.Text = custom_data.desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
custom_desc_textBox.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAIAEBAAAAAAIABoBAAAJgAAACAgAAAAACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAEAE
|
||||
AAAAAAAAAAAAAAAAAAAAAAAA////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wEAAAD/AAAA/wAAAP////8B////Af///wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/////AQAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP//////AAAA/wAAAP////8B////Af///wH///8B////AQAAAP8AAAD//////wAA
|
||||
AP8AAAD/AAAA//////8AAAD//////wAAAP8AAAD/AAAA/////wH///8B////Af///wEAAAD/AAAA////
|
||||
//8/Pz//AAAA/z8/P///////AAAA////////////AAAA/wAAAP////8B////Af///wH///8BAAAA/wAA
|
||||
AP8/Pz///////39/f///////Pz8//wAAAP//////AAAA/wAAAP8AAAD/////Af///wH///8B////AQAA
|
||||
AEEAAAD/AAAA/z8/P///////Pz8//wAAAP8AAAD//////wAAAP8AAAD/////Af///wEAAABBAAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wEAAABBAAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////AQAAAP8AAAD/AAAA/////wH///8BAAAA/wAA
|
||||
AP8/Pz////////////8/Pz//AAAA//////8AAAD/AAAA/////wH///8B////Af///wH///8B////AQAA
|
||||
AP8AAAD//////z8/P/8/Pz///////wAAAP//////AAAA/wAAAP8AAAD/////Af///wH///8B////Af//
|
||||
/wEAAAD/AAAA//////8AAAD/AAAA//////8AAAD///////////8AAAD/AAAA/////wH///8B////Af//
|
||||
/wH///8BAAAA/wAAAP//////Pz8//z8/P///////AAAA//////8AAAD/AAAA/wAAAP////8B////Af//
|
||||
/wH///8B////AQAAAP8AAAD/Pz8/////////////Pz8//wAAAP//////AAAA/wAAAP////8B////Af//
|
||||
/wH///8B////Af///wEAAABBAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////Af//
|
||||
/wH///8B////Af///wH///8B////AQAAAEEAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////Af//
|
||||
/wH///8B////Af///wH///8B////AQAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
|
||||
//8AAP//AAD//wAA//8AAP//AAD//wAA//8oAAAAIAAAAEAAAAABACAAAAAAAIAQAAAAAAAAAAAAAAAA
|
||||
AAAAAAAA////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wH///8B////AQAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA////
|
||||
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wEAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP////8B////AQAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////AQAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wH///8BAAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////AQAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP///////////wAAAP8AAAD/AAAA/wAAAP////8B////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA////////////AAAA/wAAAP8AAAD/AAAA/////wH///8B////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wEAAAD/AAAA/wAAAP8AAAD///////////8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP///////////wAAAP8AAAD///////////8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP////8B////Af///wH///8B////Af///wH///8B////AQAAAP8AAAD/AAAA/wAAAP///////////wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA////////////AAAA/wAAAP///////////wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/////wH///8B////Af///wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA////
|
||||
////////AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD///////////8AAAD/AAAA////////////////////
|
||||
//8AAAD/AAAA/wAAAP8AAAD/////Af///wH///8B////Af///wH///8B////Af///wEAAAD/AAAA/wAA
|
||||
AP8AAAD/////////////////AAAA/wAAAP8AAAD/AAAA/////////////////wAAAP8AAAD/////////
|
||||
/////////////wAAAP8AAAD/AAAA/wAAAP////8B////Af///wH///8B////Af///wH///8B////AQAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/////////////////AAAA/wAAAP////////////////8AAAD/AAAA/wAA
|
||||
AP///////////wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wH///8B////Af///wH///8B////Af//
|
||||
/wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////////////////////////////////AAAA/wAA
|
||||
AP8AAAD/AAAA////////////AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD//////////////////////wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD///////////8AAAD/AAAA/wAAAP8AAAD/////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////////
|
||||
//8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP///////////wAAAP8AAAD/AAAA/wAAAP////8B////Af//
|
||||
/wH///8B////Af///wEAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA////
|
||||
/wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/////Af///wH///8B////AQAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wH///8BAAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/////Af///wH///8B////Af///wEAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////Af///wEAAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP////8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////////
|
||||
/////////////wAAAP8AAAD/AAAA/wAAAP///////////wAAAP8AAAD/AAAA/wAAAP////8B////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wEAAAD/AAAA/wAAAP8AAAD/AAAA////
|
||||
/////////////////////////////wAAAP8AAAD/AAAA////////////AAAA/wAAAP8AAAD/AAAA////
|
||||
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AQAAAP8AAAD/AAAA/wAA
|
||||
AP////////////////8AAAD/AAAA/////////////////wAAAP8AAAD///////////8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP////8B////Af///wH///8B////Af///wH///8B////Af///wH///8BAAAA/wAA
|
||||
AP8AAAD/AAAA////////////AAAA/wAAAP8AAAD/AAAA////////////AAAA/wAAAP///////////wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wEAAAD/AAAA/wAAAP8AAAD///////////8AAAD/AAAA/wAAAP8AAAD///////////8AAAD/AAAA////
|
||||
//////////////////8AAAD/AAAA/wAAAP8AAAD/////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////AQAAAP8AAAD/AAAA/wAAAP///////////wAAAP8AAAD/AAAA/wAAAP///////////wAA
|
||||
AP8AAAD//////////////////////wAAAP8AAAD/AAAA/wAAAP////8B////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA////////////AAAA/wAAAP8AAAD/AAAA////
|
||||
////////AAAA/wAAAP///////////wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/////wH///8B////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wEAAAD/AAAA/wAAAP8AAAD/////////////////AAAA/wAA
|
||||
AP////////////////8AAAD/AAAA////////////AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wH///8B////AQAAAP8AAAD/AAAA/wAAAP8AAAD/////////
|
||||
////////////////////////AAAA/wAAAP8AAAD///////////8AAAD/AAAA/wAAAP8AAAD/////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD//////////////////////wAAAP8AAAD/AAAA/wAAAP///////////wAAAP8AAAD/AAAA/wAA
|
||||
AP////8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BAAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/////wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8B////Af///wH///8BAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
|
||||
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP////8B////Af///wH///8B////Af///wH///8B////Af//
|
||||
/wH///8B////Af///wH///8B////AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ItemDictionary
|
||||
{
|
||||
public class ImageTreeNode : System.Windows.Forms.TreeNode
|
||||
{
|
||||
public String type;
|
||||
public String pack_name;
|
||||
public String name;
|
||||
public String file;
|
||||
public int x;
|
||||
public int y;
|
||||
public int width;
|
||||
public int height;
|
||||
public int offset_x;
|
||||
public int offset_y;
|
||||
|
||||
public ImageTreeNode() { }
|
||||
public ImageTreeNode(String _type, String _pack_name, String _name, String _file, int _x, int _y, int _width, int _height, int _offset_x, int _offset_y)
|
||||
: base(_name)
|
||||
{
|
||||
pack_name = _pack_name;
|
||||
Name = _name;
|
||||
type = _type;
|
||||
name = _name;
|
||||
file = _file;
|
||||
x = _x;
|
||||
y = _y;
|
||||
width = _width;
|
||||
height = _height;
|
||||
offset_x = _offset_x;
|
||||
offset_y = _offset_y;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ItemData
|
||||
{
|
||||
public String pack_name;
|
||||
public String type;
|
||||
public String name;
|
||||
public String desc;
|
||||
public int item_code;
|
||||
}
|
||||
|
||||
public struct ItemCustomData
|
||||
{
|
||||
public String pack_name;
|
||||
public String desc;
|
||||
}
|
||||
|
||||
public struct PackData
|
||||
{
|
||||
public String file;
|
||||
public String pack;
|
||||
public int x;
|
||||
public int y;
|
||||
public int width;
|
||||
public int height;
|
||||
public int offset_x;
|
||||
public int offset_y;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{B7A14EA6-505A-4EDD-9792-D68A82071E04}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ItemDictionary</RootNamespace>
|
||||
<AssemblyName>ItemDictionary</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\icon32x32.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="INILoader">
|
||||
<HintPath>.\INILoader.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DDSImage.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ItemData.cs" />
|
||||
<Compile Include="LoadData.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="xmlLoader.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile%28x86 및 x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\icon16x16.ico" />
|
||||
<Content Include="Resources\icon32x32.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ItemDictionary", "ItemDictionary.csproj", "{B7A14EA6-505A-4EDD-9792-D68A82071E04}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B7A14EA6-505A-4EDD-9792-D68A82071E04}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B7A14EA6-505A-4EDD-9792-D68A82071E04}.Debug|x86.Build.0 = Debug|x86
|
||||
{B7A14EA6-505A-4EDD-9792-D68A82071E04}.Release|x86.ActiveCfg = Release|x86
|
||||
{B7A14EA6-505A-4EDD-9792-D68A82071E04}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,531 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using INILoader;
|
||||
|
||||
namespace ItemDictionary
|
||||
{
|
||||
public partial class ItemDictionary : Form
|
||||
{
|
||||
private void LoadItemData()
|
||||
{
|
||||
String item_path = String.Format("{0}/config/sp2_item.ini", main_path);
|
||||
INILoader.INILoader item_file_loader = new INILoader.INILoader(item_path, false);
|
||||
item_file_loader.SetTitle("common_info");
|
||||
int count = item_file_loader.LoadInt("item_group_cnt", 0);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
String group_key = String.Format("item_group{0}", i + 1);
|
||||
String temp = item_file_loader.LoadString(group_key, "");
|
||||
String path = String.Format("{0}\\config\\{1}", main_path, temp);
|
||||
if (File.Exists(path) == false)
|
||||
continue;
|
||||
|
||||
INILoader.INILoader item_loader = new INILoader.INILoader(path, false);
|
||||
item_loader.SetTitle("common");
|
||||
int item_count = item_loader.LoadInt("item_cnt", 0);
|
||||
if (item_count == 0)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < item_count; ++j)
|
||||
{
|
||||
String title = String.Format("item{0}", j + 1);
|
||||
item_loader.SetTitle(title);
|
||||
|
||||
ItemData data = new ItemData();
|
||||
|
||||
int code = item_loader.LoadInt("code", 0);
|
||||
int type = code/100000;
|
||||
switch( type )
|
||||
{
|
||||
case 0:
|
||||
data.desc = "일반 무기";
|
||||
break;
|
||||
case 1:
|
||||
data.desc = "일반 갑옷";
|
||||
break;
|
||||
case 2:
|
||||
data.desc = "일반 투구";
|
||||
break;
|
||||
case 3:
|
||||
data.desc = "일반 망토";
|
||||
break;
|
||||
default:
|
||||
data.desc = "오브젝트";
|
||||
break;
|
||||
}
|
||||
|
||||
data.type = "장비";
|
||||
data.name = item_loader.LoadString("name", "");
|
||||
data.pack_name = item_loader.LoadString("item_large_icon0", "");
|
||||
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadExtraItemData()
|
||||
{
|
||||
String item_path = String.Format("{0}/config/sp2_extraitem.ini", main_path);
|
||||
INILoader.INILoader item_file_loader = new INILoader.INILoader(item_path, false);
|
||||
item_file_loader.SetTitle("common_info");
|
||||
int count = item_file_loader.LoadInt("item_group_cnt", 0);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
String group_key = String.Format("item_group{0}", i + 1);
|
||||
String temp = item_file_loader.LoadString(group_key, "");
|
||||
String path = String.Format("{0}\\config\\{1}", main_path, temp);
|
||||
if (File.Exists(path) == false)
|
||||
continue;
|
||||
|
||||
INILoader.INILoader item_loader = new INILoader.INILoader(path, false);
|
||||
item_loader.SetTitle("common");
|
||||
int item_count = item_loader.LoadInt("item_cnt", 0);
|
||||
if (item_count == 0)
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < item_count; ++j)
|
||||
{
|
||||
String title = String.Format("item{0}", j + 1);
|
||||
item_loader.SetTitle(title);
|
||||
|
||||
ItemData data = new ItemData();
|
||||
|
||||
int code = item_loader.LoadInt("code", 0);
|
||||
int type = code / 100000;
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
data.desc = "고급 무기";
|
||||
break;
|
||||
case 1:
|
||||
data.desc = "고급 갑옷";
|
||||
break;
|
||||
case 2:
|
||||
data.desc = "고급 투구";
|
||||
break;
|
||||
case 3:
|
||||
data.desc = "고급 망토";
|
||||
break;
|
||||
default:
|
||||
data.desc = "오브젝트";
|
||||
break;
|
||||
}
|
||||
|
||||
data.type = "고급장비";
|
||||
data.name = item_loader.LoadString("name", "");
|
||||
data.pack_name = item_loader.LoadString("item_large_icon0", "");
|
||||
data.item_code = code;
|
||||
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadSkillData()
|
||||
{
|
||||
String skill_path = String.Format("{0}/config/sp2_skill.ini", main_path);
|
||||
INILoader.INILoader skill_file_loader = new INILoader.INILoader(skill_path, false);
|
||||
skill_file_loader.SetTitle( "common_info" );
|
||||
int count = skill_file_loader.LoadInt( "skill_group_cnt", 0 );
|
||||
for( int i=0; i<count; ++i )
|
||||
{
|
||||
String group_key = String.Format( "skill_group{0}", i+1 );
|
||||
String temp = skill_file_loader.LoadString( group_key, "" );
|
||||
String path = String.Format("{0}\\config\\{1}", main_path, temp );
|
||||
if( File.Exists( path ) == false )
|
||||
continue;
|
||||
|
||||
INILoader.INILoader skill_loader = new INILoader.INILoader(path, false);
|
||||
skill_loader.SetTitle( "common" );
|
||||
int skill_count = skill_loader.LoadInt( "skill_cnt", 0 );
|
||||
if( skill_count == 0 )
|
||||
continue;
|
||||
|
||||
for( int j=0; j<skill_count; ++j )
|
||||
{
|
||||
String title = String.Format( "skill{0}", j+1 );
|
||||
skill_loader.SetTitle( title );
|
||||
|
||||
ItemData data = new ItemData();
|
||||
|
||||
data.type = "스킬";
|
||||
|
||||
String name = skill_loader.LoadString( "desc_full_name", "" );
|
||||
if( String.IsNullOrEmpty(name) )
|
||||
data.name = skill_loader.LoadString( "desc_name", "" );
|
||||
else
|
||||
data.name = name;
|
||||
|
||||
data.desc = skill_loader.LoadString( "desc", "" );
|
||||
data.name += " (";
|
||||
data.name += skill_loader.LoadString( "name", "" );
|
||||
data.name += ")";
|
||||
data.pack_name = skill_loader.LoadString( "icon", "" );
|
||||
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadMedalData()
|
||||
{
|
||||
String medal_path = String.Format("{0}/config/sp2_medalitem_info.ini", main_path);
|
||||
String medal_manual_path = String.Format("{0}/config/sp2_medal_inven_manual.ini", main_path);
|
||||
|
||||
INILoader.INILoader medal_loader = new INILoader.INILoader(medal_path, false);
|
||||
INILoader.INILoader medal_manual_loader = new INILoader.INILoader(medal_manual_path, false);
|
||||
|
||||
medal_loader.SetTitle("item_info_common");
|
||||
int cnt = medal_loader.LoadInt("max_item_info", 0);
|
||||
for (int i = 0; i < cnt; ++i)
|
||||
{
|
||||
medal_loader.SetTitle(String.Format("item_info_{0}", i + 1));
|
||||
|
||||
ItemData data = new ItemData();
|
||||
data.pack_name = medal_loader.LoadString("icon", "");
|
||||
data.name = medal_loader.LoadString("name", "");
|
||||
|
||||
if (String.IsNullOrEmpty(data.name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
String manual = medal_loader.LoadString("manual", "");
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
medal_manual_loader.SetTitle(String.Format("Manual{0}", manual));
|
||||
for (int j = 0; j < 30; ++j)
|
||||
{
|
||||
String desc = medal_manual_loader.LoadString(String.Format("{0}Text1", j + 1), "");
|
||||
if (String.IsNullOrEmpty(desc))
|
||||
{
|
||||
data.desc = sb.ToString();
|
||||
break;
|
||||
}
|
||||
|
||||
if (j != 0)
|
||||
sb.Append(Environment.NewLine);
|
||||
|
||||
sb.Append(desc);
|
||||
}
|
||||
|
||||
data.type = "메달";
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadQuestData()
|
||||
{
|
||||
String path = String.Format("{0}/config/sp2_quest_info.ini", main_path);
|
||||
INILoader.INILoader quest_file_loader = new INILoader.INILoader(path, false);
|
||||
quest_file_loader.SetTitle( "common" );
|
||||
int count = quest_file_loader.LoadInt( "max_quest", 0 );
|
||||
for( int i=0; i<count; ++i )
|
||||
{
|
||||
quest_file_loader.SetTitle(String.Format("quest{0}", i + 1));
|
||||
|
||||
int quest_cnt = quest_file_loader.LoadInt("max_sub_quest", 0);
|
||||
for( int j=0; j<quest_cnt; ++j )
|
||||
{
|
||||
ItemData data = new ItemData();
|
||||
String icon_name = String.Format( "sub{0}_icon", j+1 );
|
||||
String name = String.Format( "sub{0}_title", j+1 );
|
||||
String desc = String.Format( "sub{0}_progress", j+1 );
|
||||
data.pack_name = quest_file_loader.LoadString(icon_name, "");
|
||||
data.name = quest_file_loader.LoadString(name, "");
|
||||
data.desc = quest_file_loader.LoadString(desc, "");
|
||||
data.type = "퀘스트";
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadEtcItemData()
|
||||
{
|
||||
String etcitem_manual_path = String.Format("{0}/config/sp2_etc_inven_manual.ini", main_path);
|
||||
String path = String.Format("{0}/config/sp2_etcitem_info.ini", main_path);
|
||||
|
||||
INILoader.INILoader loader = new INILoader.INILoader(path, false);
|
||||
INILoader.INILoader etcitem_manual_loader = new INILoader.INILoader(etcitem_manual_path, false);
|
||||
|
||||
loader.SetTitle("common");
|
||||
int count = loader.LoadInt("max", 0);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
String title = String.Format("etcitem{0}", i+1 );
|
||||
loader.SetTitle(title);
|
||||
|
||||
ItemData data = new ItemData();
|
||||
data.pack_name = loader.LoadString("icon_name", "");
|
||||
data.name = loader.LoadString("name", "");
|
||||
data.type = "특별아이템";
|
||||
|
||||
int manual = loader.LoadInt("inventory_manual", 0);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
etcitem_manual_loader.SetTitle(String.Format("Manual{0}", manual));
|
||||
for (int j = 0; j < 30; ++j)
|
||||
{
|
||||
String desc = etcitem_manual_loader.LoadString(String.Format("{0}Text1", j + 1), "");
|
||||
if (String.IsNullOrEmpty(desc))
|
||||
{
|
||||
data.desc = sb.ToString();
|
||||
break;
|
||||
}
|
||||
|
||||
if (j != 0)
|
||||
sb.Append(Environment.NewLine);
|
||||
|
||||
sb.Append(desc);
|
||||
}
|
||||
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadCostumeData()
|
||||
{
|
||||
String path = String.Format("{0}/config/sp2_costume.ini", main_path);
|
||||
INILoader.INILoader loader = new INILoader.INILoader(path, false);
|
||||
loader.SetTitle("common_info");
|
||||
int count = loader.LoadInt("costume_group_cnt", 0);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
String group_key = String.Format("costume_group{0}", i + 1);
|
||||
|
||||
String temp = loader.LoadString(group_key, "");
|
||||
String costume_path = String.Format("{0}\\config\\{1}", main_path, temp);
|
||||
if (File.Exists(costume_path) == false)
|
||||
continue;
|
||||
|
||||
INILoader.INILoader costume_loader = new INILoader.INILoader(costume_path, false);
|
||||
costume_loader.SetTitle( "common_info" );
|
||||
int costume_cnt = costume_loader.LoadInt("costume_cnt", 0);
|
||||
|
||||
for( int j=0; j<costume_cnt; ++j )
|
||||
{
|
||||
String title = String.Format( "costume{0}", j+1 );
|
||||
costume_loader.SetTitle( title );
|
||||
|
||||
ItemData data = new ItemData();
|
||||
data.pack_name = costume_loader.LoadString("icon_name", "");
|
||||
if( String.IsNullOrEmpty(data.pack_name) )
|
||||
{
|
||||
int code = costume_loader.LoadInt( "costum_code", 0 );
|
||||
if( code > 0 )
|
||||
{
|
||||
ItemData item_data = item_data_list.Find( p => p.item_code == code );
|
||||
if( !String.IsNullOrEmpty(item_data.pack_name) )
|
||||
data.pack_name = item_data.pack_name;
|
||||
}
|
||||
}
|
||||
data.name = costume_loader.LoadString("name", "");
|
||||
data.desc = "";
|
||||
data.type = "코스튬";
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadAccessoryData()
|
||||
{
|
||||
String path = String.Format("{0}/config/sp2_accessory.ini", main_path);
|
||||
INILoader.INILoader loader = new INILoader.INILoader(path, false);
|
||||
loader.SetTitle("common_info");
|
||||
int count = loader.LoadInt("item_group_cnt", 0);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
String group_key = String.Format("item_group{0}", i + 1);
|
||||
|
||||
String temp = loader.LoadString(group_key, "");
|
||||
String accessory_path = String.Format("{0}\\config\\{1}", main_path, temp);
|
||||
if (File.Exists(accessory_path) == false)
|
||||
continue;
|
||||
|
||||
INILoader.INILoader item_loader = new INILoader.INILoader(accessory_path, false);
|
||||
item_loader.SetTitle("common");
|
||||
int item_cnt = item_loader.LoadInt("item_cnt", 0);
|
||||
|
||||
for (int j = 0; j < item_cnt; ++j)
|
||||
{
|
||||
String title = String.Format("item{0}", j + 1);
|
||||
item_loader.SetTitle(title);
|
||||
|
||||
ItemData data = new ItemData();
|
||||
data.pack_name = item_loader.LoadString("item_large_icon0", "");
|
||||
data.name = item_loader.LoadString("name", "");
|
||||
|
||||
data.desc = "";
|
||||
|
||||
int desc_cnt = item_loader.LoadInt( "max_tooltip_text_size", 0 );
|
||||
for( int k=0; k<desc_cnt; ++k )
|
||||
{
|
||||
if( String.IsNullOrEmpty(data.desc) )
|
||||
{
|
||||
String key = String.Format("tooltip_text{0}", k + 1);
|
||||
data.desc = item_loader.LoadString(key, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
String key = String.Format("tooltip_text{0}", k + 1);
|
||||
data.desc += Environment.NewLine + item_loader.LoadString(key, "");
|
||||
}
|
||||
}
|
||||
|
||||
data.type = "악세사리";
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadDecoManData()
|
||||
{
|
||||
String path = String.Format("{0}/config/sp2_deco_man.ini", main_path);
|
||||
String deco_manual_path = String.Format("{0}/config/sp2_deco_manual.ini", main_path);
|
||||
|
||||
INILoader.INILoader loader = new INILoader.INILoader(path, false);
|
||||
INILoader.INILoader deco_manual_loader = new INILoader.INILoader(deco_manual_path, false);
|
||||
|
||||
loader.SetTitle("Info");
|
||||
int count = loader.LoadInt("max_Deco", 0);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
String title = String.Format("Deco{0}", i + 1);
|
||||
loader.SetTitle(title);
|
||||
|
||||
int deco_cnt = loader.LoadInt( "Max", 0 );
|
||||
for( int j=0; j<deco_cnt; ++j )
|
||||
{
|
||||
ItemData data = new ItemData();
|
||||
|
||||
String item_name = String.Format( "Name_{0}", j+1 );
|
||||
String icon_name = String.Format( "Icon_{0}", j+1 );
|
||||
String manual_name = String.Format( "manual_{0}", j+1 );
|
||||
|
||||
data.pack_name = loader.LoadString(icon_name, "");
|
||||
data.name = loader.LoadString(item_name, "");
|
||||
data.type = "남성치장";
|
||||
|
||||
int manual = loader.LoadInt( manual_name, 0 );
|
||||
StringBuilder sb = new StringBuilder();
|
||||
deco_manual_loader.SetTitle(String.Format("Manual{0}", manual));
|
||||
for (int k = 0; k < 30; ++k)
|
||||
{
|
||||
String desc = deco_manual_loader.LoadString(String.Format("{0}Text1", k + 1), "");
|
||||
if (String.IsNullOrEmpty(desc))
|
||||
{
|
||||
data.desc = sb.ToString();
|
||||
break;
|
||||
}
|
||||
|
||||
if (k != 0)
|
||||
sb.Append(Environment.NewLine);
|
||||
|
||||
sb.Append(desc);
|
||||
}
|
||||
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadDecoWomanData()
|
||||
{
|
||||
String path = String.Format("{0}/config/sp2_deco_woman.ini", main_path);
|
||||
String deco_manual_path = String.Format("{0}/config/sp2_deco_manual.ini", main_path);
|
||||
|
||||
INILoader.INILoader loader = new INILoader.INILoader(path, false);
|
||||
INILoader.INILoader deco_manual_loader = new INILoader.INILoader(deco_manual_path, false);
|
||||
|
||||
loader.SetTitle("Info");
|
||||
int count = loader.LoadInt("max_Deco", 0);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
String title = String.Format("Deco{0}", i + 1);
|
||||
loader.SetTitle(title);
|
||||
|
||||
int deco_cnt = loader.LoadInt("Max", 0);
|
||||
for (int j = 0; j < deco_cnt; ++j)
|
||||
{
|
||||
ItemData data = new ItemData();
|
||||
|
||||
String item_name = String.Format("Name_{0}", j + 1);
|
||||
String icon_name = String.Format("Icon_{0}", j + 1);
|
||||
String manual_name = String.Format("manual_{0}", j + 1);
|
||||
|
||||
data.pack_name = loader.LoadString(icon_name, "");
|
||||
data.name = loader.LoadString(item_name, "");
|
||||
data.type = "여성치장";
|
||||
|
||||
int manual = loader.LoadInt(manual_name, 0);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
deco_manual_loader.SetTitle(String.Format("Manual{0}", manual));
|
||||
for (int k = 0; k < 30; ++k)
|
||||
{
|
||||
String desc = deco_manual_loader.LoadString(String.Format("{0}Text1", k + 1), "");
|
||||
if (String.IsNullOrEmpty(desc))
|
||||
{
|
||||
data.desc = sb.ToString();
|
||||
break;
|
||||
}
|
||||
|
||||
if (k != 0)
|
||||
sb.Append(Environment.NewLine);
|
||||
|
||||
sb.Append(desc);
|
||||
}
|
||||
|
||||
item_data_list.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadCustomDesc()
|
||||
{
|
||||
item_custom_list = new List<ItemCustomData>();
|
||||
item_custom_list.Clear();
|
||||
|
||||
if (!File.Exists("./custom_desc.txt"))
|
||||
return;
|
||||
|
||||
StreamReader sr = new StreamReader("./custom_desc.txt");
|
||||
String szLine = String.Empty;
|
||||
while (sr.Peek() > -1)
|
||||
{
|
||||
szLine = sr.ReadLine();
|
||||
|
||||
char[] charSeparators = new char[] { ',' };
|
||||
String[] RetString = szLine.Split(charSeparators, 2);
|
||||
if( RetString.Length == 2 )
|
||||
{
|
||||
ItemCustomData data;
|
||||
data.pack_name = RetString[0];
|
||||
data.desc = RetString[1];
|
||||
item_custom_list.Add(data);
|
||||
}
|
||||
}
|
||||
sr.Close();
|
||||
}
|
||||
|
||||
private void SaveCustomDesc()
|
||||
{
|
||||
if( item_custom_list.Count == 0 )
|
||||
return;
|
||||
|
||||
StreamWriter sw = new StreamWriter("./custom_desc.txt");
|
||||
|
||||
foreach( ItemCustomData data in item_custom_list )
|
||||
{
|
||||
if( String.IsNullOrEmpty(data.desc) )
|
||||
continue;
|
||||
String line = String.Format( "{0},{1}", data.pack_name, data.desc );
|
||||
sw.WriteLine(line);
|
||||
}
|
||||
|
||||
sw.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ItemDictionary
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 해당 응용 프로그램의 주 진입점입니다.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new ItemDictionary());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
|
||||
// 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이 특성 값을 변경하십시오.
|
||||
[assembly: AssemblyTitle("편하게 일 합시다!")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("WEMADEIO Co., Ltd.")]
|
||||
[assembly: AssemblyProduct("로스트사가 아이템 사전")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("da47c25f-1458-4916-972d-5fdddd167d18")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
|
||||
// 지정되도록 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.1")]
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 이 코드는 도구를 사용하여 생성되었습니다.
|
||||
// 런타임 버전:4.0.30319.42000
|
||||
//
|
||||
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
|
||||
// 이러한 변경 내용이 손실됩니다.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ItemDictionary.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
|
||||
/// </summary>
|
||||
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
|
||||
// 클래스에서 자동으로 생성되었습니다.
|
||||
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 ResGen을
|
||||
// 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ItemDictionary.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대한 현재 스레드의 CurrentUICulture
|
||||
/// 속성을 재정의합니다.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ItemDictionary.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 244 B |
Binary file not shown.
|
After Width: | Height: | Size: 338 B |
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
namespace XMLLoader
|
||||
{
|
||||
class xmlLoader
|
||||
{
|
||||
public String m_FileName;
|
||||
XmlDocument m_xmlDocument;
|
||||
XmlElement m_xmlDocumentElement;
|
||||
|
||||
public xmlLoader(String FileName)
|
||||
{
|
||||
if (!File.Exists(FileName))
|
||||
{
|
||||
MessageBox.Show("File not found.. : " + FileName);
|
||||
return;
|
||||
}
|
||||
|
||||
m_FileName = FileName;
|
||||
|
||||
m_xmlDocument = new XmlDocument();
|
||||
m_xmlDocument.Load(m_FileName);
|
||||
m_xmlDocumentElement = (XmlElement)m_xmlDocument.DocumentElement;
|
||||
}
|
||||
|
||||
public XmlDocument GetDocument()
|
||||
{
|
||||
return m_xmlDocument;
|
||||
}
|
||||
|
||||
public XmlElement GetElement()
|
||||
{
|
||||
return m_xmlDocumentElement;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LS_CSocket", "LS_CSocket.vcxproj", "{C338F3EA-92D2-4B82-840A-A9F89465B056}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C338F3EA-92D2-4B82-840A-A9F89465B056}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C338F3EA-92D2-4B82-840A-A9F89465B056}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C338F3EA-92D2-4B82-840A-A9F89465B056}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C338F3EA-92D2-4B82-840A-A9F89465B056}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="LS_CSocket"
|
||||
ProjectGUID="{C338F3EA-92D2-4B82-840A-A9F89465B056}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="../lib/LS_CSocketD.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="../lib/LS_CSocket.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="소스 파일"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\ioCSocket.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ioCSocketTCP.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ioCSocketUDP.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StdAfx.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="헤더 파일"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\include\ioCSocket.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\ioCSocketTCP.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\include\ioCSocketUDP.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="리소스 파일"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -0,0 +1,21 @@
|
||||
========================================================================
|
||||
정적 라이브러리 : LS_CSocket 프로젝트 개요
|
||||
========================================================================
|
||||
|
||||
응용 프로그램 마법사에서 이 LS_CSocket 라이브러리 프로젝트를 만들었습니다.
|
||||
프로젝트에 대해 소스 파일은 만들어지지 않았습니다.
|
||||
|
||||
|
||||
LS_CSocket.vcproj
|
||||
응용 프로그램 마법사를 사용하여 생성한 VC++ 프로젝트의 기본 프로젝트 파일입니다.
|
||||
해당 파일을 생성한 Visual C++의 버전 정보를 비롯하여
|
||||
응용 프로그램 마법사에서 선택한 플랫폼, 구성 및
|
||||
프로젝트 기능에 대한 정보가 들어 있습니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
기타 참고:
|
||||
|
||||
응용 프로그램 마법사에서 사용하는 "TODO:" 주석은 사용자가 추가하거나 사용자 지정해야 하는
|
||||
소스 코드 부분을 나타냅니다.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Loaded 100 of 20588 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user