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

C++ AppendDebugLog函数代码示例

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

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



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

示例1: HashNick

void ResNickMan::AddReservedNick(const char * sNick, const bool &bFromScript/* = false*/) {
    uint32_t ulHash = HashNick(sNick, strlen(sNick));

    if(CheckReserved(sNick, ulHash) == false) {
        ReservedNick * pNewNick = new ReservedNick(sNick, ulHash);
        if(pNewNick == NULL) {
			AppendDebugLog("%s - [MEM] Cannot allocate pNewNick in ResNickMan::AddReservedNick\n", 0);
        	return;
        } else if(pNewNick->sNick == NULL) {
            delete pNewNick;

			AppendDebugLog("%s - [MEM] Cannot allocate pNewNick->sNick in ResNickMan::AddReservedNick\n", 0);
        	return;
        }

        if(ReservedNicks == NULL) {
            ReservedNicks = pNewNick;
        } else {
            ReservedNicks->prev = pNewNick;
            pNewNick->next = ReservedNicks;
            ReservedNicks = pNewNick;
        }

        pNewNick->bFromScript = bFromScript;
    }
}
开发者ID:sidcode,项目名称:PtokaX,代码行数:26,代码来源:ResNickManager.cpp


示例2: AppendDebugLog

void classUsers::AddBot2NickList(char * Nick, const size_t &szNickLen, const bool &isOp) {
    // $NickList nick$$nick2$$|

    if(nickListSize < nickListLen+szNickLen+2) {
        char * pOldBuf = nickList;
#ifdef _WIN32
        nickList = (char *)HeapReAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)pOldBuf, nickListSize+NICKLISTSIZE+1);
#else
		nickList = (char *)realloc(pOldBuf, nickListSize+NICKLISTSIZE+1);
#endif
        if(nickList == NULL) {
            nickList = pOldBuf;

			AppendDebugLog("%s - [MEM] Cannot reallocate %" PRIu64 " bytes in classUsers::AddBot2NickList for NickList\n", (uint64_t)(nickListSize+NICKLISTSIZE+1));

            return;
		}
        nickListSize += NICKLISTSIZE;
    }

    memcpy(nickList+nickListLen-1, Nick, szNickLen);
    nickListLen += (uint32_t)(szNickLen+2);

    nickList[nickListLen-3] = '$';
    nickList[nickListLen-2] = '$';
    nickList[nickListLen-1] = '|';
    nickList[nickListLen] = '\0';

    iZNickListLen = 0;

    if(isOp == false)
        return;

    if(opListSize < opListLen+szNickLen+2) {
        char * pOldBuf = opList;
#ifdef _WIN32
        opList = (char *)HeapReAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)pOldBuf, opListSize+OPLISTSIZE+1);
#else
		opList = (char *)realloc(pOldBuf, opListSize+OPLISTSIZE+1);
#endif
        if(opList == NULL) {
            opList = pOldBuf;

            AppendDebugLog("%s - [MEM] Cannot reallocate %" PRIu64 " bytes in classUsers::AddBot2NickList for opList\n", (uint64_t)(opListSize+OPLISTSIZE+1));

            return;
        }
        opListSize += OPLISTSIZE;
    }

    memcpy(opList+opListLen-1, Nick, szNickLen);
    opListLen += (uint32_t)(szNickLen+2);

    opList[opListLen-3] = '$';
    opList[opListLen-2] = '$';
    opList[opListLen-1] = '|';
    opList[opListLen] = '\0';

    iZOpListLen = 0;
}
开发者ID:anandanwar4,项目名称:PtokaX,代码行数:60,代码来源:colUsers.cpp


示例3: while

void clsEventQueue::AddNormal(uint8_t ui8Id, char * sMsg) {
	if(ui8Id != EVENT_RSTSCRIPT && ui8Id != EVENT_STOPSCRIPT) {
		event * next = NormalS;

		while(next != NULL) {
			event * cur = next;
			next = cur->next;

			if(cur->ui8Id == ui8Id) {
                return;
            }
		}
	}

    event * pNewEvent = new event();

	if(pNewEvent == NULL) {
		AppendDebugLog("%s - [MEM] Cannot allocate pNewEvent in clsEventQueue::AddNormal\n", 0);
        return;
    }

    if(sMsg != NULL) {
        size_t szLen = strlen(sMsg);
#ifdef _WIN32
		pNewEvent->sMsg = (char *)HeapAlloc(clsServerManager::hLibHeap, HEAP_NO_SERIALIZE, szLen+1);
#else
		pNewEvent->sMsg = (char *)malloc(szLen+1);
#endif
		if(pNewEvent->sMsg == NULL) {
            delete pNewEvent;

			AppendDebugLog("%s - [MEM] Cannot allocate %" PRIu64 " bytes for pNewEvent->sMsg in clsEventQueue::AddNormal\n", (uint64_t)(szLen+1));

            return;
        }

        memcpy(pNewEvent->sMsg, sMsg, szLen);
        pNewEvent->sMsg[szLen] = '\0';
    } else {
		pNewEvent->sMsg = NULL;
    }

    pNewEvent->ui8Id = ui8Id;

    if(NormalS == NULL) {
        NormalS = pNewEvent;
        pNewEvent->prev = NULL;
    } else {
        pNewEvent->prev = NormalE;
        NormalE->next = pNewEvent;
    }

    NormalE = pNewEvent;
    pNewEvent->next = NULL;
}
开发者ID:NIT-Warangal,项目名称:LibSys,代码行数:55,代码来源:eventqueue.cpp


示例4: strlen

void classUsers::AddBot2MyInfos(char * MyInfo) {
	size_t len = strlen(MyInfo);
	if(myInfosTag != NULL) {
	    if(strstr(myInfosTag, MyInfo) == NULL ) {
            if(myInfosTagSize < myInfosTagLen+len) {
                char * pOldBuf = myInfosTag;
#ifdef _WIN32
                myInfosTag = (char *)HeapReAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)pOldBuf, myInfosTagSize+MYINFOLISTSIZE+1);
#else
				myInfosTag = (char *)realloc(pOldBuf, myInfosTagSize+MYINFOLISTSIZE+1);
#endif
                if(myInfosTag == NULL) {
                    myInfosTag = pOldBuf;

					AppendDebugLog("%s - [MEM] Cannot reallocate %" PRIu64 " bytes for myInfosTag in classUsers::AddBot2MyInfos\n", (uint64_t)(myInfosTagSize+MYINFOLISTSIZE+1));

                    return;
                }
                myInfosTagSize += MYINFOLISTSIZE;
            }
        	memcpy(myInfosTag+myInfosTagLen, MyInfo, len);
            myInfosTagLen += (uint32_t)len;
            myInfosTag[myInfosTagLen] = '\0';
            iZMyInfosLen = 0;
        }
    }
    if(myInfos != NULL) {
    	if(strstr(myInfos, MyInfo) == NULL ) {
            if(myInfosSize < myInfosLen+len) {
                char * pOldBuf = myInfos;
#ifdef _WIN32
                myInfos = (char *)HeapReAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)pOldBuf, myInfosSize+MYINFOLISTSIZE+1);
#else
				myInfos = (char *)realloc(pOldBuf, myInfosSize+MYINFOLISTSIZE+1);
#endif
                if(myInfos == NULL) {
                    myInfos = pOldBuf;

					AppendDebugLog("%s - [MEM] Cannot reallocate %" PRIu64 " bytes for myInfos in classUsers::AddBot2MyInfos\n", (uint64_t)(myInfosSize+MYINFOLISTSIZE+1));

                    return;
                }
                myInfosSize += MYINFOLISTSIZE;
            }
        	memcpy(myInfos+myInfosLen, MyInfo, len);
            myInfosLen += (uint32_t)len;
            myInfos[myInfosLen] = '\0';
            iZMyInfosTagLen = 0;
         }
    }
}
开发者ID:anandanwar4,项目名称:PtokaX,代码行数:51,代码来源:colUsers.cpp


示例5: QueueItem

void GlobalDataQueue::InsertQueueItem(char * sCommand, const size_t &szLen, void * pBeforeItem, const uint8_t &ui8CmdType) {
    QueueItem * pNewItem = new QueueItem();
    if(pNewItem == NULL) {
		AppendDebugLog("%s - [MEM] Cannot allocate pNewItem in GlobalDataQueue::InsertQueueItem\n", 0);
    	return;
    }

#ifdef _WIN32
    pNewItem->sCommand1 = (char *)HeapAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, szLen);
#else
	pNewItem->sCommand1 = (char *)malloc(szLen+1);
#endif
    if(pNewItem->sCommand1 == NULL) {
        delete pNewItem;

		AppendDebugLog("%s - [MEM] Cannot allocate %" PRIu64 " bytes for pNewItem->sCommand1 in GlobalDataQueue::InsertQueueItem\n", (uint64_t)(szLen+1));

        return;
    }

    memcpy(pNewItem->sCommand1, sCommand, szLen);
    pNewItem->sCommand1[szLen] = '\0';

	pNewItem->szLen1 = szLen;

    pNewItem->sCommand2 = NULL;
    pNewItem->szLen2 = 0;

	pNewItem->ui8CommandType = ui8CmdType;

	pNewItem->pNext = (QueueItem *)pBeforeItem;

    QueueItem * pNext = pNewQueueItems[0];
    if(pNext == pBeforeItem) {
        pNewQueueItems[0] = pNewItem;
        return;
    }

    while(pNext != NULL) {
        QueueItem * pCur = pNext;
        pNext = pCur->pNext;

        if(pNext == pBeforeItem) {
            pCur->pNext = pNewItem;
            return;
        }
    }
}
开发者ID:rajatu,项目名称:DCLibPort,代码行数:48,代码来源:GlobalDataQueue.cpp


示例6: sprintf

// appends data to the OpListQueue
void clsGlobalDataQueue::OpListStore(char * sNick) {
    if(OpListQueue.szLen == 0) {
        OpListQueue.szLen = sprintf(OpListQueue.sBuffer, "$OpList %s$$|", sNick);
    } else {
        int iDataLen = sprintf(msg, "%s$$|", sNick);
        if(CheckSprintf(iDataLen, 128, "clsGlobalDataQueue::OpListStore2") == true) {
            if(OpListQueue.szSize < OpListQueue.szLen+iDataLen) {
                size_t szAllignLen = Allign256(OpListQueue.szLen+iDataLen);
                char * pOldBuf = OpListQueue.sBuffer;
#ifdef _WIN32
                OpListQueue.sBuffer = (char *)HeapReAlloc(clsServerManager::hLibHeap, HEAP_NO_SERIALIZE, (void *)pOldBuf, szAllignLen);
#else
				OpListQueue.sBuffer = (char *)realloc(pOldBuf, szAllignLen);
#endif
                if(OpListQueue.sBuffer == NULL) {
                    OpListQueue.sBuffer = pOldBuf;

                    AppendDebugLog("%s - [MEM] Cannot reallocate %" PRIu64 " bytes in clsGlobalDataQueue::OpListStore\n", (uint64_t)szAllignLen);

                    return;
                }
                OpListQueue.szSize = (uint32_t)(szAllignLen-1);
            }
            memcpy(OpListQueue.sBuffer+OpListQueue.szLen-1, msg, iDataLen);
            OpListQueue.szLen += iDataLen-1;
            OpListQueue.sBuffer[OpListQueue.szLen] = '\0';
        }
    }
}
开发者ID:NIT-Warangal,项目名称:LibSys,代码行数:30,代码来源:GlobalDataQueue.cpp


示例7: UserClose

void classUsers::Add2OpList(User * u) {
    if(opListSize < opListLen+u->ui8NickLen+2) {
        char * pOldBuf = opList;
#ifdef _WIN32
        opList = (char *)HeapReAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)pOldBuf, opListSize+OPLISTSIZE+1);
#else
		opList = (char *)realloc(pOldBuf, opListSize+OPLISTSIZE+1);
#endif
        if(opList == NULL) {
            opList = pOldBuf;
            u->ui32BoolBits |= User::BIT_ERROR;
            UserClose(u);

            AppendDebugLog("%s - [MEM] Cannot reallocate %" PRIu64 " bytes in classUsers::Add2OpList for opList\n", (uint64_t)(opListSize+OPLISTSIZE+1));

            return;
        }
        opListSize += OPLISTSIZE;
    }

    memcpy(opList+opListLen-1, u->sNick, u->ui8NickLen);
    opListLen += (uint32_t)(u->ui8NickLen+2);

    opList[opListLen-3] = '$';
    opList[opListLen-2] = '$';
    opList[opListLen-1] = '|';
    opList[opListLen] = '\0';

    iZOpListLen = 0;
}
开发者ID:anandanwar4,项目名称:PtokaX,代码行数:30,代码来源:colUsers.cpp


示例8: AppendDebugLog

string & string::operator+=(const string & sStr) {
    if(sStr.c_str() == sEmpty) {
        return *this;
    }

    char * oldbuf = sData;

    if(sData == sEmpty) {
        sData = (char *)malloc(szDataLen+sStr.size()+1);
    } else {
        sData = (char *)realloc(oldbuf, szDataLen+sStr.size()+1);
    }

    if(sData == NULL) {
        sData = oldbuf;

        AppendDebugLog("%s - [MEM] Cannot allocate %" PRIu64 " bytes for sData in string::operator+=(string)\n", (uint64_t)(szDataLen+sStr.size()+1));

        return *this;
    }

    memcpy(sData+szDataLen, sStr.c_str(), sStr.size());
	szDataLen += sStr.size();
	sData[szDataLen] = '\0';

    return *this;
}
开发者ID:NIT-Warangal,项目名称:LibSys,代码行数:27,代码来源:pxstring.cpp


示例9: new

ReservedNicksManager::ReservedNick * ReservedNicksManager::ReservedNick::CreateReservedNick(const char * sNewNick, const uint32_t ui32NickHash) {
    ReservedNick * pReservedNick = new (std::nothrow) ReservedNick();

    if(pReservedNick == NULL) {
        AppendDebugLog("%s - [MEM] Cannot allocate new pReservedNick in ReservedNick::CreateReservedNick\n");

        return NULL;
    }

    size_t szNickLen = strlen(sNewNick);
#ifdef _WIN32
    pReservedNick->m_sNick = (char *)HeapAlloc(ServerManager::m_hPtokaXHeap, HEAP_NO_SERIALIZE, szNickLen+1);
#else
	pReservedNick->m_sNick = (char *)malloc(szNickLen+1);
#endif
    if(pReservedNick->m_sNick == NULL) {
        AppendDebugLogFormat("[MEM] Cannot allocate %zu bytes in ReservedNick::CreateReservedNick\n", szNickLen+1);

        delete pReservedNick;
        return NULL;
    }
    memcpy(pReservedNick->m_sNick, sNewNick, szNickLen);
    pReservedNick->m_sNick[szNickLen] = '\0';

	pReservedNick->m_ui32Hash = ui32NickHash;

    return pReservedNick;
}
开发者ID:HiT-Hi-FiT-Hai,项目名称:PtokaX,代码行数:28,代码来源:ResNickManager.cpp


示例10: strlen

string & string::operator+=(const char * sTxt) {
    size_t szLen = strlen(sTxt);

    char * oldbuf = sData;

    if(sData == sEmpty) {
        sData = (char *)malloc(szDataLen+szLen+1);
    } else {
        sData = (char *)realloc(oldbuf, szDataLen+szLen+1);
    }

    if(sData == NULL) {
        sData = oldbuf;

        AppendDebugLog("%s - [MEM] Cannot allocate %" PRIu64 " bytes for sData in string::operator+=(char)\n", (uint64_t)(szDataLen+szLen+1));

        return *this;
    }

    memcpy(sData+szDataLen, sTxt, szLen);
	szDataLen += szLen;
	sData[szDataLen] = '\0';

    return *this;
}
开发者ID:NIT-Warangal,项目名称:LibSys,代码行数:25,代码来源:pxstring.cpp


示例11: KillTimer

void theLoop::Looper() {
#ifdef _WIN32
	KillTimer(NULL, srvLoopTimer);
#endif

	// PPK ... two loop stategy for saving badwith
	if(bRecv == true) {
		ReceiveLoop();
	} else {
		SendLoop();
		eventqueue->ProcessEvents();
	}

	if(bServerTerminated == false) {
		bRecv = !bRecv;

#ifdef _WIN32
        srvLoopTimer = SetTimer(NULL, 0, 100, NULL);

	    if(srvLoopTimer == 0) {
	        AppendDebugLog("%s - [ERR] Cannot start Looper in theLoop::Looper\n", 0);
	        exit(EXIT_FAILURE);
	    }
#endif
	} else {
	    // tell the scripts about the end
	    ScriptManager->OnExit();
	    
	    // send last possible global data
	    g_GlobalDataQueue->SendFinalQueue();
	    
	    ServerFinalStop(true);
	}
}
开发者ID:anandanwar4,项目名称:PtokaX,代码行数:34,代码来源:serviceLoop.cpp


示例12: sprintf

void classUsers::Add2UserIP(User * cur) {
    int m = sprintf(msg,"$%s %s$", cur->sNick, cur->sIP);
    if(CheckSprintf(m, 1024, "classUsers::Add2UserIP") == false) {
        return;
    }

    if(userIPListSize < userIPListLen+m) {
        char * pOldBuf = userIPList;
#ifdef _WIN32
        userIPList = (char *)HeapReAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)pOldBuf, userIPListSize+IPLISTSIZE+1);
#else
		userIPList = (char *)realloc(pOldBuf, userIPListSize+IPLISTSIZE+1);
#endif
        if(userIPList == NULL) {
            userIPList = pOldBuf;
            cur->ui32BoolBits |= User::BIT_ERROR;
            UserClose(cur);

			AppendDebugLog("%s - [MEM] Cannot reallocate %" PRIu64 " bytes in classUsers::Add2UserIP\n", (uint64_t)(userIPListSize+IPLISTSIZE+1));

            return;
        }
        userIPListSize += IPLISTSIZE;
    }

    memcpy(userIPList+userIPListLen-1, msg+1, m-1);
    userIPListLen += m;

    userIPList[userIPListLen-2] = '$';
    userIPList[userIPListLen-1] = '|';
    userIPList[userIPListLen] = '\0';

    iZUserIPListLen = 0;
}
开发者ID:anandanwar4,项目名称:PtokaX,代码行数:34,代码来源:colUsers.cpp


示例13: SingleDataItem

void clsGlobalDataQueue::SingleItemStore(char * sData, const size_t &szDataLen, User * pFromUser, const int32_t &i32Profile, const uint8_t &ui8Type) {
    SingleDataItem * pNewItem = new SingleDataItem();
    if(pNewItem == NULL) {
		AppendDebugLog("%s - [MEM] Cannot allocate pNewItem in clsGlobalDataQueue::SingleItemStore\n", 0);
    	return;
    }

    if(sData != NULL) {
#ifdef _WIN32
        pNewItem->sData = (char *)HeapAlloc(clsServerManager::hLibHeap, HEAP_NO_SERIALIZE, szDataLen+1);
#else
		pNewItem->sData = (char *)malloc(szDataLen+1);
#endif
        if(pNewItem->sData == NULL) {
            delete pNewItem;

			AppendDebugLog("%s - [MEM] Cannot allocate %" PRIu64 " bytes in clsGlobalDataQueue::SingleItemStore\n", (uint64_t)(szDataLen+1));

            return;
        }

        memcpy(pNewItem->sData, sData, szDataLen);
        pNewItem->sData[szDataLen] = '\0';
    } else {
        pNewItem->sData = NULL;
    }

	pNewItem->szDataLen = szDataLen;

	pNewItem->pFromUser = pFromUser;

	pNewItem->ui8Type = ui8Type;

	pNewItem->pPrev = NULL;
	pNewItem->pNext = NULL;

    pNewItem->i32Profile = i32Profile;

    if(pNewSingleItems[0] == NULL) {
        pNewSingleItems[0] = pNewItem;
        pNewSingleItems[1] = pNewItem;
    } else {
        pNewItem->pPrev = pNewSingleItems[1];
        pNewSingleItems[1]->pNext = pNewItem;
        pNewSingleItems[1] = pNewItem;
    }
}
开发者ID:NIT-Warangal,项目名称:LibSys,代码行数:47,代码来源:GlobalDataQueue.cpp


示例14: time

void classUsers::Add2RecTimes(User * curUser) {
    time_t acc_time;
    time(&acc_time);

    if(ProfileMan->IsAllowed(curUser, ProfileManager::NOUSRSAMEIP) == true ||
        (acc_time-curUser->LoginTime) >= SettingManager->iShorts[SETSHORT_MIN_RECONN_TIME]) {
        return;
    }

    RecTime * pNewRecTime = new RecTime();

	if(pNewRecTime == NULL) {
		AppendDebugLog("%s - [MEM] Cannot allocate pNewRecTime in classUsers::Add2RecTimes\n", 0);
        return;
	}

#ifdef _WIN32
    pNewRecTime->sNick = (char *)HeapAlloc(hPtokaXHeap, HEAP_NO_SERIALIZE, curUser->ui8NickLen+1);
#else
	pNewRecTime->sNick = (char *)malloc(curUser->ui8NickLen+1);
#endif
	if(pNewRecTime->sNick == NULL) {
        delete pNewRecTime;

        AppendDebugLog("%s - [MEM] Cannot allocate %" PRIu64 " bytes in classUsers::Add2RecTimes\n", (uint64_t)(curUser->ui8NickLen+1));

        return;
    }

    memcpy(pNewRecTime->sNick, curUser->sNick, curUser->ui8NickLen);
    pNewRecTime->sNick[curUser->ui8NickLen] = '\0';

	pNewRecTime->ui64DisConnTick = ui64ActualTick-(acc_time-curUser->LoginTime);
    pNewRecTime->ui32NickHash = curUser->ui32NickHash;

    memcpy(pNewRecTime->ui128IpHash, curUser->ui128IpHash, 16);

    pNewRecTime->prev = NULL;
    pNewRecTime->next = RecTimeList;

	if(RecTimeList != NULL) {
		RecTimeList->prev = pNewRecTime;
	}

	RecTimeList = pNewRecTime;
}
开发者ID:anandanwar4,项目名称:PtokaX,代码行数:46,代码来源:colUsers.cpp


示例15: new

bool UdpDebug::New(User * pUser, const uint16_t ui16Port) {
	UdpDbgItem * pNewDbg = new (std::nothrow) UdpDbgItem();
    if(pNewDbg == NULL) {
		AppendDebugLog("%s - [MEM] Cannot allocate pNewDbg in UdpDebug::New\n");
    	return false;
    }

    // initialize dbg item
#ifdef _WIN32
    pNewDbg->m_sNick = (char *)HeapAlloc(ServerManager::m_hPtokaXHeap, HEAP_NO_SERIALIZE, pUser->m_ui8NickLen+1);
#else
	pNewDbg->m_sNick = (char *)malloc(pUser->m_ui8NickLen+1);
#endif
    if(pNewDbg->m_sNick == NULL) {
		AppendDebugLogFormat("[MEM] Cannot allocate %" PRIu8 " bytes for sNick in UdpDebug::New\n", pUser->m_ui8NickLen+1);

		delete pNewDbg;
        return false;
    }

    memcpy(pNewDbg->m_sNick, pUser->m_sNick, pUser->m_ui8NickLen);
    pNewDbg->m_sNick[pUser->m_ui8NickLen] = '\0';

    pNewDbg->m_ui32Hash = pUser->m_ui32NickHash;

    struct in6_addr i6addr;
    memcpy(&i6addr, &pUser->m_ui128IpHash, 16);

    bool bIPv6 = (IN6_IS_ADDR_V4MAPPED(&i6addr) == 0);

    if(bIPv6 == true) {
        ((struct sockaddr_in6 *)&pNewDbg->m_sasTo)->sin6_family = AF_INET6;
        ((struct sockaddr_in6 *)&pNewDbg->m_sasTo)->sin6_port = htons(ui16Port);
        memcpy(((struct sockaddr_in6 *)&pNewDbg->m_sasTo)->sin6_addr.s6_addr, pUser->m_ui128IpHash, 16);
        pNewDbg->m_sasLen = sizeof(struct sockaddr_in6);
    } else {
        ((struct sockaddr_in *)&pNewDbg->m_sasTo)->sin_family = AF_INET;
        ((struct sockaddr_in *)&pNewDbg->m_sasTo)->sin_port = htons(ui16Port);
        ((struct sockaddr_in *)&pNewDbg->m_sasTo)->sin_addr.s_addr = inet_addr(pUser->m_sIP);
        pNewDbg->m_sasLen = sizeof(struct sockaddr_in);
    }

    pNewDbg->m_Socket = socket((bIPv6 == true ? AF_INET6 : AF_INET), SOCK_DGRAM, IPPROTO_UDP);
#ifdef _WIN32
    if(pNewDbg->m_Socket == INVALID_SOCKET) {
        int iErr = WSAGetLastError();
#else
    if(pNewDbg->m_Socket == -1) {
#endif
        pUser->SendFormat("UdpDebug::New1", true, "*** [ERR] %s: %s (%d).|", LanguageManager::m_Ptr->m_sTexts[LAN_UDP_SCK_CREATE_ERR],
#ifdef _WIN32
			WSErrorStr(iErr), iErr);
#else
			ErrnoStr(errno), errno);
#endif
        delete pNewDbg;
        return false;
    }
开发者ID:HiT-Hi-FiT-Hai,项目名称:PtokaX,代码行数:58,代码来源:UdpDebug.cpp


示例16: AppendDebugLog

PXBReader::~PXBReader() {
#ifdef _WIN32
        if(pItemDatas != NULL) {
            if(HeapFree(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE, pItemDatas) == 0) {
                AppendDebugLog("%s - [MEM] Cannot deallocate pItemDatas in PXBReader::~PXBReader\n");
            }
        }
#else
		free(pItemDatas);
#endif

#ifdef _WIN32
        if(ui16ItemLengths != NULL) {
            if(HeapFree(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)ui16ItemLengths) == 0) {
                AppendDebugLog("%s - [MEM] Cannot deallocate ui16ItemLengths in PXBReader::~PXBReader\n");
            }
        }
#else
		free(ui16ItemLengths);
#endif

#ifdef _WIN32
        if(sItemIdentifiers != NULL) {
            if(HeapFree(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)sItemIdentifiers) == 0) {
                AppendDebugLog("%s - [MEM] Cannot deallocate sItemIdentifiers in PXBReader::~PXBReader\n");
            }
        }
#else
		free(sItemIdentifiers);
#endif

#ifdef _WIN32
        if(ui8ItemValues != NULL) {
            if(HeapFree(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)ui8ItemValues) == 0) {
                AppendDebugLog("%s - [MEM] Cannot deallocate ui8ItemValues in PXBReader::~PXBReader\n");
            }
        }
#else
		free(ui8ItemValues);
#endif

    if(pFile != NULL) {
        fclose(pFile);
    }
}
开发者ID:hjpotter92,项目名称:PtokaX,代码行数:45,代码来源:PXBReader.cpp


示例17: AppendDebugLog

ReservedNicksManager::ReservedNick::~ReservedNick() {
#ifdef _WIN32
	if(m_sNick != NULL && HeapFree(ServerManager::m_hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)m_sNick) == 0) {
        AppendDebugLog("%s - [MEM] Cannot deallocate m_sNick in ReservedNicksManager::ReservedNick::~ReservedNick\n");
    }
#else
	free(m_sNick);
#endif
}
开发者ID:HiT-Hi-FiT-Hai,项目名称:PtokaX,代码行数:9,代码来源:ResNickManager.cpp


示例18: AppendDebugLog

ResNickMan::ReservedNick::~ReservedNick() {
#ifdef _WIN32
	if(sNick != NULL && HeapFree(hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)sNick) == 0) {
        AppendDebugLog("%s - [MEM] Cannot deallocate sNick in ResNickMan::ReservedNick::~ReservedNick\n", 0);
    }
#else
	free(sNick);
#endif
}
开发者ID:sidcode,项目名称:PtokaX,代码行数:9,代码来源:ResNickManager.cpp


示例19: sizeof

bool PXBReader::PrepareArrays(const uint8_t &ui8Size) {
#ifdef _WIN32
    pItemDatas = (void **)HeapAlloc(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, ui8Size*sizeof(void *));
#else
	pItemDatas = (void **)calloc(ui8Size, sizeof(void *));
#endif
    if(pItemDatas == NULL) {
		AppendDebugLog("%s - [MEM] Cannot create pItemDatas in PXBReader::PrepareArrays\n");
		return false;
    }

#ifdef _WIN32
    ui16ItemLengths = (uint16_t *)HeapAlloc(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, ui8Size*sizeof(uint16_t));
#else
	ui16ItemLengths = (uint16_t *)calloc(ui8Size, sizeof(uint16_t));
#endif
    if(ui16ItemLengths == NULL) {
		AppendDebugLog("%s - [MEM] Cannot create ui16ItemLengths in PXBReader::PrepareArrays\n");
		return false;
    }

#ifdef _WIN32
    sItemIdentifiers = (char *)HeapAlloc(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, ui8Size*(sizeof(char)*2));
#else
	sItemIdentifiers = (char *)calloc(ui8Size, sizeof(char)*2);
#endif
    if(sItemIdentifiers == NULL) {
		AppendDebugLog("%s - [MEM] Cannot create sItemIdentifiers in PXBReader::PrepareArrays\n");
		return false;
    }

#ifdef _WIN32
    ui8ItemValues = (uint8_t *)HeapAlloc(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE | HEAP_ZERO_MEMORY, ui8Size*sizeof(ui8ItemValues));
#else
	ui8ItemValues = (uint8_t *)calloc(ui8Size, sizeof(ui8ItemValues));
#endif
    if(ui8ItemValues == NULL) {
		AppendDebugLog("%s - [MEM] Cannot create ui8ItemValues in PXBReader::PrepareArrays\n");
		return false;
    }

	ui8AllocatedSize = ui8Size;
	return true;
}
开发者ID:hjpotter92,项目名称:PtokaX,代码行数:44,代码来源:PXBReader.cpp


示例20: AppendDebugLog

clsZlibUtility::~clsZlibUtility() {
#ifdef _WIN32
    if(pZbuffer != NULL) {
        if(HeapFree(clsServerManager::hPtokaXHeap, HEAP_NO_SERIALIZE, (void *)pZbuffer) == 0) {
			AppendDebugLog("%s - [MEM] Cannot deallocate pZbuffer in clsZlibUtility::~clsZlibUtility\n");
        }
    }
#else
	free(pZbuffer);
#endif
}
开发者ID:hjpotter92,项目名称:PtokaX,代码行数:11,代码来源:ZlibUtility.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AppendDevicePathNode函数代码示例发布时间:2022-05-30
下一篇:
C++ AppendData函数代码示例发布时间: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