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


C++ CChar::CanSee方法代码示例

本文整理汇总了C++中CChar::CanSee方法的典型用法代码示例。如果您正苦于以下问题:C++ CChar::CanSee方法的具体用法?C++ CChar::CanSee怎么用?C++ CChar::CanSee使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CChar的用法示例。


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

示例1: StatsUpdateAll

// ---------------------------------------------------------
void CPartyDef::StatsUpdateAll( CChar *pCharSrc, PacketSend *pPacket )
{
	ADDTOCALLSTACK("CPartyDef::StatsUpdateAll");
	size_t iQty = m_Chars.GetCharCount();
	if ( iQty <= 0 )
		return;

	CChar *pChar = NULL;
	for ( size_t i = 0; i < iQty; i++ )
	{
		pChar = m_Chars.GetChar(i).CharFind();
		if ( !pChar || !pChar->m_pClient || (pChar == pCharSrc) || !pChar->CanSee(pCharSrc) )
			continue;
		pPacket->send(pChar->m_pClient);
	}
}
开发者ID:dac247,项目名称:SphereServer-Source,代码行数:17,代码来源:CParty.cpp

示例2: AddStatsUpdate

// ---------------------------------------------------------
void CPartyDef::AddStatsUpdate( CChar * pChar, PacketSend * pPacket )
{
	ADDTOCALLSTACK("CPartyDef::AddStatsUpdate");
	size_t iQty = m_Chars.GetCharCount();
	if ( iQty <= 0 )
		return;

	for ( size_t i = 0; i < iQty; i++ )
	{
		CChar * pCharNow = m_Chars.GetChar(i).CharFind();
		if ( pCharNow && pCharNow != pChar )
		{
			if ( pCharNow->CanSee( pChar ) && pCharNow->IsClient() )
				pPacket->send(pCharNow->GetClient());
		}
	}
}
开发者ID:roberpot,项目名称:Source,代码行数:18,代码来源:CQuest.cpp

示例3: NPC_PetDesert

void CChar::NPC_PetDesert()
{
	ADDTOCALLSTACK("CChar::NPC_PetDesert");
	CChar * pCharOwn = NPC_PetGetOwner();
	if ( !pCharOwn )
		return;

	if ( IsTrigUsed(TRIGGER_PETDESERT) )
	{
		if ( OnTrigger( CTRIG_PetDesert, pCharOwn, NULL ) == TRIGRET_RET_TRUE )
			return;
	}

	NPC_PetClearOwners();
	if ( ! pCharOwn->CanSee(this))
		pCharOwn->SysMessagef(g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_DESERTED), GetName());

	TCHAR	*pszMsg = Str_GetTemp();
	sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_DECIDE_MASTER), GetName());
	Speak(pszMsg);

	// free to do as i wish !
	Skill_Start( SKILL_NONE );
}
开发者ID:GenerationOfWorlds,项目名称:Source,代码行数:24,代码来源:CCharNPCPet.cpp

示例4: AcceptEvent

bool CPartyDef::AcceptEvent( CChar *pCharAccept, CGrayUID uidInviter, bool bForced )	// static
{
	ADDTOCALLSTACK("CPartyDef::AcceptEvent");
	// We are accepting the invite to join a party
	// No security checks if bForced -> true !!!
	// Party master is only one that can add ! GetChar(0)

	CChar *pCharInviter = uidInviter.CharFind();
	if ( !pCharInviter || !pCharInviter->m_pClient || !pCharAccept || !pCharAccept->m_pClient || (pCharInviter == pCharAccept) )
		return false;

	CPartyDef *pParty = pCharInviter->m_pParty;
	if ( !bForced )
	{
		CVarDefCont *sTempVal = pCharInviter->GetTagDefs()->GetKey("PARTY_LASTINVITE");
		if ( !sTempVal || (static_cast<CGrayUID>(sTempVal->GetValNum()) != pCharAccept->GetUID()) )
			return false;

		pCharInviter->DeleteKey("PARTY_LASTINVITE");

		if ( !pCharInviter->CanSee(pCharAccept) )
			return false;
	}

	if ( pCharAccept->m_pParty )	// already in a party
	{
		if ( pParty == pCharAccept->m_pParty )	// already in this party
			return true;

		if ( bForced )
		{
			pCharAccept->m_pParty->RemoveMember(pCharAccept->GetUID(), pCharAccept->GetUID());
			pCharAccept->m_pParty = NULL;
		}
		else
			return false;
	}

	TCHAR *pszMsg = Str_GetTemp();
	sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_PARTY_JOINED), pCharAccept->GetName());

	if ( !pParty )
	{
		// Create the party now.
		pParty = new CPartyDef(pCharInviter, pCharAccept);
		ASSERT(pParty);
		g_World.m_Parties.InsertHead(pParty);
		pCharInviter->SysMessage(pszMsg);
	}
	else
	{
		// Add to existing party
		if ( pParty->IsPartyFull() || (!bForced && !pParty->IsPartyMaster(pCharInviter)) )
			return false;

		pParty->SysMessageAll(pszMsg);	// tell everyone already in the party about this
		pParty->AcceptMember(pCharAccept);
	}

	pCharAccept->SysMessageDefault(DEFMSG_PARTY_ADDED);
	return true;
}
开发者ID:dac247,项目名称:SphereServer-Source,代码行数:62,代码来源:CParty.cpp


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