本文整理汇总了C++中CIniFile::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ CIniFile::Close方法的具体用法?C++ CIniFile::Close怎么用?C++ CIniFile::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIniFile
的用法示例。
在下文中一共展示了CIniFile::Close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Begin
//先从ini中加载游戏数据
//然后进行iocp及tcp服务器初始化
//再初始化room和user
//创建keepalive
//创建游戏线程
BOOL CGameIocp::Begin(VOID)
{
// 读取数据文件
CIniFile IniFile;
if (IniFile.Open(CONFIG_FILENAME))
{
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_GAMETIME"), &DEFAULT_GAMETIME);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_MAX_HP"), &DEFAULT_MAX_HP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_MAX_AP"), &DEFAULT_MAX_AP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_SPECIAL_DAMAGE"), &DEFAULT_SPECIAL_DAMAGE);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_SPECIAL_AP"), &DEFAULT_SPECIAL_AP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_DAMAGE"), &DEFAULT_DAMAGE);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_AP"), &DEFAULT_AP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_CATCH_AP"), &DEFAULT_CATCH_AP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_SPECIAL_CATCH_AP"), &DEFAULT_SPECIAL_CATCH_AP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_SPEND_AP"), &DEFAULT_SPEND_AP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_EXP"), &DEFAULT_EXP);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_GAMEMONEY"), &DEFAULT_GAMEMONEY);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_EXPLOSION_TIME_FOR_PERSION"), &DEFAULT_EXPLOSION_TIME_FOR_PERSION);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_EXPLOSION_TIME_FOR_TEAM"), &DEFAULT_EXPLOSION_TIME_FOR_TEAM);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_EXPLISION_ALRAM_TIME"), &DEFAULT_EXPLISION_ALRAM_TIME);
IniFile.GetValue(_T("SERVER"), _T("DEFAULT_TURNOVER_TIME"), &DEFAULT_TURNOVER_TIME);
IniFile.GetValue(_T("SERVER"), _T("DOGS000_ADVANTAGE"), &DOGS000_ADVANTAGE);
IniFile.GetValue(_T("SERVER"), _T("DOGS001_ADVANTAGE"), &DOGS001_ADVANTAGE);
IniFile.GetValue(_T("SERVER"), _T("DOGS002_ADVANTAGE"), &DOGS002_ADVANTAGE);
IniFile.GetValue(_T("SERVER"), _T("DOGS003_ADVANTAGE"), &DOGS003_ADVANTAGE);
IniFile.GetValue(_T("SERVER"), _T("DOGS004_ADVANTAGE"), &DOGS004_ADVANTAGE);
IniFile.GetValue(_T("SERVER"), _T("DOGS005_ADVANTAGE"), &DOGS005_ADVANTAGE);
IniFile.GetValue(_T("SERVER"), _T("DOGS006_ADVANTAGE"), &DOGS006_ADVANTAGE);
IniFile.GetValue(_T("SERVER"), _T("DOGS007_ADVANTAGE"), &DOGS007_ADVANTAGE);
IniFile.Close();
}
else
{
CLog::WriteLogNoDate(_T("IniFile.Open"));
End();
return FALSE;
}
//创建完成端口和工作者线程
if (!CIocp::Begin())
{
CLog::WriteLogNoDate(_T("CIocp::Begin"));
End();
return FALSE;
}
//初始化mListenSession
if (!mListenSession.Begin())
{
CLog::WriteLogNoDate(_T("ListenSession.Begin"));
End();
return FALSE;
}
//创建TCP模式的socket
if (!mListenSession.TcpBind())
{
CLog::WriteLogNoDate(_T("ListenSession.TcpBind"));
End();
return FALSE;
}
//bing和listen
if (!mListenSession.Listen(DEFAULT_PORT, MAX_USER))
{
CLog::WriteLogNoDate(_T("ListenSession.Listen"));
End();
return FALSE;
}
//在IOCP上注册mListenSession
if (!CIocp::RegisterSocketToIocp(mListenSession.GetSocket(), (ULONG_PTR) &mListenSession))
{
CLog::WriteLogNoDate(_T("CIocp::RegisterSocketToIocp"));
End();
return FALSE;
}
// 开始数据库对象
//.........这里部分代码省略.........