本文整理汇总了C++中ITabFile类的典型用法代码示例。如果您正苦于以下问题:C++ ITabFile类的具体用法?C++ ITabFile怎么用?C++ ITabFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ITabFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
BOOL KGMInfoList::Init()
{
BOOL bResult = false;
int nRetCode = false;
ITabFile* piTabFile = NULL;
char szFilePath[MAX_PATH];
snprintf(szFilePath, sizeof(szFilePath), "%s/%s", SETTING_DIR, GMACCOUNT_LIST_FILE_NAME);
szFilePath[sizeof(szFilePath) - 1] = '\0';
piTabFile = g_OpenTabFile(szFilePath);
KGLOG_PROCESS_ERROR(piTabFile);
for (int nRowIndex = 2; nRowIndex <= piTabFile->GetHeight(); nRowIndex++)
{
GMAccountInfo NewGMAccount;
piTabFile->GetString(nRowIndex, "szAccount", "", NewGMAccount.szGMAccount, sizeof(NewGMAccount.szGMAccount));
NewGMAccount.szGMAccount[countof(NewGMAccount.szGMAccount) - 1] = '\0';
KGLOG_PROCESS_ERROR(NewGMAccount.szGMAccount != '\0');
m_GMAccountInfoList.push_back(NewGMAccount);
}
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例2: LoadRandomQuestGroup
BOOL KQuestInfoList::LoadRandomQuestGroup()
{
BOOL bResult = false;
int nRetCode = false;
int nHeight = 0;
ITabFile* piTabFile = NULL;
DWORD dwTemplateID = 0;
DWORD dwQuestID = 0;
KQuestInfo* pQuestInfo = NULL;
char szFilePath[MAX_PATH];
char szColName[64];
std::set<DWORD>::iterator setIt;
int nID = 0;
nRetCode = (int)snprintf(szFilePath, sizeof(szFilePath), "%s/%s", SETTING_DIR, RANDOM_QUEST_FILE_NAME);
KGLOG_PROCESS_ERROR(nRetCode > 0 && nRetCode < (int)sizeof(szFilePath));
piTabFile = g_OpenTabFile(szFilePath);
KGLOG_PROCESS_ERROR(piTabFile);
nHeight = piTabFile->GetHeight();
if (nHeight >= 2)
{
for (int i = 2; i <= nHeight; ++i)
{
KQUEST_GROUP QuestGroupInfo;
nRetCode = piTabFile->GetInteger(i, "ID", 0, &nID);
KGLOG_PROCESS_ERROR(nRetCode > 0);
for (int j = 0; j < RANDOM_QUEST_COUNT_PER_GROUP; ++j)
{
snprintf(szColName, sizeof(szColName), "Quest%d", j + 1);
szColName[sizeof(szColName) - 1] = '\0';
nRetCode = piTabFile->GetInteger(i, szColName, 0, (int*)&dwQuestID);
if (dwQuestID == 0)
break;
pQuestInfo = GetQuestInfo(dwQuestID);
KGLOG_PROCESS_ERROR(pQuestInfo);
KGLOG_PROCESS_ERROR(pQuestInfo->bAccept);
KGLOG_PROCESS_ERROR(pQuestInfo->bRepeat);
QuestGroupInfo.push_back(dwQuestID);
}
m_RandomQuestGroup[nID] = QuestGroupInfo;
}
}
Exit1:
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例3: Reload
BOOL KQuestInfoList::Reload()
{
BOOL bResult = false;
int nRetCode = false;
int nHeight = 0;
ITabFile* piTabFile = NULL;
char szFilePath[MAX_PATH];
DWORD dwQuestID = 0;
KQuestInfo* pQuestInfo = NULL;
nRetCode = (int)snprintf(szFilePath, sizeof(szFilePath), "%s/%s", SETTING_DIR, QUEST_FILE_NAME);
KGLOG_PROCESS_ERROR(nRetCode > 0 && nRetCode < (int)sizeof(szFilePath));
piTabFile = g_OpenTabFile(szFilePath);
KGLOG_PROCESS_ERROR(piTabFile);
nHeight = piTabFile->GetHeight();
KGLOG_PROCESS_ERROR(nHeight > 1);
nRetCode = LoadQuestInfo(piTabFile, 2, &m_DefaultQuestInfo);
KGLOG_PROCESS_ERROR(nRetCode);
m_DailyQuest.clear();
m_RandomQuestGroup.clear();
for (int nIndex = 3; nIndex <= nHeight; nIndex++)
{
KQuestInfo TempQuestInfo;
nRetCode = piTabFile->GetInteger(nIndex, "QuestID", m_DefaultQuestInfo.dwQuestID, (int*)&dwQuestID);
KGLOG_PROCESS_ERROR(nRetCode);
KGLOG_PROCESS_ERROR(dwQuestID < MAX_QUEST_COUNT);
pQuestInfo = GetQuestInfo(dwQuestID);
if (pQuestInfo == NULL)
pQuestInfo = &TempQuestInfo;
nRetCode = LoadQuestInfo(piTabFile, nIndex, pQuestInfo);
KGLOG_PROCESS_ERROR(nRetCode);
m_mapID2QuestInfo[dwQuestID] = *pQuestInfo;
if (pQuestInfo->bDaily)
m_DailyQuest.push_back(pQuestInfo->dwQuestID);
}
nRetCode = LoadRandomQuestGroup();
KGLOG_PROCESS_ERROR(nRetCode);
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例4: Load
BOOL KTrackList::Load()
{
BOOL bResult = false;
int nRetCode = 0;
ITabFile* piTabFile = NULL;
int nTabHeight = 0;
char szFileName[MAX_PATH];
snprintf(szFileName, sizeof(szFileName), "%s/%s/track.tab", SETTING_DIR, TRACK_DIR);
szFileName[sizeof(szFileName) - 1] = '\0';
piTabFile = g_OpenTabFile(szFileName);
KGLOG_PROCESS_ERROR(piTabFile);
nTabHeight = piTabFile->GetHeight();
KGLOG_PROCESS_ERROR(nTabHeight >= 2);
for (int nLine = 2; nLine <= nTabHeight; nLine++)
{
DWORD dwID = 0;
KTRACK* pTrack = NULL;
KTRACK_INFO TrackInfo;
pair<KTRACK_TABLE::iterator, bool> IntResult;
nRetCode = piTabFile->GetInteger(nLine, COL_ID, 0, (int*)&dwID);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = piTabFile->GetInteger(nLine, COL_MAP, 0, (int*)&TrackInfo.dwMapID);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = piTabFile->GetString(nLine, COL_DESC, "?", TrackInfo.szDesc, sizeof(TrackInfo.szDesc));
KGLOG_PROCESS_ERROR(nRetCode);
IntResult = m_TrackTable.insert(KTRACK_TABLE::value_type(dwID, TrackInfo));
KGLOG_PROCESS_ERROR(IntResult.second);
pTrack = &IntResult.first->second.Track;
nRetCode = LoadTrack(dwID, pTrack);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = CalculateCriticalFrame(pTrack);
KGLOG_PROCESS_ERROR(nRetCode);
}
bResult = true;
Exit0:
if (!bResult)
{
m_TrackTable.clear();
}
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例5:
void KG3DAnimationSoundTagInfo::Init()
{
int nHeight = 0;
ITabFile *pTabFile = NULL;
IIniFile *pIniFile = NULL;
pTabFile = g_OpenTabFile(s_strConfigTabFile);
KG_PROCESS_ERROR(pTabFile);
m_SoundType.clear();
m_AnimationSoundTagInfo.clear();
for (size_t i = 0 ; i < sizeof(s_strSoundType) / sizeof(TCHAR *) ; i ++)
{
std::string strFirst = s_strSoundType[i];
m_SoundType[strFirst] = i;
}
nHeight = pTabFile->GetHeight();
for (int i = 2 ; i <= nHeight ; i ++)
{
AnimationSoundTagInfo Info;
TCHAR strSoundType[MAX_PATH];
std::string SoundTypetemp;
iter it = m_SoundType.begin();
int nSoundType = 0;
pTabFile->GetString(i,COL_SOUNDTYPE,"",strSoundType,MAX_PATH);
pTabFile->GetString(i,COL_FILENAME,"",Info.strFileName,MAX_PATH);
pTabFile->GetFloat(i,COL_RATE,0.0f,&Info.fRate);
_strlwr_s(strSoundType,MAX_PATH);
SoundTypetemp = strSoundType;
KG_PROCESS_ERROR(m_SoundType.find(SoundTypetemp) != m_SoundType.end());
Info.soundType = static_cast<SoundType>(m_SoundType[SoundTypetemp]);
nSoundType = m_SoundType[SoundTypetemp];
if(m_AnimationSoundTagInfo.find(nSoundType)
!= m_AnimationSoundTagInfo.end())
{
m_AnimationSoundTagInfo[nSoundType].push_back(Info);
}
else
{
std::vector<AnimationSoundTagInfo> vec;
vec.push_back(Info);
m_AnimationSoundTagInfo[nSoundType] = vec;
}
}
Adjust();
pIniFile = g_OpenIniFile(s_strConfigIniFile);
KG_PROCESS_ERROR(pIniFile);
pIniFile->GetInteger("ROOT","SaveVersion3Data",0,&m_nSaveVersion3Data);
m_bInit = TRUE;
Exit0:
SAFE_RELEASE(pTabFile);
SAFE_RELEASE(pIniFile);
;
}
示例6: Init
BOOL KEntryList::Init()
{
BOOL bResult = false;
int nRetCode = false;
ITabFile* piTabFile = NULL;
int nTabHeight = 0;
char szFileName[PATH_MAX];
snprintf(szFileName, sizeof(szFileName), "%s/EntryList.tab", SETTING_DIR);
szFileName[sizeof(szFileName) - 1] = '\0';
piTabFile = g_OpenTabFile(szFileName);
if (!piTabFile)
{
KGLogPrintf(KGLOG_ERR, "[EntryList] Failed to open entry list file : %s\n", szFileName);
goto Exit0;
}
nTabHeight = piTabFile->GetHeight();
for (int nLine = 2; nLine <= nTabHeight; nLine++)
{
__int64 nKey = 0;
int nMapID = 0;
int nIndex = 0;
KMapEntry EntryInfo;
nRetCode = piTabFile->GetInteger(nLine, "Map", 0, &nMapID);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nRetCode = piTabFile->GetInteger(nLine, "Index", 0, &nIndex);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nRetCode = piTabFile->GetInteger(nLine, "PosX", 0, &EntryInfo.nPosX);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nRetCode = piTabFile->GetInteger(nLine, "PosY", 0, &EntryInfo.nPosY);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nRetCode = piTabFile->GetInteger(nLine, "PosZ", 0, &EntryInfo.nPosZ);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nRetCode = piTabFile->GetInteger(nLine, "Direction", 0, &EntryInfo.nDirection);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nKey = MAKE_INT64(nMapID, nIndex);
m_EntryList[nKey] = EntryInfo;
}
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
if (!bResult)
{
m_EntryList.clear();
}
return bResult;
}
示例7: Init
BOOL FactionManager::Init()
{
INT nRowNum = 0;
// 读取门派技能表
ITabFile* pTabFile = NULL;//g_OpenTabFile(KD_FACTION_SKILL_LIST_TABLE);
//LOG_PROCESS_ERROR(pTabFile);
// 读取门派成长数值表
pTabFile = g_OpenTabFile(KD_FACTION_ABILITY_TABLE);
LOG_PROCESS_ERROR(pTabFile);
nRowNum = pTabFile->GetHeight();
for (INT i = 3; i < nRowNum; i++)
{
INT nFactionId = 0, nRouteId = 0;
pTabFile->GetInteger(i, "FactionId", 0, &nFactionId);
pTabFile->GetInteger(i, "RouteId", 0, &nRouteId);
INT nEnumId = (nFactionId << 16) | nRouteId; // 联合id
if (m_cFactionData.mapFactionGrowthData.find(nEnumId) == m_cFactionData.mapFactionGrowthData.end())
{
m_cFactionData.mapFactionGrowthData.insert(
std::pair<INT, std::vector<CHARACTER_BASE_ATTRIBUTE*> >(nEnumId, std::vector<CHARACTER_BASE_ATTRIBUTE*>())
);
// m_cFactionData.mapFactionGrowthData[nEnumId] = std::vector<CHARACTER_BASE_ATTRIBUTE*>();
}
std::vector<CHARACTER_BASE_ATTRIBUTE*>& arrFactionAbility = m_cFactionData.mapFactionGrowthData[nEnumId];
CHARACTER_BASE_ATTRIBUTE* pBaseAttribute = new CHARACTER_BASE_ATTRIBUTE;
LOG_PROCESS_ERROR(pBaseAttribute);
memset(pBaseAttribute, 0, sizeof(CHARACTER_BASE_ATTRIBUTE));
pTabFile->GetInteger(i, "Level", 0, &pBaseAttribute->nLevel);
pTabFile->GetInteger(i, "Con", 0, &pBaseAttribute->nConstitution);
pTabFile->GetInteger(i, "Str", 0, &pBaseAttribute->nStrength);
pTabFile->GetInteger(i, "Agi", 0, &pBaseAttribute->nAgile);
pTabFile->GetInteger(i, "Int", 0, &pBaseAttribute->nIntelligence);
pTabFile->GetInteger(i, "Spi", 0, &pBaseAttribute->nSpirit);
arrFactionAbility.push_back(pBaseAttribute);
}
return TRUE;
EXIT0:
return FALSE;
}
示例8: Init
BOOL KRelationList::Init(const char* szSettingFile)
{
BOOL bResult = false;
int nSize = 0;
int nRetCode = 0;
ITabFile* pTabFile = NULL;
char szFileName[MAX_PATH];
KGLOG_PROCESS_ERROR(szSettingFile);
snprintf(szFileName, sizeof(szFileName), "%s/%s", SETTING_DIR, szSettingFile);
szFileName[sizeof(szFileName) - 1] = '\0';
pTabFile = g_OpenTabFile(szFileName);
KGLOG_PROCESS_ERROR(pTabFile);
nSize = pTabFile->GetHeight() - 1;
KGLOG_PROCESS_ERROR(nSize > 0);
assert(m_nRelation == NULL);
m_nRelation = new int*[nSize];
for (int i = 0; i < nSize; i++)
{
m_nRelation[i] = new int[nSize];
}
m_nSize = nSize;
for (int i = 2; i < nSize + 2; i++)
{
int nId = 0;
nRetCode = pTabFile->GetInteger(i, RELATION_ID, 0, &nId);
KGLOG_PROCESS_ERROR(nRetCode && nId == i - 2);
for (int j = 0; j < nSize; j++)
{
char szKey[256];
sprintf(szKey, "%d", j);
nRetCode = pTabFile->GetInteger(i, szKey, 0, &m_nRelation[i - 2][j]);
KGLOG_PROCESS_ERROR(nRetCode != 0);
}
}
bResult = true;
Exit0:
KG_COM_RELEASE(pTabFile);
return bResult;
}
示例9: LoadAllAward
BOOL KAwardMgr::LoadAllAward()
{
BOOL bResult = false;
BOOL bRetCode = false;
ITabFile* piTabFile = NULL;
DWORD dwAwardID = 0;
char szAwardFileName[MAX_PATH];
char szFilePath[MAX_PATH];
std::pair<KAWARD_TABLE_MAP::iterator, bool> InsRet;
KAwardTable* pAwardTable = NULL;
snprintf(szFilePath, sizeof(szFilePath), "%s/%s", SETTING_DIR, "award/award.tab");
szFilePath[sizeof(szFilePath) - 1] = '\0';
piTabFile = g_OpenTabFile(szFilePath);
KGLOG_PROCESS_ERROR(piTabFile);
for (int nRowIndex = 2; nRowIndex <= piTabFile->GetHeight(); nRowIndex++)
{
bRetCode = piTabFile->GetInteger(nRowIndex, "ID", 0, (int*)&dwAwardID);
KGLOG_PROCESS_ERROR(bRetCode > 0);
bRetCode = piTabFile->GetString(nRowIndex, "AwardItem", "", szAwardFileName, sizeof(szAwardFileName));
KGLOG_PROCESS_ERROR(bRetCode > 0);
KGLOG_PROCESS_ERROR(szAwardFileName[0] != '\0');
InsRet = m_AwardTable.insert(std::make_pair(dwAwardID, KAwardTable()));
KGLOG_PROCESS_ERROR(InsRet.second);
pAwardTable = &InsRet.first->second;
bRetCode = LoadOneAward(szAwardFileName, pAwardTable);
if (!bRetCode)
{
KGLogPrintf(KGLOG_DEBUG, "Load award file:%s failed!", szAwardFileName);
goto Exit0;
}
}
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例10: Init
BOOL KQuestInfoList::Init(void)
{
BOOL bResult = false;
int nRetCode = false;
int nHeight = 0;
ITabFile* piTabFile = NULL;
char szFilePath[MAX_PATH];
std::pair<MAP_ID_2_QUEST_INFO::iterator, bool> InsRet;
nRetCode = (int)snprintf(szFilePath, sizeof(szFilePath), "%s/%s", SETTING_DIR, QUEST_FILE_NAME);
KGLOG_PROCESS_ERROR(nRetCode > 0 && nRetCode < (int)sizeof(szFilePath));
piTabFile = g_OpenTabFile(szFilePath);
KGLOG_PROCESS_ERROR(piTabFile);
nHeight = piTabFile->GetHeight();
KGLOG_PROCESS_ERROR(nHeight > 1);
memset(&m_DefaultQuestInfo, 0, sizeof(m_DefaultQuestInfo));
nRetCode = LoadQuestInfo(piTabFile, 2, &m_DefaultQuestInfo);
KGLOG_PROCESS_ERROR(nRetCode);
for (int nIndex = 3; nIndex <= nHeight; nIndex++)
{
KQuestInfo TempQuestInfo;
nRetCode = LoadQuestInfo(piTabFile, nIndex, &TempQuestInfo);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = MakeQuestMap(&TempQuestInfo);
KGLOG_PROCESS_ERROR(nRetCode);
#ifdef _SERVER
InsRet = m_mapID2QuestInfo.insert(std::make_pair(TempQuestInfo.dwQuestID, TempQuestInfo));
KGLOG_PROCESS_ERROR(InsRet.second);
#endif
}
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例11: g_OpenTabFile
HRESULT KG3DTerrainRepresentInfo::Init()
{
HRESULT hResult = E_FAIL;
HRESULT hRetCode = E_FAIL;
int nHeight = 0;
m_TerrainRepresentInfo.clear();
ITabFile *pTabFile = g_OpenTabFile(s_strConfigFile);
KG_PROCESS_ERROR(pTabFile);
nHeight = pTabFile->GetHeight();
for (int i = 2; i <= nHeight; i++)
{
TerrainRepresentInfo Info;
int nGroundType = 0;
TCHAR strLower[MAX_PATH];
pTabFile->GetString(i, COL_FILENAME, "", Info.strFileName, MAX_PATH);
strcpy_s(strLower, MAX_PATH, Info.strFileName);
_strlwr_s(strLower, MAX_PATH);
DWORD dwHash = g_FileNameHash(strLower);
pTabFile->GetString(i, COL_ANNOTATE, "", Info.strAnnotate, MAX_PATH);
pTabFile->GetInteger(i, COL_TYPE, INVALID_GROUNDTYPE, &nGroundType);
Info.dwType = static_cast<DWORD>(nGroundType);
pTabFile->GetString(i,COL_SFX,"",Info.strSfx[COL_SFX-COL_SFX],MAX_PATH);
pTabFile->GetString(i,COL_SFX1,"",Info.strSfx[COL_SFX1-COL_SFX],MAX_PATH);
pTabFile->GetString(i,COL_SFX2,"",Info.strSfx[COL_SFX2-COL_SFX],MAX_PATH);
pTabFile->GetString(i,COL_SFX3,"",Info.strSfx[COL_SFX3-COL_SFX],MAX_PATH);
pTabFile->GetString(i,COL_SFXTERRAIN,"",Info.strSfxTerrain,MAX_PATH);
pTabFile->GetFloat(i, COL_SFX_RATE, 1.0f, &Info.fSfxPlayRate);//不填默认100%
m_TerrainRepresentInfo[dwHash] = Info;
}
hRetCode = InitDis();
KG_COM_PROCESS_ERROR(hRetCode);
hRetCode = InitDefaultSfx();
KG_COM_PROCESS_ERROR(hRetCode);
hResult = S_OK;
Exit0:
SAFE_RELEASE(pTabFile);
return hResult;
}
示例12: Save
BOOL KTrackList::Save()
{
BOOL bResult = false;
int nRetCode = 0;
ITabFile* piTabFile = NULL;
int nLine = 0;
char szFileName[MAX_PATH];
snprintf(szFileName, sizeof(szFileName), "%s/%s/track.tab", SETTING_DIR, TRACK_DIR);
szFileName[sizeof(szFileName) - 1] = '\0';
piTabFile = g_CreateTabFile();
KGLOG_PROCESS_ERROR(piTabFile);
nRetCode = piTabFile->InsertNewCol(COL_ID);
KGLOG_PROCESS_ERROR(nRetCode != -1);
nRetCode = piTabFile->InsertNewCol(COL_MAP);
KGLOG_PROCESS_ERROR(nRetCode != -1);
nRetCode = piTabFile->InsertNewCol(COL_DESC);
KGLOG_PROCESS_ERROR(nRetCode != -1);
nLine = 2;
for (KTRACK_TABLE::iterator it = m_TrackTable.begin(); it != m_TrackTable.end(); ++it)
{
DWORD dwID = it->first;
KTRACK_INFO* pTrackInfo = &it->second;
nRetCode = piTabFile->WriteInteger(nLine, COL_ID, dwID);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = piTabFile->WriteInteger(nLine, COL_MAP, pTrackInfo->dwMapID);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = piTabFile->WriteString(nLine, COL_DESC, pTrackInfo->szDesc);
KGLOG_PROCESS_ERROR(nRetCode);
nRetCode = SaveTrack(dwID, pTrackInfo->Track);
KGLOG_PROCESS_ERROR(nRetCode);
nLine++;
}
nRetCode = piTabFile->Save(szFileName);
KGLOG_PROCESS_ERROR(nRetCode);
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例13: GetQuestInfo
KQuestInfo* KQuestInfoList::GetQuestInfo(DWORD dwQuestID)
{
KQuestInfo* pResult = NULL;
BOOL bRetCode = false;
ITabFile* piTabFile = NULL;
int nHeight = 0;
KQuestInfo TempQuest;
char szFilePath[MAX_PATH];
MAP_ID_2_QUEST_INFO::iterator it;
std::pair<MAP_ID_2_QUEST_INFO::iterator, bool> InsRet;
KGLOG_PROCESS_ERROR(dwQuestID > 0);
it = m_mapID2QuestInfo.find(dwQuestID);
if (it != m_mapID2QuestInfo.end())
{
pResult = &(it->second);
goto Exit0;
}
snprintf(szFilePath, sizeof(szFilePath), "%s/%s", SETTING_DIR, QUEST_FILE_NAME);
szFilePath[sizeof(szFilePath) - 1] = '\0';
piTabFile = g_OpenTabFile(szFilePath);
KGLOG_PROCESS_ERROR(piTabFile);
nHeight = piTabFile->GetHeight();
KGLOG_PROCESS_ERROR(nHeight > 1);
bRetCode = LoadQuestInfoByID(piTabFile, dwQuestID, &TempQuest);
KGLOG_PROCESS_ERROR(bRetCode);
InsRet = m_mapID2QuestInfo.insert(std::make_pair(dwQuestID, TempQuest));
KGLOG_PROCESS_ERROR(InsRet.second);
pResult = &((InsRet.first)->second);
Exit0:
KG_COM_RELEASE(piTabFile);
return pResult;
}
示例14: Init
BOOL KCampManager::Init()
{
BOOL bResult = false;
int nRetCode = 0;
ITabFile* piTabFile = NULL;
char szFileName[MAX_PATH];
char szColumn[32];
m_nScore = 0;
m_nLevel = INIT_CAMP_LEVEL; // ³õʼµÈ¼¶
snprintf(szFileName, sizeof(szFileName), "%s/%s", SETTING_DIR, "CampLevelParam.tab");
szFileName[sizeof(szFileName) - 1] = '\0';
piTabFile = g_OpenTabFile(szFileName);
KGLOG_PROCESS_ERROR(piTabFile);
for (int i = 0; i < CAMP_LEVEL_COUNT; i++)
{
snprintf(szColumn, sizeof(szColumn), "Level%d", i);
szColumn[sizeof(szColumn) - 1] = '\0';
nRetCode = piTabFile->GetInteger("Score", szColumn, 0, &m_nLevelScore[i]);
KGLOG_PROCESS_ERROR(nRetCode == 1);
}
for (int i = 0; i < CAMP_LEVEL_COUNT; ++i)
{
KGLOG_PROCESS_ERROR(m_nLevelScore[i] >= 0);
}
memset(m_nActivePlayerCount, 0, sizeof(m_nActivePlayerCount));
m_bUpdate = false;
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}
示例15: LoadTrack
BOOL KTrackList::LoadTrack(DWORD dwID, KTRACK* pTrack)
{
BOOL bResult = false;
int nRetCode = 0;
ITabFile* piTabFile = NULL;
int nTabHeight = 0;
char szFileName[MAX_PATH];
snprintf(szFileName, sizeof(szFileName), "%s/%s/track%u.tab", SETTING_DIR, TRACK_DIR, dwID);
szFileName[sizeof(szFileName) - 1] = '\0';
piTabFile = g_OpenTabFile(szFileName);
KGLOG_PROCESS_ERROR(piTabFile);
nTabHeight = piTabFile->GetHeight();
KGLOG_PROCESS_ERROR(nTabHeight >= 3);
for (int nLine = 2; nLine <= nTabHeight; nLine++)
{
KCRITICAL_POINT point;
nRetCode = piTabFile->GetInteger(nLine, COL_X, 0, &point.nX);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nRetCode = piTabFile->GetInteger(nLine, COL_Y, 0, &point.nY);
KGLOG_PROCESS_ERROR(nRetCode == 1);
nRetCode = piTabFile->GetInteger(nLine, COL_Z, 0, &point.nZ);
KGLOG_PROCESS_ERROR(nRetCode == 1);
point.nFrame = 0; // 稍后计算
pTrack->push_back(point);
}
bResult = true;
Exit0:
KG_COM_RELEASE(piTabFile);
return bResult;
}