当前位置: 首页>>代码示例>>C++>>正文


C++ DataSend函数代码示例

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


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

示例1: ProtocolCoreSend

void ProtocolCoreSend(int aIndex, PBYTE aSend, int aLen)
{
	OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);

	if(aSend[0] == 0xC1 || aSend[0] == 0xC3)
	{
		switch(aSend[2])
		{
            case 0x24: 
            {   
				Protocol.CheckRingSend(gObj, aSend);
            }
			break; 
		}
	} 

	DataSend(aIndex,aSend,aLen);
}
开发者ID:samik3k,项目名称:GreatDevelop-Julia-Project,代码行数:18,代码来源:Protocol.cpp

示例2: NpcCastleHuntZoneGuard

BOOL NpcCastleHuntZoneGuard(LPOBJ lpNpc, LPOBJ lpObj)
{
	if(gObjIsConnected(lpObj->m_Index) == FALSE)
		return TRUE;

	if((lpObj->m_IfState.use) > 0)
		return TRUE;

	PMSG_ANS_GUARD_IN_CASTLE_HUNTZONE pResult = {0};

	PHeadSubSetB((PBYTE)&pResult,0xB9,0x03,sizeof(pResult));
	pResult.btResult = 1;
	pResult.iMaxPrice = 300000;
	pResult.iUnitOfPrice = 10000;
	pResult.btUsable = FALSE;
	pResult.iCurrentPrice = 0;

	pResult.iCurrentPrice = g_CastleSiegeSync.GetTaxHuntZone(lpObj->m_Index,FALSE);

	if(g_CastleSiege.GetHuntZoneEnter() != FALSE)
	{
		pResult.btUsable = TRUE;
	}

	if(lpObj->lpGuild != FALSE)
	{
		if(g_CastleSiege.CheckCastleOwnerUnionMember(lpObj->m_Index) != FALSE)
		{
			pResult.btResult = 2;
		}

		if(g_CastleSiege.CheckCastleOwnerMember(lpObj->m_Index) != FALSE && lpObj->GuildStatus == G_MASTER)
		{
			pResult.btResult = 3;
		}
	}
	else if(g_CastleSiege.GetHuntZoneEnter())
	{
		pResult.btResult = 1;
	}

	DataSend(lpObj->m_Index,(PBYTE)&pResult,pResult.h.size);
return TRUE;
}
开发者ID:stimpy76,项目名称:zTeam-Source-Season8,代码行数:44,代码来源:NpcTalk.cpp

示例3: NpcDarkSpiritTrainer

BOOL NpcDarkSpiritTrainer(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( bCanChaosBox == TRUE )
	{
		PMSG_TALKRESULT pMsg;

		pMsg.h.c = 0xC3;
		pMsg.h.headcode = 0x30;
		pMsg.h.size = sizeof(pMsg);
		
		if ( lpObj->m_bPShopOpen == true )
		{
			LogAdd("[%s][%s] is Already Opening PShop, ChaosBox Failed",
				lpObj->AccountID, lpObj->Name);
			GCServerMsgStringSend(lMsg.Get(MSGGET(4, 194)), lpObj->m_Index, 1);

			return TRUE;
		}

		lpObj->m_IfState.type = 13;
		lpObj->m_IfState.state = 0;
		lpObj->m_IfState.use = 1;
		
		pMsg.result = 0x07;
		lpObj->bIsChaosMixCompleted = false;
		pMsg.level1 = gDQChaosSuccessRateLevel1;
		pMsg.level2 = gDQChaosSuccessRateLevel2;
		pMsg.level3 = gDQChaosSuccessRateLevel3;
		pMsg.level4 = gDQChaosSuccessRateLevel4;
		pMsg.level5 = gDQChaosSuccessRateLevel5;
		pMsg.level6 = gDQChaosSuccessRateLevel6;

		DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);

		GCAnsCsMapSvrTaxInfo(lpObj->m_Index, 1, g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index));
		gObjInventoryTrans(lpObj->m_Index);

		LogAddTD("[%s][%s] Open Chaos Box", lpObj->AccountID, lpObj->Name);
		gObjItemTextSave(lpObj);
		gObjWarehouseTextSave(lpObj);
	}

	return TRUE;
}
开发者ID:stimpy76,项目名称:zTeam-Source-Season8,代码行数:44,代码来源:NpcTalk.cpp

示例4: CGReqQuestSwitch

void CGReqQuestSwitch(PMSG_REQ_QUESTEXP *pMsg, int aIndex)
{
    if( !OBJMAX_RANGE(aIndex) )
        return;

    OBJECTSTRUCT* lpObj = &gObj[aIndex];

    if( !gObjIsConnected(aIndex) )
        return;

    if( !g_QuestExpProgMng.ChkQuestIndexIDToEpLimit(pMsg->quest_info_index_id, aIndex) )
    {
        LogAddTD("[QuestExp] - Error - [%s] [%d]", __FILE__, __LINE__);
        return;
    }

    LogAddTD(
        "[QuestExp] Selection Episode List Choose One [%s][%s] QuestInfoIndexID[0x%x] Choose[%d]",
        gObj[aIndex].AccountID,
        gObj[aIndex].Name,
        pMsg->quest_info_index_id,
        pMsg->choose);

    lua_State* L = g_MuLuaQuestExp.GetLua();

    if( !L )
    {
        LogAddTD("[QuestExp] - Error - [%s] [%d]", __FILE__, __LINE__);
        return;
    }

    if( g_QuestExpUserMng.IsQuestAccept(pMsg->quest_info_index_id, aIndex) )
    {
        g_Generic_Call(L, "CGReqQuestSwitch", "iii>", pMsg->quest_info_index_id, pMsg->choose, aIndex);
    }
    else
    {
        PMSG_ANS_QUESTEXP pAnsMsg;
        pAnsMsg.result = 1;

        PHeadSubSetB((LPBYTE)&pAnsMsg, 0xF6u, 0, 5);
        DataSend(gObj[aIndex].m_Index, (LPBYTE)&pAnsMsg, sizeof(pAnsMsg));
    }
}
开发者ID:331515194,项目名称:zTeamS6.3,代码行数:44,代码来源:QuestExpProtocol.cpp

示例5: sizeof

void cDuelSystem::SendSpectatorRemove(short iSpecIndex, int iRoom)
{
    if(iRoom < 0 || iRoom >= MAX_DUEL_ROOMS)
    {
        return;
    }

    if(iSpecIndex < 0 || iSpecIndex >= MAX_DUEL_SEPARATORS)
    {
        return;
    }

    if(this->g_DuelRooms[iRoom].szSeparators[iSpecIndex] == NULL)
    {
        return;
    }

    if(this->g_DuelRooms[iRoom].szlpObjOne == NULL || this->g_DuelRooms[iRoom].szlpObjTy == NULL)
    {
        return;
    }

    PMSG_DUEL_SPEC_ADD pMsg;

    pMsg.h.c		= 0xC1;
    pMsg.h.size		= sizeof(pMsg);
    pMsg.h.headcode = 0xAA;
    pMsg.h.subcode  = 0x0A;

    memcpy(pMsg.szName, this->g_DuelRooms[iRoom].szSeparators[iSpecIndex]->Name, 10);

    for(short i = 0; i < MAX_DUEL_SEPARATORS; ++i)
    {
        if(i == iSpecIndex)
        {
            continue;
        }

        if(this->g_DuelRooms[iRoom].szSeparators[i] != NULL)
        {
            DataSend(this->g_DuelRooms[iRoom].szSeparators[i]->m_Index, (BYTE*)&pMsg, pMsg.h.size);
        }
    }
}
开发者ID:dneyrabust,项目名称:IA-Julia-Repack,代码行数:44,代码来源:DuelManager.cpp

示例6: PHeadSubSetB

//00554960	-> 100%
void CMasterLevelSystem::GCMasterLevelUpInfo(LPOBJ lpObj)	//OK
{
	PMSG_MASTERLEVEL_UP pMsg;
	PHeadSubSetB(&pMsg.h.c, 0xF3, 0x51, 0x20);
	// ----
	pMsg.nMLevel		= lpObj->m_nMasterLevel;
	pMsg.nAddMLPoint	= 1;
	pMsg.nMLPoint		= lpObj->m_iMasterLevelPoint;
	pMsg.nMaxMLPoint	= MASTER_MAX_POINT;
	pMsg.wMaxLife		= (double)lpObj->AddLife + lpObj->MaxLife;
	pMsg.wMaxMana		= (double)lpObj->AddMana + lpObj->MaxMana;
	pMsg.wMaxShield		= LOWORD(lpObj->iAddShield) + LOWORD(lpObj->iMaxShield);
	pMsg.wMaxBP			= LOWORD(lpObj->AddBP) + LOWORD(lpObj->MaxBP);
	// ----
	DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
	GCSendEffectInfo(lpObj->m_Index, 16);
	// ----
	LogAddTD("[%s][%s] Master Level Up :%d, MLPoint:%d/%d", lpObj->AccountID, lpObj->Name, lpObj->m_nMasterLevel, lpObj->m_iMasterLevelPoint, MASTER_MAX_POINT);
}
开发者ID:Natzugen,项目名称:test,代码行数:20,代码来源:MasterLevelSystem.cpp

示例7: memset

void TNotice::SendToAllUser(LPSTR szMsg, ...)
{
#ifdef GS_UNICODE
	unsigned char szTempMsg[4096]={0};
#endif

	va_list pArguments;

#ifdef GS_UNICODE
	memset(this->m_Notice.Notice , 0, sizeof(this->m_Notice.Notice ));
#endif


	va_start(pArguments, szMsg);

#ifdef GS_UNICODE
	vsprintf((char*)szTempMsg, (char*)szMsg, pArguments);
#else
	vsprintf_s(this->m_Notice.Notice, (char*)szMsg, pArguments);
#endif

	va_end(pArguments);

#ifdef GS_UNICODE
	MultiByteToWideChar( 1258, 0, (char*)szTempMsg,  strlen((char*)szTempMsg), (unsigned short*)this->m_Notice.Notice, sizeof(this->m_Notice.Notice) );
	this->m_Notice.Notice[254] = 0;
	this->m_Notice.Notice[255] =0;
	PHeadSetB( &this->m_pNotice.PacketHeader, 0x0D, wcslen((unsigned short*)this->m_Notice.Notice )*2 + 0x12);
#else
	PHeadSetB((LPBYTE)&this->m_Notice, 0x0D, strlen(this->m_Notice.Notice)  + sizeof(PMSG_NOTICE) - sizeof(this->m_Notice.Notice) + 1);
#endif

	for ( int n = OBJ_STARTUSERINDEX ; n < OBJMAX ; n++)
	{
		if ( gObj[n].Connected == PLAYER_PLAYING )
		{
			if ( gObj[n].Type  == OBJ_USER )
			{
				DataSend(n, (LPBYTE)&this->m_Notice , this->m_Notice.h.size );
			}
		}
	}
}
开发者ID:Fenrisus,项目名称:p4f-free-emu,代码行数:43,代码来源:TNotice.cpp

示例8: DGRequestGensInfo

void DGRequestGensInfo(PMSG_REQ_GENS_INFO* lpMsg,int aIndex)
{
char szName[MAX_IDSTRING+1];

	memcpy(szName,lpMsg->szName,MAX_IDSTRING);
	szName[10] = '\0';

	PMSG_ANS_GENS_INFO pMsg = {0};
	pMsg.h.c = 0xC1;
	pMsg.h.size = sizeof(pMsg);
	pMsg.h.headcode = 0x40;
	pMsg.h.subcode = 0x01;

	pMsg.aIndex = lpMsg->aIndex;

	GetGensInfo(szName,&pMsg);

	DataSend(aIndex,(LPBYTE)&pMsg,sizeof(pMsg));
}
开发者ID:AkiraJue,项目名称:OpenMuS9,代码行数:19,代码来源:DataServer.cpp

示例9: NpcEventChipNPC

BOOL NpcEventChipNPC(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( (lpObj->m_IfState.use) > 0 )
	{
		return TRUE;
	}
	
	if ( lpNpc->MapNumber == 0 )
	{
		PMSG_REQ_VIEW_EC_MN pMsgTha;

		PHeadSetB((LPBYTE)&pMsgTha, 0x01, sizeof(pMsgTha));
		pMsgTha.iINDEX = lpObj->m_Index;
		strcpy(pMsgTha.szUID, lpObj->AccountID);
		pEventObj = lpNpc;

		DataSendEventChip((char*)&pMsgTha, sizeof(pMsgTha));
		
		lpObj->m_IfState.type = 9;
		lpObj->m_IfState.state = 0;
		lpObj->m_IfState.use = 1;

		return TRUE;
	}

	if ( lpNpc->MapNumber == 2 )
	{
		PMSG_EVENTCHIPINFO Result;

		PHeadSetB((LPBYTE)&Result, 0x94, sizeof(Result));
		Result.Type = 2;
		
		DataSend(lpObj->m_Index, (LPBYTE)&Result, Result.h.size);

		lpObj->m_IfState.type = 9;
		lpObj->m_IfState.state = 0;
		lpObj->m_IfState.use = 1;

		return TRUE;
	}

	return FALSE;
}
开发者ID:constantinbogdan,项目名称:node3d,代码行数:43,代码来源:NpcTalk.cpp

示例10: DGAnsCastleTributeMoney

void DGAnsCastleTributeMoney(LPCSP_REQ_CASTLETRIBUTEMONEY lpMsg,int aIndex)
{
	CSP_ANS_MONEYCHANGE pMsg;

	pMsg.h.c = PMHC_BYTE;
	pMsg.h.size = sizeof( pMsg );
	pMsg.h.headcode = 0x80;
	pMsg.h.subcode = 0x18;

	pMsg.wMapSvrNum = lpMsg->wMapSvrNum;
	pMsg.iResult = FALSE;

	if(lpMsg->iCastleTributeMoney > 0)
	{
		pMsg.iResult = CastleTributeMoney(lpMsg->wMapSvrNum,lpMsg->iCastleTributeMoney,&pMsg.i64CastleMoney);
	}

	DataSend(aIndex,(LPBYTE)&pMsg,pMsg.h.size);
}
开发者ID:AkiraJue,项目名称:OpenMuS9,代码行数:19,代码来源:DataServer.cpp

示例11: DGAnsCastleNpcBuy

void DGAnsCastleNpcBuy(LPCSP_REQ_NPCBUY lpMsg,int aIndex)
{
	CSP_ANS_NPCBUY pMsg;

	pMsg.h.c = PMHC_BYTE;
	pMsg.h.size = sizeof( pMsg );
	pMsg.h.headcode = 0x80;
	pMsg.h.subcode = 0x03;

	pMsg.iIndex = lpMsg->iIndex;
	pMsg.wMapSvrNum = lpMsg->wMapSvrNum;
	pMsg.iBuyCost = lpMsg->iBuyCost;
	pMsg.iNpcIndex = lpMsg->iNpcIndex;
	pMsg.iNpcNumber = lpMsg->iNpcNumber;

	pMsg.iResult = CastleNpcBuy(lpMsg);

	DataSend(aIndex,(LPBYTE)&pMsg,pMsg.h.size);
}
开发者ID:AkiraJue,项目名称:OpenMuS9,代码行数:19,代码来源:DataServer.cpp

示例12: DGRequestLeaveGens

void DGRequestLeaveGens(PMSG_REQ_LEAVE_GENS* lpMsg,int aIndex)
{
	char szName[MAX_IDSTRING+1];

	memcpy(szName,lpMsg->szName,MAX_IDSTRING);
	szName[10] = '\0';

	PMSG_ANS_LEAVE_GENS pMsg;
	pMsg.h.c = 0xC1;
	pMsg.h.size = sizeof(pMsg);
	pMsg.h.headcode = 0x40;
	pMsg.h.subcode = 0x04;

	pMsg.aIndex = lpMsg->aIndex;

	LeaveGens(szName,lpMsg->btGens,&pMsg);

	DataSend(aIndex,(LPBYTE)&pMsg,sizeof(pMsg));
}
开发者ID:AkiraJue,项目名称:OpenMuS9,代码行数:19,代码来源:DataServer.cpp

示例13: DGAnsCastleNpcRepair

void DGAnsCastleNpcRepair(LPCSP_REQ_NPCREPAIR lpMsg,int aIndex)
{
	CSP_ANS_NPCREPAIR pMsg;

	pMsg.h.c = PMHC_BYTE;
	pMsg.h.size = sizeof( pMsg );
	pMsg.h.headcode = 0x80;
	pMsg.h.subcode = 0x04;

	pMsg.iIndex = lpMsg->iIndex;
	pMsg.wMapSvrNum = lpMsg->wMapSvrNum;
	pMsg.iNpcIndex = lpMsg->iNpcIndex;
	pMsg.iNpcNumber = lpMsg->iNpcNumber;
	pMsg.iRepairCost = lpMsg->iRepairCost;

	pMsg.iResult = CastleNpcRepair(lpMsg,&pMsg);

	DataSend(aIndex,(LPBYTE)&pMsg,pMsg.h.size);
}
开发者ID:AkiraJue,项目名称:OpenMuS9,代码行数:19,代码来源:DataServer.cpp

示例14: LOBYTE

void PCPointShop::DecreasePoints(DWORD PlayerID,int Points)
{
	int ID=PlayerID-MIN_PLAYERID;
	
	if(pObjGS[ID].PCPlayerPoints-Points<0)
	{
		pObjGS[ID].PCPlayerPoints=0;
	}
	else
	{
		pObjGS[ID].PCPlayerPoints-=Points;
		//this->SendPoints(PlayerID);
	}
	
	pObjGS[ID].PCInfoMod=1;
	pObjGS[ID].PCInfoReceived=1;
	BYTE Packet[8] = {0xC1, 0x08 , 0xD0 , 0x04 , LOBYTE(pObjGS[ID].PCPlayerPoints) , HIBYTE(pObjGS[ID].PCPlayerPoints) , LOBYTE(MaxPlayerPoints) , HIBYTE(MaxPlayerPoints)};
	DataSend(PlayerID,(PBYTE)Packet,Packet[1]);
}
开发者ID:brunohkbx,项目名称:pendmu-server,代码行数:19,代码来源:PCPoints.cpp

示例15: sizeof

void GuildMatch::DGAnsJoinReqDelete(GUILDMATCH_DGANS_OFFERDELETE* lpData)
{
	if(		!OBJMAX_RANGE(lpData->UserIndex) 
		||	gObj[lpData->UserIndex].Connected != PLAYER_PLAYING )
	{
		return;
	}
	// ----
	GUILDMATCH_GCANS_JOINREQDELETE lpAnswer = { 0 };
	lpAnswer.h.c			= 0xC1;
	lpAnswer.h.headcode		= 0xED;
	lpAnswer.h.subcode		= 0x05;
	lpAnswer.h.size			= sizeof(GUILDMATCH_GCANS_JOINREQDELETE);
	// ----
	if( lpData->Result == 1 )
	{
		DataSend(lpData->UserIndex, (LPBYTE)&lpAnswer, sizeof(GUILDMATCH_GCANS_JOINREQDELETE));
	}
}
开发者ID:stimpy76,项目名称:zTeam-Source-Season8,代码行数:19,代码来源:GuildMatch.cpp


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