本文整理汇总了C++中KIniFile::GetStruct方法的典型用法代码示例。如果您正苦于以下问题:C++ KIniFile::GetStruct方法的具体用法?C++ KIniFile::GetStruct怎么用?C++ KIniFile::GetStruct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KIniFile
的用法示例。
在下文中一共展示了KIniFile::GetStruct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadLoginChoice
//--------------------------------------------------------------------------
// 功能:读取以前的的登陆选择
//--------------------------------------------------------------------------
void KLogin::LoadLoginChoice()
{
if (m_Choices.bLoaded)
return;
memset(&m_Choices, 0, sizeof(m_Choices));
ClearAccountPassword(true, true);
m_Choices.bLoaded = true;
KIniFile* pSetting = g_UiBase.GetCommSettingFile();
char szAccount[32];
KSG_PASSWORD Password;
if (pSetting)
{
pSetting->GetInteger($LOGIN, "SelServerRegion", 0, &m_Choices.nServerRegionIndex);
pSetting->GetString($LOGIN, "LastGameServer", "", m_Choices.AccountServer.Title, sizeof(m_Choices.AccountServer.Title));
szAccount[0] = 0;
pSetting->GetStruct($LOGIN, $LAST_ACCOUNT, szAccount, sizeof(szAccount));
if (szAccount[0])
{
EDOneTimePad_Decipher(szAccount, strlen(szAccount));
m_Choices.bRememberAccount = true;
SetAccountPassword(szAccount, NULL);
Password.szPassword[0] = '\0';
pSetting->GetStruct($LOGIN, $LAST_PASSWORD, Password.szPassword, sizeof(Password.szPassword));
if (Password.szPassword[0])
{
EDOneTimePad_Decipher(Password.szPassword, strlen(Password.szPassword));
m_Choices.bRememberAll = true;
SetAccountPassword(NULL, &Password);
memset(&Password, 0, sizeof(Password));
}
}
if (szAccount[0])
{
KIniFile* pPrivate = g_UiBase.GetPrivateSettingFile();
if (pPrivate)
{
if (pPrivate->GetString("Main", "LastSelCharacter", "",
m_Choices.szProcessingRoleName, sizeof(m_Choices.szProcessingRoleName)))
{
EDOneTimePad_Decipher(m_Choices.szProcessingRoleName, strlen(m_Choices.szProcessingRoleName));
}
}
g_UiBase.ClosePrivateSettingFile(false);
}
g_UiBase.CloseCommSettingFile(false);
}
}