Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
115
Tools/PatchMaker/PMSetting.cpp
Normal file
115
Tools/PatchMaker/PMSetting.cpp
Normal file
@@ -0,0 +1,115 @@
|
||||
// SettingOptionPage.cpp : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "PMSetting.h"
|
||||
|
||||
CPMSetting::CPMSetting()
|
||||
: m_szSetupFileName(_T(""))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CPMSetting::~CPMSetting()
|
||||
{
|
||||
m_SetupDataMap.RemoveAll();
|
||||
}
|
||||
|
||||
bool CPMSetting::SaveSetting()
|
||||
{
|
||||
// TODO: <20><><EFBFBD> <20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
|
||||
CStdioFile setupFile;
|
||||
if (setupFile.Open(m_szSetupFileName, CFile::modeWrite | CFile::typeText))
|
||||
{
|
||||
CString szLine;
|
||||
CString szKey;
|
||||
CString szValue;
|
||||
|
||||
for (POSITION pos = m_SetupDataMap.GetStartPosition(); pos != NULL; )
|
||||
{
|
||||
m_SetupDataMap.GetNextAssoc(pos, szKey, szValue);
|
||||
|
||||
szLine.Format("%s = %s\n", szKey, szValue);
|
||||
setupFile.WriteString(szLine);
|
||||
}
|
||||
|
||||
setupFile.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CPMSetting::LoadSetting(LPCTSTR szSetupFileName)
|
||||
{
|
||||
m_SetupDataMap.RemoveAll();
|
||||
m_szSetupFileName.SetString(szSetupFileName);
|
||||
|
||||
CStdioFile setupFile;
|
||||
if (setupFile.Open(m_szSetupFileName,
|
||||
CFile::modeCreate | CFile::modeNoTruncate | CFile::modeRead | CFile::shareDenyNone | CFile::typeText))
|
||||
{
|
||||
CString szLine;
|
||||
CString szKey;
|
||||
CString szValue;
|
||||
|
||||
LPCTSTR szSeps = _T("=\t\r\n");
|
||||
|
||||
while(setupFile.ReadString(szLine))
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>о <20>ִ´<D6B4>.
|
||||
int nTokenPos = 0;
|
||||
|
||||
if (0 != szLine.Compare(_T("")))
|
||||
{
|
||||
szKey = szLine.Tokenize(szSeps, nTokenPos);
|
||||
|
||||
if (0 < nTokenPos)
|
||||
{
|
||||
szValue = szLine.Tokenize(szSeps, nTokenPos);
|
||||
|
||||
if (0 != szKey.Compare(_T("")) && 0 != szValue.Compare(_T("")))
|
||||
{
|
||||
szKey.Trim();
|
||||
szValue.Trim();
|
||||
|
||||
szKey.MakeUpper();
|
||||
m_SetupDataMap.SetAt(szKey, szValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setupFile.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CPMSetting::GetSettingData(LPCTSTR szKey, CString& szValue)
|
||||
{
|
||||
CString szKeyString(szKey);
|
||||
szKeyString.MakeUpper();
|
||||
|
||||
return (TRUE == m_SetupDataMap.Lookup(szKeyString, szValue)) ? true : false;
|
||||
}
|
||||
|
||||
void CPMSetting::SetSettingData(LPCTSTR szKey, LPCTSTR szValue)
|
||||
{
|
||||
CString szKeyString(szKey);
|
||||
szKeyString.MakeUpper();
|
||||
|
||||
m_SetupDataMap.SetAt(szKeyString, szValue);
|
||||
}
|
||||
|
||||
CPMSetting& CPMDefaultSetting::GetInstance()
|
||||
{
|
||||
static CPMSetting pmSetting;
|
||||
return pmSetting;
|
||||
}
|
||||
|
||||
LPCTSTR CPMDefaultSetting::GetDefaultSettingName()
|
||||
{
|
||||
return _T("PatchMaker.cfg");
|
||||
}
|
||||
Reference in New Issue
Block a user