• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ KGLogPrintf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中KGLogPrintf函数的典型用法代码示例。如果您正苦于以下问题:C++ KGLogPrintf函数的具体用法?C++ KGLogPrintf怎么用?C++ KGLogPrintf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了KGLogPrintf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: RegisterActionFunctions

BOOL KAIManager::Init()
{
    BOOL        bResult     = false;
    BOOL        bRetCode    = false;
    IIniFile*   piIniFile   = NULL;

    RegisterActionFunctions();

    KGLogPrintf(KGLOG_INFO, "[AI] loading ... ...");

    bRetCode = LoadAITabFile();
    KGLOG_PROCESS_ERROR(bRetCode);

    KGLogPrintf(KGLOG_INFO, "[AI] %u AI loaded !", m_AITable.size());

    memset(m_ActionRunTimeStatisticsArray, 0, sizeof(m_ActionRunTimeStatisticsArray));
    m_NpcAIRunTimeStatisticsMap.clear();

    m_bLogAIRuntimeStat = 0;

    piIniFile = g_OpenIniFile(GS_SETTINGS_FILENAME);
    KGLOG_PROCESS_ERROR(piIniFile);

    bRetCode = piIniFile->GetInteger("AI", "LogAIRuntimeStat", 0, &m_bLogAIRuntimeStat);
    //KGLOG_PROCESS_ERROR(bRetCode);

    bResult = true;
Exit0:
    KG_COM_RELEASE(piIniFile);
    return bResult;
}
开发者ID:zhengguo85938406,项目名称:GameWorld,代码行数:31,代码来源:KAIManager.cpp


示例2: ASSERT

int KG_GameDatabase::_GetRoleEquipmentPoint(const KG_RoleInfo &crRoleInfo, float *pfRetLevel)
{
	int nResult  = false;
	int nRetCode = false;
    int nEmptyFlag = false;
    int nTypeID = 0;
    int nItemID = 0;
    KG_EQUIPMENT_TYPE_MAP::iterator itType;
    KG_EQUIPMENT_POINT_MAP *pEquipmentPointMap = NULL;
    KG_EQUIPMENT_POINT_MAP::iterator itPoint;
    const int ARMED_BOX_ID = 0;
    const int EQUIPMENT_ID_ARRAY[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 22};

    // 装备身上所对应的BoxID为0
    // 统计身上的装备:   近战武器 远程武器 上装 帽子 项链 左手戒指 右手戒指 腰带 腰坠 下装 鞋子 护手 暗器
    // 对应的Position ID:0        1        2    3    4    5        6        7    8     9   10   11   22

    ASSERT(pfRetLevel);
    *pfRetLevel = 0;

    for (int i = 0; i < sizeof(EQUIPMENT_ID_ARRAY) / sizeof(EQUIPMENT_ID_ARRAY[0]); i++)
    {
        nRetCode = crRoleInfo.GetItemInfo(
            ARMED_BOX_ID, EQUIPMENT_ID_ARRAY[i], &nEmptyFlag, &nTypeID, &nItemID
        );
        KGLOG_PROCESS_ERROR(nRetCode && "crRoleInfo.GetItemInfo()");

        if (nEmptyFlag)
            continue;

        itType = m_EquipmentTypeMap.find(nTypeID);
        if (itType == m_EquipmentTypeMap.end())
        {
            printf("Failed to find the item, Type ID: %d, Item ID: %d\n", nTypeID, nItemID);
            KGLogPrintf(
                KGLOG_DEBUG, "Failed to find the item, Type ID: %d, Item ID: %d", nTypeID, nItemID
            );
            continue;
        }

        pEquipmentPointMap = &(itType->second);

        itPoint = pEquipmentPointMap->find(nItemID);
        if (itPoint == pEquipmentPointMap->end())
        {
            printf("Failed to find the item, Type ID: %d, Item ID: %d\n", nTypeID, nItemID);
            KGLogPrintf(
                KGLOG_DEBUG, "Failed to find the item, Type ID: %d, Item ID: %d", nTypeID, nItemID
            );
            continue;
        }

        *pfRetLevel += itPoint->second;        
    }   

	nResult = true;
Exit0:
	return nResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:59,代码来源:KG_GameDatabase.cpp


示例3: snprintf

BOOL KScriptManager::LoadScripts(ILuaScriptEx* piScript, const char cszDir[])
{
    BOOL            bResult     = false;
	BOOL			bRetCode    = false;
    HANDLE          hFind       = INVALID_HANDLE_VALUE;
    WIN32_FIND_DATA FindFileData;
    char            szPath[MAX_PATH];

    snprintf(szPath, sizeof(szPath), "%s\\*", cszDir);
    szPath[sizeof(szPath) - 1] = '\0';

    hFind = FindFirstFile(szPath, &FindFileData);
    KGLOG_PROCESS_ERROR(hFind != INVALID_HANDLE_VALUE);
	if (hFind == INVALID_HANDLE_VALUE)
	{
		KGLogPrintf(KGLOG_ERR, "[Lua] Failed to file file: %s\n", szPath);
	}
	

    do 
    {
        if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
        {
            if (strcmp(FindFileData.cFileName, ".") != 0 && strcmp(FindFileData.cFileName, "..") != 0)
            {
                snprintf(szPath, sizeof(szPath), "%s\\%s", cszDir, FindFileData.cFileName);
                szPath[sizeof(szPath) - 1] = '\0';

                LoadScripts(piScript, szPath);
            }
        }
        else
        {
            snprintf(szPath, sizeof(szPath), "%s\\%s", cszDir, FindFileData.cFileName);
            szPath[sizeof(szPath) - 1] = '\0';

            bRetCode = IsLuaScriptFile(szPath);
            if (bRetCode)
            {
                bRetCode = piScript->LoadFromFile(szPath);
                if (!bRetCode)
                {
                    KGLogPrintf(KGLOG_ERR, "[Lua] Failed to load file: %s\n", szPath);
                }
            }
        }

    } while (FindNextFile(hFind, &FindFileData));

    bResult = true;
Exit0:
    if (hFind != INVALID_HANDLE_VALUE)
    {
        FindClose(hFind);
        hFind = INVALID_HANDLE_VALUE;
    }
    return bResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:58,代码来源:KScriptManager.cpp


示例4: main

int main(int argc, char* argv[])
{
    int         nResult      = false;
    int         nRetCode     = false;  
    int         nLogInitFlag = false;
    int         nRdbFlag     = false;
    KGLOG_PARAM LogParam;  

    KSO3RoleDBUpdater* pKSO3RoleDBUpdater = NULL;

#ifdef WIN32
    SetConsoleInfo();
#endif
    setlocale(LC_ALL, "");
    g_SetRootPath(NULL);

    strncpy(LogParam.szPath, "logs", sizeof(LogParam.szPath));
    LogParam.szPath[sizeof(LogParam.szPath) - 1] = '\0';
    strncpy(LogParam.szIdent, "SO3RoleDBUpdaterTest", sizeof(LogParam.szIdent));
    LogParam.szIdent[sizeof(LogParam.szIdent) - 1] = '\0';
    LogParam.Options = (KGLOG_OPTIONS)(KGLOG_OPTION_FILE | KGLOG_OPTION_CONSOLE);
    LogParam.nMaxLineEachFile = 160000;

    nRetCode = KGLogInit(LogParam, NULL);
    KGLOG_PROCESS_ERROR(nRetCode);
    nLogInitFlag = true;  

    pKSO3RoleDBUpdater = new KSO3RoleDBUpdater();
    KGLOG_PROCESS_ERROR(pKSO3RoleDBUpdater);

    nRetCode = pKSO3RoleDBUpdater->Init();
    KGLOG_PROCESS_ERROR(nRetCode);
    nRdbFlag = true;
    KGLogPrintf(KGLOG_INFO, "SO3RoleDBUpdaterTest had started up ... ...");

    nRetCode = pKSO3RoleDBUpdater->Run();
    KGLOG_PROCESS_ERROR(nRetCode);

    KGLogPrintf(KGLOG_INFO, "SO3RoleDB UpdateTest Complete...");

    nResult = true;
Exit0:
    if (nRdbFlag)
    {
        pKSO3RoleDBUpdater->UnInit();
        nRdbFlag = false;
    }

    KG_DELETE(pKSO3RoleDBUpdater);

    if (nLogInitFlag)
    {
        KGLogUnInit(NULL);
        nLogInitFlag = false;
    }
    
    return nResult ? 0 : 1;
}
开发者ID:1suming,项目名称:pap2,代码行数:58,代码来源:Main.cpp


示例5: g_OpenFile

int KGFileManager::CompareFileByDataStream(const char cszFileName_1[], const char cszFileName_2[])
{
	int nResult  = false;
	int nRetCode = false;
	IFile* pFile_1 = NULL;
	IFile* pFile_2 = NULL;
	BYTE byData_1[SIZE_READ_BUFFER] = {0};
	BYTE byData_2[SIZE_READ_BUFFER] = {0};
	char szResult[2 * MAX_PATH] = {0};

	pFile_1 = g_OpenFile(cszFileName_1);
	KGLOG_PROCESS_ERROR(pFile_1);
	pFile_2 = g_OpenFile(cszFileName_2);
	KGLOG_PROCESS_ERROR(pFile_2);

	if (pFile_1->Size() != pFile_2->Size())
	{
		nRetCode = _snprintf_s(
			szResult, 
			sizeof(szResult),
			sizeof(szResult) - 1,
			"Size Differ. File_1=%s File_2=%s",
			cszFileName_1,
			cszFileName_2
			);
		KGLOG_PROCESS_ERROR(nRetCode > 0);
		KGLogPrintf(KGLOG_ERR, szResult);
		KGLOG_PROCESS_ERROR(false);
	}

	for (ULONG i = 0; i < pFile_1->Size(); i += SIZE_READ_BUFFER)
	{
		pFile_1->Read(byData_1, SIZE_READ_BUFFER);
		pFile_2->Read(byData_2, SIZE_READ_BUFFER);
		nRetCode = memcmp(byData_1, byData_2, SIZE_READ_BUFFER);
		if (nRetCode != 0)
		{
			nRetCode = _snprintf_s(
				szResult, 
				sizeof(szResult),
				sizeof(szResult) - 1,
				"File Data Differ. File_1=%s File_2=%s",
				cszFileName_1,
				cszFileName_2
				);
			KGLOG_PROCESS_ERROR(nRetCode > 0);
			KGLogPrintf(KGLOG_ERR, szResult);
			KGLOG_PROCESS_ERROR(false);
		}
	}

	nResult = true;
Exit0:
	KG_COM_RELEASE(pFile_1);
	KG_COM_RELEASE(pFile_2);
	return nResult;
}
开发者ID:1suming,项目名称:pap2,代码行数:57,代码来源:KGFileManager.cpp


示例6: GetFileInfo

int KHttpFile::Download()
{
    int nRetCode    = false;
    int nResult     = false;
    int nRetryCount = 0;

    nRetCode = GetFileInfo();
    KGLOG_PROCESS_ERROR(nRetCode);

    while (nRetryCount <= 5)
    {
        if (m_nFileSize == m_nDownloadedSize)
        {
            m_nErrorCode = dec_err_success;
            goto Exit1;
        }

        nRetCode = m_Downloader.Download(m_strUrl.c_str(), m_strFile.c_str());
        switch(nRetCode)
        {
        case HTTP_RESULT_SUCCESS:
        case HTTP_RESULT_SAMEAS:
            m_nErrorCode = dec_err_success;
            goto Exit1;
            break;

        case HTTP_RESULT_STOP:
            m_nErrorCode = dec_err_stop;
            goto Exit0;
            break;

        case HTTP_RESULT_FAIL:
            m_nErrorCode = dec_err_disconnection;
            KGLogPrintf(KGLOG_INFO, "disconnection retry %d", nRetryCount++);
            Sleep(5000);
            break;

        case HTTP_RESULT_REDIRECT_FTP:
        case HTTP_RESULT_REDIRECT_HTTP:
            m_nErrorCode = dec_err_cannotconnect;
            KGLogPrintf(KGLOG_INFO, "cannotconnect retry %d", nRetryCount++);
            Sleep(5000);
            break;

        default:
            m_nErrorCode = dec_err_cannotconnect;
            KGLOG_PROCESS_ERROR(false && "unknow result");
            break;
        }
    }

Exit1:
    nResult = true;
Exit0:
    KGLogPrintf(KGLOG_INFO, "download result= %d, filename = %s", m_nErrorCode, m_strFile.c_str());
    return nResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:57,代码来源:KHttpFile.cpp


示例7: Lua_GetTopIndex

int KAILogic::LuaNewAction(Lua_State* L)
{
    int         nResult     = 0;
    int         nRetCode    = 0;
    int         nActionID   = KAI_ACTION_ID_NONE;
    int         nActionKey  = eakInvalid;
    KAIAction*  pActionData = NULL;
    std::pair<KAI_ACTION_TABLE::iterator, bool> RetPair;

    nRetCode = Lua_GetTopIndex(L);
    KGLOG_PROCESS_ERROR(nRetCode == 2);

    nActionID = (int)Lua_ValueToNumber(L, 1);
    KGLOG_PROCESS_ERROR(nActionID > KAI_ACTION_ID_NONE);

    nActionKey = (int)Lua_ValueToNumber(L, 2);
    KGLOG_PROCESS_ERROR(nActionKey > eakInvalid);

    if (nActionKey < KAI_USER_ACTION)
    {
        KAI_ACTION_FUNC PAction  = NULL;

        PAction = g_pSO3World->m_AIManager.GetActionFunction(nActionKey);
        if (PAction == NULL)
        {
            KGLogPrintf(KGLOG_ERR, "[AI] Unregistered sys action(ID: %d, Key: %d) in ai %d\n", nActionID, nActionKey, m_nAIType);
            goto Exit0;
        }
    }
    else
    {
        KUSER_ACTION_TABLE::iterator it = m_UserActionTable.find(nActionKey);

        if (it == m_UserActionTable.end())
        {
            KGLogPrintf(KGLOG_ERR, "[AI] Unregistered lua actionID: %d, Key: %d) in ai %d\n", nActionID, nActionKey, m_nAIType);
            goto Exit0;
        }
    }

    RetPair = m_ActionTable.insert(std::make_pair(nActionID, KAIAction()));
    if (!RetPair.second)
    {
        KGLogPrintf(KGLOG_ERR, "[AI] Duplicated AI action(%d) in ai %d\n", nActionID, m_nAIType);
        goto Exit0;
    }

    pActionData = &(RetPair.first->second);

    pActionData->m_nKey = nActionKey;

    nResult = pActionData->LuaGetObj(L);
Exit0:
    return nResult;
}
开发者ID:zhengguo85938406,项目名称:GameWorld,代码行数:55,代码来源:KAILogic.cpp


示例8: _tWinMain

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
    int nResult  = false;
    int nRetCode = false;
    int nKGLogInitFlag = false;
    KGLOG_PARAM KGLogParm = {"logs", "GameUpdater", KGLOG_OPTION_FILE, 1000 * 10};
    int nGameUpdaterInitFlag = false;
    KGU_GameUpdater GameUpdater;
    TCHAR szApplicationName[MAX_PATH];
    TCHAR szCurrentDir[MAX_PATH];    

    nRetCode = _SetCurrentDirectory();
    KG_PROCESS_ERROR(nRetCode);

    nRetCode = KGLogInit(KGLogParm, NULL);
    KG_PROCESS_ERROR(nRetCode);
    nKGLogInitFlag = true;

    // Log the build time which is useful for debugging.
    KGLogPrintf(KGLOG_INFO, "The gameupdater.exe is built at "__DATE__" "__TIME__"\n");

    // Log the application name, which could be distinguished the client is main version or child version.
    nRetCode = GetModuleFileName(NULL, szApplicationName, _countof(szApplicationName));
    KGLOG_PROCESS_ERROR(nRetCode > 0);
    KGLOG_PROCESS_ERROR(nRetCode < _countof(szApplicationName));
    KGLogPrintf(KGLOG_INFO, "The full file name is `%s`", szApplicationName);

    // Log the current working path, which is useful for debugging.
    nRetCode = GetCurrentDirectory(_countof(szCurrentDir), szCurrentDir);
    KGLOG_PROCESS_ERROR(nRetCode > 0);
    KGLOG_PROCESS_ERROR(nRetCode < _countof(szCurrentDir));
    KGLogPrintf(KGLOG_INFO, "The current working path is `%s`", szCurrentDir);

    nRetCode = GameUpdater.Init(lpCmdLine, NULL);
    KGLOG_PROCESS_ERROR(nRetCode && "Init()");
    nGameUpdaterInitFlag = true;

    nRetCode = GameUpdater.Run();
    KGLOG_PROCESS_ERROR(nRetCode && "Run()");
    
    nResult = true;
Exit0:
    if (nGameUpdaterInitFlag)
    {
        GameUpdater.UnInit(NULL);
        nGameUpdaterInitFlag = false;
    }
    if (nKGLogInitFlag)
    {
        KGLogUnInit(NULL);
        nKGLogInitFlag = false;
    }
    return nResult ? 0 : 1;
}
开发者ID:viticm,项目名称:pap2,代码行数:54,代码来源:main.cpp


示例9: assert

void KAIVM::DebugAICurrentStateInfo()
{
    assert(m_pState);

    KGLogPrintf(KGLOG_DEBUG, "[AI] DebugAI : AIType is %d, Current StateID is %d, ActionID is %d.\n", m_nAIType, m_nStateID, m_nActionID);
    KGLogPrintf(KGLOG_DEBUG, "[AI] DebugAI : nGameLoop is %lu\n", g_pSO3World->m_nGameLoop);
    KGLogPrintf(KGLOG_DEBUG, "[AI] DebugAI : PrimaryTimer is %lu\n", m_nPrimaryTimerFrame);
    KGLogPrintf(KGLOG_DEBUG, "[AI] DebugAI : SecondaryTimer is %lu\n", m_nSecondaryTimerFrame);
    KGLogPrintf(KGLOG_DEBUG, "[AI] DebugAI : TertiaryTimer is %lu\n", m_nTertiaryTimerFrame);
    m_pState->DebugStateInfo();

    return;
}
开发者ID:1suming,项目名称:pap2,代码行数:13,代码来源:KAIVM.cpp


示例10: _ASSERTE

void KGTestLoadMaterial::TestLoadOneMtlFile(const char cszFileName[])
{
	HRESULT hrRetCode = E_FAIL;
	KG3DMaterial* pMaterial = NULL;

	_ASSERTE(cszFileName);

	KGLogPrintf(KGLOG_INFO, "Test Load Mtl: %s", cszFileName);

	hrRetCode = m_pMtlTable->LoadResourceFromFile(cszFileName, 0, 0, (IKG3DResourceBase**)&pMaterial);
	if (FAILED(hrRetCode) || pMaterial == NULL)
	{
		m_vecLoadFailedMtl.push_back(cszFileName);
	}
	else
	{
		KG3DMaterial::KG3DMaterialSubset* pSubset = NULL;
		bool bNoAnyTex = false;
		for (size_t i = 0; i < pMaterial->m_dwNumMaterials; i++)
		{
			pMaterial->GetSubMaterial((DWORD)i, (PVOID*)&pSubset);
			if (pSubset->m_dwNumUsedTexture != 0)
			{
				bNoAnyTex = true;
			}
		}
		if (!bNoAnyTex)
		{
			TextureInfoMap TexNames;
			m_mapErrorMtlFileInfo.insert(make_pair(cszFileName, TexNames));
			m_mapErrorMtlFileInfo[cszFileName].insert(make_pair("", NO_ANY_TEX));
		}
	}
	if (pMaterial)
	{
		//这里要注意加参数RELEASE_ATONCE,以便立即释放资源,默认是放入释放队列(RELEASE_INQUEUE)
		//否则内存中会一直占用释一定数量的资源,数量等于释放资源队列的大小
		hrRetCode = m_pMtlTable->ReleaseResource((KG3DMaterial*)pMaterial, RELEASE_ATONCE);
		if (FAILED(hrRetCode))
		{
			KGLogPrintf(KGLOG_ERR, "Release Mtl Failed!");
		}
		else
		{
			pMaterial = NULL;
		}
	}
	KGLogPrintf(KGLOG_INFO, "End Load Test");
}
开发者ID:1suming,项目名称:pap2,代码行数:49,代码来源:KGTestLoadMaterial.cpp


示例11: snprintf

BOOL KSO3RoleDBTools::CheckMailTable()
{
    BOOL                bResult     = false;
    BOOL                bRetCode    = 0;
    int                 nStrLen     = 0;

    nStrLen = snprintf(m_szSQL, sizeof(m_szSQL), 
        "create table if not exists %s( "
        "   ID           bigint     not null, "
        "   BaseTime     datetime   not null, "
        "   MailBoxInfo  mediumblob not null, "
        "   primary key (ID), index (ID, BaseTime) "
        "); ",
        MAIL_TABLE_NAME
    );
    KGLOG_PROCESS_ERROR(nStrLen > 0 && nStrLen < (int)sizeof(m_szSQL));

    bRetCode = DoQuery(m_szSQL);
    if (!bRetCode)
    {
        KGLogPrintf(
            KGLOG_ERR, 
            "DB ERROR when try to create table \'%s\'\n", 
            MAIL_TABLE_NAME
        );
        goto Exit0;
    }

    bResult = true;
Exit0:
    return bResult;
}
开发者ID:1suming,项目名称:pap2,代码行数:32,代码来源:KSO3RoleDBTools.cpp


示例12: GetTemplate

BOOL KDoodadTemplateList::LoadFromTemplate(DWORD dwTemplateID, KDoodad* pDoodad)
{
    BOOL                bResult     = false;
	BOOL                bRetCode    = false;
	KDoodadTemplate*    pTemplate   = NULL;

	pTemplate = GetTemplate(dwTemplateID);
	if (pTemplate == NULL)
	{
        KGLogPrintf(KGLOG_ERR, "Invalid doodad template: %u\n", dwTemplateID);

		pTemplate = GetTemplate(0);
		KGLOG_PROCESS_ERROR(pTemplate);
	}

	pDoodad->m_dwTemplateID     = dwTemplateID;
	pDoodad->m_eKind            = pTemplate->m_eKind;
	pDoodad->m_nOpenFrames      = pTemplate->m_dwOpenPrepareFrame;
	pDoodad->m_dwRepresentID    = pTemplate->m_dwRepresentID;
	pDoodad->m_pTemplate        = pTemplate;

	if (pTemplate->szScript[0] != '\0')
	{
		pDoodad->m_dwScriptID = g_FileNameHash(pTemplate->szScript);
	}

	strncpy(pDoodad->m_szName, pTemplate->m_szName, _NAME_LEN);
	pDoodad->m_szName[_NAME_LEN - 1] = 0;

	bResult = true;
Exit0:
	return bResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:33,代码来源:KDoodadTemplateList.cpp


示例13: switch

HRESULT KG3DGraphicsEngine::CheckDevice()
{
	HRESULT hr = S_OK;
    
    if (m_bDeviceLost)
    {
        hr = g_pd3dDevice->TestCooperativeLevel();
        switch (hr)
        {
        case D3D_OK:
            break;
        case D3DERR_DEVICELOST:
            Sleep(50);
            break;
        case D3DERR_DEVICENOTRESET:
            hr = Reset();
            KG_COM_PROCESS_ERROR(hr);
            break;
        case D3DERR_DRIVERINTERNALERROR:
            KGLogPrintf(KGLOG_ERR, "D3DERR_DRIVERINTERNALERROR\n");
            break;
        }
    }

Exit0:
    if (hr == D3DERR_DEVICELOST)
        m_bDeviceLost = true;
    else
        KGLOG_COM_CHECK_ERROR(hr);
	return hr;
}
开发者ID:1suming,项目名称:pap2,代码行数:31,代码来源:KG3DGraphiceEngine.cpp


示例14: KG_RemoveOldRewardData

int KG_RemoveOldRewardData(MYSQL *pMySQL, int nActivityID)
{
	int nResult  = false;
	int nRetCode = false;
    char szQuery[256];

    KGLOG_PROCESS_ERROR(pMySQL);

    nRetCode = snprintf(szQuery, sizeof(szQuery), "delete from `Activity` where Type = %d", nActivityID);
    KGLOG_PROCESS_ERROR(nRetCode > 0);
    KGLOG_PROCESS_ERROR(nRetCode < sizeof(szQuery));

    nRetCode = mysql_real_query(pMySQL, szQuery, (unsigned long)strlen(szQuery));
    KGD_MYSQL_PROCESS_ERROR(nRetCode == 0, pMySQL, szQuery);

    nRetCode = (int)mysql_affected_rows(pMySQL);
    if (nRetCode > 0)
    {
        printf("! There are %d rows of activity %d been removed\n", nRetCode, nActivityID);
        KGLogPrintf(KGLOG_INFO, "There are %d rows of activity %d been removed\n", nRetCode, nActivityID);
    }

	nResult = true;
Exit0:
	return nResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:26,代码来源:KG_Public.cpp


示例15: KGLogPrintf

int KGPostRenderTestingMgr::Run()
{
	HRESULT hrRetCode = E_FAIL;
	int nRetCode	  = false;
	int nResult		  = false;
	

 	for (size_t i = 0; i < m_vecTestCases.size(); i++)
 	{
 		KGTestEffect* pTestEffect = NULL;
 		pTestEffect = m_vecTestCases[i];
 		if (pTestEffect)
 		{
 			nRetCode = pTestEffect->Run();
			if (!nRetCode)
			{
				KGLogPrintf(KGLOG_ERR, "%s Testing run failed.", pTestEffect->GetCaseName().c_str());
			}
 			pTestEffect->UnInit();
 			SAFE_DELETE(pTestEffect);
 			hrRetCode = m_pEngineMgr->SetEngineOption(&m_EngineOption);
 			KGLOG_COM_PROCESS_ERROR(hrRetCode);
 		}
 	}
 	m_vecTestCases.clear();

	nResult = true;
Exit0:
	return nResult;
}
开发者ID:1suming,项目名称:pap2,代码行数:30,代码来源:KGPostRenderTestingMgr.cpp


示例16: CreateFile

BOOL KProcessLock::CreateLock(const char cszLockName[])
{
    BOOL bResult    = false;
    BOOL bRetCode   = false;

    m_hLockFile = CreateFile(cszLockName, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_ALWAYS, 0, 0);
    KGLOG_PROCESS_ERROR(m_hLockFile != INVALID_HANDLE_VALUE);

    bRetCode = LockFile(m_hLockFile, 0, 0, 1, 0);

    if (!bRetCode)
    {
        KGLogPrintf(KGLOG_ERR, "Already start another process!");
        goto Exit0;
    }

    bResult = true;
Exit0:
    if (!bResult && m_hLockFile != INVALID_HANDLE_VALUE)
    {
        CloseHandle(m_hLockFile);
        m_hLockFile =INVALID_HANDLE_VALUE;
    }
    return bResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:25,代码来源:KProcessLock.cpp


示例17: KGLogPrintf

void KDownloadUpdatePackage::ProcessDownloadError(const TCHAR szFile[], int nError)
{
	KGLogPrintf(KGLOG_INFO, "Download File: %s , errcode = %d", szFile, nError);

	switch (nError)
	{
	case dec_err_success:
		break;
	case dec_err_notstart:
		break;
	case dec_err_stop:
		break;
	case dec_err_url:
	case dec_err_cannotconnect:
		KLastError::SetErrorCode(UPDATE_ERR_CANNOT_CONNECT_SERVER);
		break;
	case dec_err_disconnection:
		KLastError::SetErrorCode(UPDATE_ERR_DISCONNECTION);
		break;
	case dec_err_noenoughdiskspace:
		KLastError::SetErrorCode(UPDATE_ERR_NO_ENOUGH_DISK_SPACE);
		break;
	case dec_err_cannotdownload:
		KLastError::SetErrorCode(UPDATE_ERR_NOT_FOUND_DOWNLOAD_FILE);
		break;
	case dec_err_writefileerror:
		KLastError::SetErrorCode(UPDATE_ERR_WRITE_FILE_ERROR);
		break;
	default:
		break;
	}
}
开发者ID:viticm,项目名称:pap2,代码行数:32,代码来源:KDownloadUpdatePackage.cpp


示例18: KGLOG_PROCESS_ERROR

BOOL KProcessLock::CreateLock(const char cszLockName[])
{
    BOOL            bResult     = false;
    int             nRetCode    = 0;
    struct flock    LockInfo;

    KGLOG_PROCESS_ERROR(m_nLockFile == -1);

    m_nLockFile = creat(cszLockName, S_IRWXU);
    KGLOG_PROCESS_ERROR(m_nLockFile != -1);

    LockInfo.l_type   = F_WRLCK;
    LockInfo.l_whence = SEEK_SET;
    LockInfo.l_start  = 0;
    LockInfo.l_len    = 0;

    nRetCode = fcntl(m_nLockFile, F_SETLK, &LockInfo);

    if (nRetCode == -1)
    {
        KGLOG_PROCESS_ERROR (errno == EACCES || errno == EAGAIN);
        KGLogPrintf(KGLOG_ERR, "Already start another process!");
        goto Exit0;
    }

    bResult = true;
Exit0:
    if (!bResult && m_nLockFile != -1)
    {
        close(m_nLockFile);
        m_nLockFile = -1;
    }
    return bResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:34,代码来源:KProcessLock.cpp


示例19: KGLOG_PROCESS_ERROR

void KWndTexture::RenderCallback(DWORD dwTextureID, void* pUserData)
{
    HRESULT hr = E_FAIL;
	KWndTexture* pWndTexture = NULL;
    BOOL bBeginRenderToTexture = FALSE;
    
    pWndTexture = reinterpret_cast<KWndTexture*>(pUserData);
    KGLOG_PROCESS_ERROR(pWndTexture);

    hr = g_pUI->m_p3DUI->BeginRenderToTexture(dwTextureID, 0);
    KG_COM_PROCESS_ERROR(hr);

    bBeginRenderToTexture = TRUE;

    pWndTexture->OnPaint();

Exit0:
    if (hr == D3DERR_DRIVERINTERNALERROR || hr == D3DERR_INVALIDCALL)
    {
        KGLogPrintf(KGLOG_ERR, "KGUI KWndTexture::RenderCallback %u.\n", hr);

        PostMessage(g_pUI->m_hWnd, WM_QUIT, 0, 0);
    }
    if (bBeginRenderToTexture)
    {
        hr = g_pUI->m_p3DUI->EndRenderToTexture();
        KGLOG_COM_CHECK_ERROR(hr);
    }
}
开发者ID:1suming,项目名称:pap2,代码行数:29,代码来源:wndtexture.cpp


示例20: _sntprintf

int KTestDownloadPack::CheckAndDelZip(const int cnPackNum)
{
	int nRetCode = false;
	int nResult  = false;
	TCHAR szPackName[MAX_PATH];
	//验证每个包的MD5
	for (int nIndex = 0; nIndex < cnPackNum; nIndex++)
	{
		nRetCode = _sntprintf(szPackName, MAX_PATH, _T("%s\\%s"), g_szTestingSpaceDir, ZIP_FILE_LIST[nIndex]);
		KGLOG_PROCESS_ERROR(nRetCode != 1);
		szPackName[MAX_PATH - 1] = _T('\0');
		nRetCode = KTestCommon::ValidateFileMD5(szPackName, ZIP_MD5_LIST[nIndex]);
		KGLOG_PROCESS_ERROR(nRetCode);
		nRetCode = ::DeleteFile(szPackName);
		KGLOG_PROCESS_ERROR(nRetCode);
	}

	nResult = true;
Exit0:
	if (!nResult)
	{
		KGLogPrintf(KGLOG_ERR, "ZIP NAME: %s", szPackName);
	}
	return nResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:25,代码来源:KTestDownloadPack.cpp



注:本文中的KGLogPrintf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ KGSL_CORE_ERR函数代码示例发布时间:2022-05-30
下一篇:
C++ KGLOG_PROCESS_ERROR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap