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


C++ CClientInfoMgr类代码示例

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


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

示例1: AddFragFn

void AddFragFn(int argc, char **argv)
{
	uint32 nID = 0;
	int nFragCount =0;
	if (argc > 0)
	{
		nID =  (uint32)atoi(argv[0]);
		if (argc > 1)
		{
			nFragCount = atoi(argv[1]);
		}
	}

	CClientInfoMgr *pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
	if (pCIMgr)
	{
		CLIENT_INFO *ptr = pCIMgr->GetFirstClient();
		while (ptr)
		{
			if (ptr->nID == nID)
			{
				pCIMgr->AddFrag(nID);
				break;
			}
			ptr = ptr->pNext;
		}
	}

}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:29,代码来源:ClientInfoMgr.cpp

示例2: AddClientFn

void AddClientFn(int argc, char **argv)
{
	HSTRING hstrName = LTNULL; 
	uint32 nID = 0;
	uint8 nTeam = 0;
	if (g_pGameClientShell->GetGameType() == COOPERATIVE_ASSAULT)
	{
		nTeam = (uint8)GetRandom(1,2);
	}
	int nFragCount =GetRandom(3);

	if (argc > 0)
	{
		hstrName = g_pLTClient->CreateString(argv[0]);
		if (argc > 1)
		{
			nID = atoi(argv[1]);
		}
	}

	
	CClientInfoMgr *pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
	if (pCIMgr && hstrName)
	{
		if (!nID)
			nID = pCIMgr->GetNumClients()+1;
		pCIMgr->AddClient(hstrName,nID,nFragCount,nTeam);
		ListClientFn(0,LTNULL);
	}

}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:31,代码来源:ClientInfoMgr.cpp

示例3: BootPlayer

void CCheatMgr::BootPlayer(CParsedMsgW const& cMsg)
{
	if (!IsMultiplayerGameClient()) return;

	CClientInfoMgr *pCIMgr = g_pGameClientShell->GetInterfaceMgr( )->GetClientInfoMgr();
	if (!pCIMgr) return;

	if( cMsg.GetArgCount() < 2 )
		return;

	// The full name of the player might be split between several 
	// arguments of the message so build the name from all arguments
	// except the name of the actual cheat (Arg 1).
	
	wchar_t szPlayerName[MAX_PLAYER_NAME] = {0};
	cMsg.ReCreateMsg( szPlayerName, LTARRAYSIZE( szPlayerName ), 1 );

	CLIENT_INFO* pInfo = pCIMgr->GetFirstClient();
	while (pInfo && LTStrICmp(pInfo->sName.c_str(),szPlayerName) != 0)
		pInfo = pInfo->pNext;

	if (pInfo)
	{

		// Tell the server
		SendCheatMessage( CHEAT_BOOT, pInfo->nID );
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:28,代码来源:CheatMgr.cpp

示例4: ListClientFn

void ListClientFn(int argc, char **argv)
{
	CClientInfoMgr *pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
	if (pCIMgr)
	{
		CLIENT_INFO *ptr = pCIMgr->GetFirstClient();
		while (ptr)
		{
			g_pLTClient->CPrint("%d %s %d",ptr->nID,g_pLTClient->GetStringData(ptr->hstrName),ptr->nFrags);
			ptr = ptr->pNext;
		}
	}

}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:14,代码来源:ClientInfoMgr.cpp

示例5: Build

void CTeamMenu::Build()
{
	//add items
	CClientInfoMgr *pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
	if (pCIMgr)
	{
		m_pMenuWnd->AddItem(pCIMgr->GetTeam(1)->szName,1);
		m_pMenuWnd->AddItem(pCIMgr->GetTeam(2)->szName,2);
	}
	else
	{
		m_pMenuWnd->AddItem("Team 1",1);
		m_pMenuWnd->AddItem("Team 2",2);
	}
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:15,代码来源:MultiplayerMenu.cpp

示例6: UpdateMarker

void CBodyFX::UpdateMarker()
{
	if (!m_pClientDE || !m_hServerObject) return;

	CClientInfoMgr *pClientMgr = g_pInterfaceMgr->GetClientInfoMgr();
	if (!pClientMgr) return;

	CLIENT_INFO* pLocalInfo = pClientMgr->GetLocalClient();
	CLIENT_INFO* pInfo = pClientMgr->GetClientByID(m_bs.nClientId);
	if (!pInfo ||  !pLocalInfo) return;
	LTBOOL bSame = (pInfo->team == pLocalInfo->team);

	if (bSame)
	{
		if (m_hMarker)
			RemoveMarker();
		return;
	}

    uint32 dwFlags = g_pLTClient->GetObjectFlags(m_hServerObject);
	if (!(dwFlags & FLAG_VISIBLE))
	{
		RemoveMarker();
		return;
	}


    LTVector vU, vR, vF, vTemp, vDims, vPos;
    LTRotation rRot;

    ILTPhysics* pPhysics = m_pClientDE->Physics();

	m_pClientDE->GetObjectPos(m_hServerObject, &vPos);
	pPhysics->GetObjectDims(m_hServerObject, &vDims);
	vPos.y += (vDims.y + 20.0f);

	if (!m_hMarker)
	{
		CreateMarker(vPos,bSame);
	}

	if (m_hMarker)
	{
		m_pClientDE->SetObjectPos(m_hMarker, &vPos);
	}
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:46,代码来源:BodyFX.cpp

示例7: UpdateNamePositions

void CHUDRadar::UpdateNamePositions()
{

	float fx = (float)(m_NamePos.x) * g_pInterfaceResMgr->GetXRatio();
	float fy = (float)(m_NamePos.y) * g_pInterfaceResMgr->GetYRatio();

	if( IsTeamGameType() )
	{
		CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
		CLIENT_INFO *pLocalCI = pCIMgr->GetLocalClient();
		uint8 nTeam = 0;
		if( pLocalCI)
		{
			nTeam = pLocalCI->nTeamID;
		}

		g_pDrawPrim->SetRGBA4( &teamPoly, nTeamColors[nTeam][1], nTeamColors[nTeam][0], nTeamColors[nTeam][1], nTeamColors[nTeam][2] );

		float fw = 90.0f * g_pInterfaceResMgr->GetXRatio();
		float fh = 90.0f * g_pInterfaceResMgr->GetYRatio();

		g_pDrawPrim->SetXYWH( &teamPoly, fx-fw, fy, fw, fh);

	}

		
	RadarPlayerList::iterator iter = m_Players.begin();
	while (iter != m_Players.end())
	{
		CUIFormattedPolyString* pStr = (*iter)->pName;

		if (pStr->GetLength())
		{
			uint8 nSize = (uint8)(12.0f * g_pInterfaceResMgr->GetXRatio());
			pStr->SetCharScreenHeight(nSize);
			
			pStr->SetPosition(fx,fy);
			fy += (float)pStr->GetHeight();
			
		}
		iter++;
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:43,代码来源:HUDRadar.cpp

示例8: RemoveClientFn

void RemoveClientFn(int argc, char **argv)
{
	HSTRING hstrName = LTNULL; 
	uint32 nID = 0;
	int nFragCount =0;

	if (argc > 0)
	{
		nID = atoi(argv[0]);
	}
	
	CClientInfoMgr *pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
	if (pCIMgr)
	{
		pCIMgr->RemoveClient(nID);
		ListClientFn(0,LTNULL);
	}

}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:19,代码来源:ClientInfoMgr.cpp

示例9: UpdatePlayerID

void CHUDRadar::UpdatePlayerID(HOBJECT hObj, uint32 nId)
{
	if (!hObj) return;
	CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
	CLIENT_INFO* pCI = pCIMgr->GetClientByID(nId);

	RadarPlayerList::iterator iter = m_Players.begin();
	while (iter != m_Players.end() &&  (*iter)->hObj != hObj )
	{
		iter++;
	}

	if (iter != m_Players.end())
	{
		(*iter)->nID = nId;

		if (pCI)
		{
			(*iter)->pName->SetText(pCI->sName.c_str());
			UpdateNamePositions();
		}
	}
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:23,代码来源:HUDRadar.cpp

示例10: AddPlayer

void CHUDRadar::AddPlayer(HOBJECT hObj, uint32 nId)
{
	if (!hObj) return;
	CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
	CLIENT_INFO* pCI = pCIMgr->GetClientByID(nId);
	HOBJECT hLocalObj = g_pLTClient->GetClientObject();


	uint8 nTeamID = INVALID_TEAM;

	// Check for teams and only display players of the same team...
	if( IsTeamGameType() && hLocalObj != hObj)
	{
		CLIENT_INFO *pLocalCI = pCIMgr->GetLocalClient();
		if( !pLocalCI || !pCI )
			return;
	
		if( pLocalCI->nTeamID != pCI->nTeamID )
			return;

		nTeamID = pCI->nTeamID;

	}
	

	bool bDead = false;

	if (hLocalObj != hObj)
	{

		AddObject( hObj, RADAR_PLAYER_ALIVE_TYPE, nTeamID );
		
	}

	CCharacterFX *pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFX(hObj);
	if (pCharacter && pCharacter->IsPlayerDead())
	{
		bDead = true;
	}


	RadarPlayerList::iterator iter = m_Players.begin();
	while (iter != m_Players.end() &&  ( (*iter)->hObj != hObj ) )
	{
		iter++;
	}

	RADAR_PLAYER_OBJ* pPlayer = NULL;

	//new player...
	if (iter == m_Players.end())
	{
		pPlayer = debug_new(RADAR_PLAYER_OBJ);
		m_Players.push_back(pPlayer);
	}
	else
	{
		pPlayer = (*iter);
	}

	pPlayer->nID = nId;
	pPlayer->hObj = hObj;
	
	if (!pPlayer->pName)
	{
		uint8 nFont = 0;
		CUIFont* pFont = g_pInterfaceResMgr->GetFont(nFont);
		pPlayer->pName = g_pFontManager->CreateFormattedPolyString(pFont,"",0.0f,0.0f);
		pPlayer->pName->SetAlignmentH(CUI_HALIGN_RIGHT);
	}

	if (pCI)
	{
		pPlayer->pName->SetText(pCI->sName.c_str());
	}

	SetPlayerDead(hObj,bDead);
	
	UpdateNamePositions();
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:80,代码来源:HUDRadar.cpp

示例11: CheckPlayersWithinTrigger


//.........这里部分代码省略.........
				bool bWithinHeight = false;
				if( vPlayerMax.y > vTrigMin.y && vPlayerMin.y < vTrigMax.y )
					bWithinHeight = true;

				if( bWithinHeight && BoxesIntersect( vTrigMin, vTrigMax, vPlayerMin, vPlayerMax ) && !pChar->IsPlayerDead())
				{
					if( dwLocalId == pChar->m_cs.nClientID )
						bLocalPlayerIn = true;

					// If it wasn't in the list add it...

					if( iter == m_lstCurPlayersInTrigger.end() )
					{
						m_lstCurPlayersInTrigger.push_back( pChar );
						m_lstNewPlayersInTrigger.push_back( pChar );
					}

				}
				else
				{
					if( iter != m_lstCurPlayersInTrigger.end() )
						m_lstCurPlayersInTrigger.erase( iter );

					m_lstPlayersNotInTrigger.push_back( pChar );
				}
			}
		}
	}

	wchar_t wszBuffer[256];

	if( (m_lstNewPlayersInTrigger.size() > 0) && (nNumPlayersFound > 1) )
	{
		CClientInfoMgr *pInfoMgr = g_pInterfaceMgr->GetClientInfoMgr();
		if( !pInfoMgr )
			return;

		if( bLocalPlayerIn )
		{
			// Display a general transmission and messages for each player you are waiting for...

			int nPlayersNotInTrig = m_lstPlayersNotInTrigger.size();

			if( m_cs.nPlayerInsideID != (uint32)-1 )
			{
				g_pTransmission->Show( StringIDFromIndex(m_cs.nPlayerInsideID) );
			}
			else if( nPlayersNotInTrig > 1 )
			{
				//sTransmission.Format( "You are waiting for %i players.", nPlayersNotInTrig );
				FormatString( "IDS_EXIT_PLAYER_WAITING", wszBuffer, LTARRAYSIZE(wszBuffer), nPlayersNotInTrig );
				g_pTransmission->Show( wszBuffer );
			}
			else
			{
				//sTransmission.Format( "You are waiting for 1 player." );
				FormatString( "IDS_EXIT_PLAYER_WAITING_1", wszBuffer, LTARRAYSIZE(wszBuffer) );
				g_pTransmission->Show( wszBuffer );
			}		
			
			
			CharFXList::iterator iter;
			for( iter = m_lstPlayersNotInTrigger.begin(); iter != m_lstPlayersNotInTrigger.end(); ++iter )
			{
				//sMessage.Format( "You are waiting for %s.", pInfoMgr->GetPlayerName( (*iter)->m_cs.nClientID ));
				FormatString( "IDS_EXIT_PLAYER_WAITING_NAME", wszBuffer, LTARRAYSIZE(wszBuffer), pInfoMgr->GetPlayerName( (*iter)->m_cs.nClientID) );
开发者ID:Arc0re,项目名称:lithtech,代码行数:67,代码来源:TriggerFX.cpp

示例12: sprintf

void CHUDScores::Update()
{
	if (m_nDraw <= 0) return;

	uint32 textCol = (m_bScreen ? m_nScreenTextColor : m_nTextColor);
	uint32 playerTextCol = (m_bScreen ? m_nScreenPlayerTextColor : m_nPlayerTextColor);

	float fScale = g_pInterfaceResMgr->GetXRatio();
	if (fScale != m_fScale)
	{
		m_fScale = fScale;
		m_Server.SetScale(fScale);
		m_SingleFrame.SetScale(fScale);
		for (int team = 0; team < kNumTeams; team++)
		{
			m_Team[team].SetScale(fScale);
			m_Rounds[team].SetScale(fScale);
			m_Header[team].SetScale(fScale);
			m_Frame[team].SetScale(fScale);

			for (int i = 0; i < kMaxPlayers; i++)
			{
				m_Columns[team][i].SetScale(fScale);
			}
		}

	}

	if (IsTeamGameType())
	{
		CUserProfile *pProfile = g_pProfileMgr->GetCurrentProfile();

		for( uint8 team = 0; team < kNumTeams; ++team )
		{
			CTeam* pTeam = CTeamMgr::Instance().GetTeam(team);
			if (!pTeam) continue;
			
			char szTmp[128];
			sprintf(szTmp,"%s : %d",pTeam->GetName(),pTeam->GetScore());
			m_Team[team].SetString(szTmp);

			sprintf(szTmp,"%s : %d", LoadTempString(IDS_ROUNDS), pTeam->GetRoundScore( ));
			m_Rounds[team].SetString(szTmp);
		
			m_Header[team].Show(LTTRUE);
		}

	}
	else
	{
		m_Team[0].SetString("");
		m_Rounds[0].SetString("");
		m_Header[1].Show(LTFALSE);
	}


	m_Server.SetColors(textCol,textCol,textCol);

	CClientInfoMgr *pCIMgr = g_pGameClientShell->GetInterfaceMgr( )->GetClientInfoMgr();
	if (!pCIMgr) return;

	CLIENT_INFO* pCI = pCIMgr->GetFirstClient();
	int nTotal = 0;
	int count[kNumTeams] = {0,0};
	char szTmp[64] = "";
	uint16 nHeight[kNumTeams];
	nHeight[0] = m_Server.GetBaseHeight() + m_Header[0].GetBaseHeight() + m_Team[0].GetBaseHeight() + 24;
	nHeight[1] = m_Team[1].GetBaseHeight() + m_Header[1].GetBaseHeight() + 16;
	uint32 nLocalID = 0;
	g_pLTClient->GetLocalClientID (&nLocalID);


	while (pCI && (nTotal < kMaxPlayers))
	{
		uint8 nTeam = 0;
		
		if (IsTeamGameType())
		{
			nTeam = pCI->nTeamID;
		}


		int ndx = count[nTeam];


		
		if (nTeam < kNumTeams)
		{
			sprintf( szTmp, "%s%s",pCI->sName.c_str( ), pCI->bIsAdmin ? "[*]" : "" );
			m_Columns[nTeam][ndx].GetPolyString(0)->SetText( szTmp );
			sprintf(szTmp,"%d",pCI->sScore.GetScore());
			m_Columns[nTeam][ndx].GetPolyString(1)->SetText(szTmp);

			sprintf(szTmp,"%d",pCI->sScore.GetFrags());
			m_Columns[nTeam][ndx].GetPolyString(2)->SetText(szTmp);

			sprintf(szTmp,"%d",pCI->sScore.GetTags());
			m_Columns[nTeam][ndx].GetPolyString(3)->SetText(szTmp);

			sprintf(szTmp,"%d",pCI->nPing);
//.........这里部分代码省略.........
开发者ID:rickyharis39,项目名称:nolf2,代码行数:101,代码来源:HUDScores.cpp

示例13: HandleVoteStart

void ClientVoteMgr::HandleVoteStart(ILTMessage_Read* pMsg)
{
	m_CurrentVote.m_nVoteID = pMsg->Readuint8();
	VoteType eVoteType = (VoteType)pMsg->ReadBits( FNumBitsExclusive<kNumVoteTypes>::k_nValue );
	m_CurrentVote.m_eVoteType = eVoteType;
	m_CurrentVote.m_nCallerID = pMsg->Readuint32();
	m_CurrentVote.m_nTargetID = pMsg->Readuint32();
	m_CurrentVote.m_nVotesNeeded = pMsg->Readuint8();
	m_VoteTimer.Start(pMsg->Readdouble());

	m_CurrentVote.m_nYesVotes = 1; //count the person who called the vote

	uint32 nLocalID = 0;
	g_pLTClient->GetLocalClientID (&nLocalID);

	//if I'm the one who called the vote, I've already voted yes
	m_bHasVoted = (nLocalID == m_CurrentVote.m_nCallerID);

	wchar_t wszMsg[256] = L"";
	wchar_t wszTxt[256] = L"";
	CClientInfoMgr *pCIMgr = g_pGameClientShell->GetInterfaceMgr( )->GetClientInfoMgr();
	if (!pCIMgr)
	{
		LTERROR("ClientInfoMgr not available");
		return;
	}

	switch(eVoteType)
	{
	case eVote_Kick:
		m_sTargetName = pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID);

		FormatString("Vote_StartKick",wszMsg,LTARRAYSIZE(wszMsg),pCIMgr->GetPlayerName(m_CurrentVote.m_nCallerID),pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID));
		FormatString("Vote_Kick",wszTxt,LTARRAYSIZE(wszTxt),pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID));

		break;
	case eVote_TeamKick:
		m_sTargetName = pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID);

		FormatString("Vote_StartTeamKick",wszMsg,LTARRAYSIZE(wszMsg),pCIMgr->GetPlayerName(m_CurrentVote.m_nCallerID),pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID));
		FormatString("Vote_TeamKick",wszTxt,LTARRAYSIZE(wszTxt),pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID));

		break;
	case eVote_Ban:
		m_sTargetName = pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID);

		FormatString("Vote_StartBan",wszMsg,LTARRAYSIZE(wszMsg),pCIMgr->GetPlayerName(m_CurrentVote.m_nCallerID),pCIMgr->GetPlayerName(m_CurrentVote.m_nTargetID));
		FormatString("Vote_Ban",wszTxt,LTARRAYSIZE(wszTxt),m_sTargetName.c_str());

		break;
	case eVote_NextRound:
		m_sTargetName = L"";

		FormatString("Vote_StartNextRound",wszMsg,LTARRAYSIZE(wszMsg),pCIMgr->GetPlayerName(m_CurrentVote.m_nCallerID));
		FormatString("Vote_NextRound",wszTxt,LTARRAYSIZE(wszTxt));

		break;
	case eVote_NextMap:
		m_sTargetName = L"";

		FormatString("Vote_StartNextMap",wszMsg,LTARRAYSIZE(wszMsg),pCIMgr->GetPlayerName(m_CurrentVote.m_nCallerID));
		FormatString("Vote_NextMap",wszTxt,LTARRAYSIZE(wszTxt));

		break;
	case eVote_SelectMap:
		m_sTargetName = g_pMissionMgr->GetMapList()[m_CurrentVote.m_nTargetID].c_str();

		FormatString("Vote_StartSelectMap",wszMsg,LTARRAYSIZE(wszMsg),pCIMgr->GetPlayerName(m_CurrentVote.m_nCallerID),m_sTargetName.c_str());
		FormatString("Vote_SelectMap",wszTxt,LTARRAYSIZE(wszTxt),m_sTargetName.c_str());

		break;
	}

	g_pGameMsgs->AddMessage(wszMsg);
	g_pTransmission->Show(wszMsg);
	m_sVoteString = wszTxt;

	g_pHUDMgr->QueueUpdate(kHUDVote);

}
开发者ID:Arc0re,项目名称:lithtech,代码行数:80,代码来源:ClientVoteMgr.cpp

示例14: FirstUpdate


//.........这里部分代码省略.........
		CCharacterFX* const pFX = (CCharacterFX*)g_pGameClientShell->GetSFXMgr()->FindSpecialFX(SFX_CHARACTER_ID, m_hTarget);

		// All we care about if we're on a vehicle (or if we are dead) is the Multiplayer check below...

		if (!bPlayersOnly)
		{
			//display debug info if we have any 
			if( pFX && pFX->GetInfoString() && *pFX->GetInfoString() )
			{
				g_pHUDDebug->SetTargetDebugString(pFX->GetInfoString());
			}
			else
			{
				g_pHUDDebug->SetTargetDebugString(L"");
			}

			// is this a person we can talk to?
			if (dwUserFlags & USRFLG_CAN_ACTIVATE)
			{
				if (fDistAway <= g_vtActivationDistance.GetFloat())
				{
					// SetTargetStringID(IDS_TARGET_TALK);
					return;
				}
			}
		}

		// This is the only thing we care about if we're dead or on a vehicle...(we care
		// if we're off a vehicle too)

		if (IsMultiplayerGameClient() && pFX && pFX->m_cs.bIsPlayer )
		{
			uint32 nId = pFX->m_cs.nClientID;
			CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
			CLIENT_INFO* pCI = pCIMgr->GetClientByID(nId);

			if (pCI)
			{
				m_szStringID = NULL;
				LTStrCpy(m_wszString, pCI->sName.c_str(), LTARRAYSIZE(m_wszString));

				if (GameModeMgr::Instance( ).m_grbUseTeams)
				{
					m_nTargetTeam = pCI->nTeamID;
				}
			}
			return;
		}

		// All we care about if we're dead or on a vehicle is the Multiplayer check above...

		if (!bPlayersOnly)
		{
			if(pFX)
			{
				if (fDistAway <= g_vtTargetDistance.GetFloat()) 
				{
					// If a nameid was specified for the model display the name...
					const char* szNameId = g_pModelsDB->GetModelNameId( pFX->m_cs.hModel );
					if( szNameId && (szNameId[0] != '\0') )
					{
						//SetTargetStringID( nNameId );
						return;
					}
				}
			}
开发者ID:Arc0re,项目名称:lithtech,代码行数:67,代码来源:TargetMgr.cpp

示例15: LTSNPrintF

void CHUDScores::Update()
{
    if( !m_bInitialized )
        return;

    if( !m_bDraw )
        return;

//	uint32 textCol = (m_bScreen ? m_cScreenTextColor : m_cTextColor);
//	uint32 playerTextCol = (m_bScreen ? m_cScreenPlayerTextColor : m_cPlayerTextColor);

    //for the screen mode scoreboard, don't update the text once we've drawn it
    if (m_bScreen && !m_bFirstScreenUpdate)
        return;

    m_bFirstScreenUpdate = false;

    if (GameModeMgr::Instance( ).m_grbUseTeams)
    {
        for( uint8 nTeamNum = 0; nTeamNum < kNumTeams; ++nTeamNum )
        {
            uint8 team;
            if (g_pInterfaceMgr->GetClientInfoMgr()->IsLocalTeam(nTeamNum))
                team = 0;
            else
                team = 1;

            CTeam* pTeam = CTeamMgr::Instance().GetTeam(nTeamNum);
            if (!pTeam) continue;

            wchar_t wszTmp[128];
            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%s : %d",pTeam->GetName(),pTeam->GetScore());
            m_Team[team].SetString(wszTmp);

            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%s : %d", LoadString("IDS_ROUNDS"), pTeam->GetRoundScore( ));
            m_Rounds[team].SetString(wszTmp);

            m_Header[team].Show(true);
        }

    }
    else
    {
        m_Team[0].SetString(L"");
        m_Rounds[0].SetString(L"");
        m_Header[1].Show(false);
    }


    m_Server.SetColor(m_cTextColor);

    if ( !GameModeMgr::Instance( ).m_grwsSessionName.GetValue().empty())
    {
        std::wstring wstr = GameModeMgr::Instance( ).m_grwsSessionName;
        if ( g_pClientConnectionMgr->IsConnectedToRemoteServer( ))
        {
            wstr += L" : ";
            wstr += MPA2W(g_pClientConnectionMgr->GetStartGameRequest( ).m_TCPAddress).c_str();
        }

        m_Server.SetString(wstr.c_str());
    }
    else
    {
        m_Server.SetString(L"");
    }

    // Update the round counter.
    m_RoundInfo.SetColor(m_cTextColor);
    wchar_t wszRound[32];
    uint8 nCurrentRound = g_pClientConnectionMgr ? g_pClientConnectionMgr->GetCurrentRound() : 0;
    uint8 nNumRounds = GameModeMgr::Instance( ).m_grnNumRounds;
    FormatString( "HUD_SCORES_ROUNDINFO", wszRound, LTARRAYSIZE( wszRound ), nCurrentRound + 1, nNumRounds );
    m_RoundInfo.SetString( wszRound );

    CClientInfoMgr *pCIMgr = g_pGameClientShell->GetInterfaceMgr( )->GetClientInfoMgr();
    if (!pCIMgr) return;

    CLIENT_INFO* pCI = pCIMgr->GetFirstClient();
    int nTotal = 0;
    int count[kNumTeams] = {0,0};
    wchar_t wszTmp[64] = L"";
    uint32 nHeight[kNumTeams];
    nHeight[0] = m_Server.GetBaseHeight() + m_Header[0].GetBaseHeight() + m_Team[0].GetBaseHeight() + 24;
    nHeight[1] = m_Team[1].GetBaseHeight() + m_Header[1].GetBaseHeight() + 16;
    uint32 nLocalID = 0;
    g_pLTClient->GetLocalClientID (&nLocalID);


    while (pCI && (nTotal < kMaxPlayers))
    {
        uint8 nTeam = 0;
        CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFromClientID(pCI->nID);

        if (GameModeMgr::Instance( ).m_grbUseTeams)
        {
            if (g_pInterfaceMgr->GetClientInfoMgr()->IsLocalTeam(pCI->nTeamID))
                nTeam = 0;
            else
                nTeam = 1;
//.........这里部分代码省略.........
开发者ID:jordandavidson,项目名称:lithtech,代码行数:101,代码来源:HUDScores.cpp


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