Esempio n. 1
0
//=========================================================================
// Return the score/frags of a team, depending on whether TeamFrags is on
int TeamFortress_TeamGetScoreFrags(int tno)
{
	CTeam *pTeam = GetGlobalTeam( tno );
	if ( pTeam )
	{
		return pTeam->GetScore();
	}
	else
	{
		Assert( false );
		return -1;
	}
}
void CTeamDeathMatchMissionMgr::Update()
{
	// Check the teams to see if any of them have reached the score limit...
	
	if( m_ServerSettings.m_nScoreLimit > 0 && m_fStartTime >= 0.0f )
	{
		for( uint8 i = 0; i < CTeamMgr::Instance().GetNumTeams(); ++i )
		{
			CTeam *pTeam = CTeamMgr::Instance().GetTeam( i );
			if( pTeam && (pTeam->GetScore() >= m_ServerSettings.m_nScoreLimit) )
			{
				CTeamMgr::Instance( ).WonRound( i );
				g_pLTServer->CPrint( "ScoreLimit reached." );
				NextRound();
			}
		}
	}


	// Skip the CDeathMatchMissionMgr::Update() but be sure to call up...

	CServerMissionMgr::Update( );
}
Esempio n. 3
0
void CHL2MPRules::Think( void )
{

#ifndef CLIENT_DLL

    CGameRules::Think();

    if ( g_fGameOver )   // someone else quit the game already
    {
        // check to see if we should change levels now
        if ( m_flIntermissionEndTime < gpGlobals->curtime )
        {
            if ( !m_bChangelevelDone )
            {
                ChangeLevel(); // intermission is over
                m_bChangelevelDone = true;
            }
        }

        return;
    }

//	float flTimeLimit = mp_timelimit.GetFloat() * 60;
    float flFragLimit = fraglimit.GetFloat();

    if ( GetMapRemainingTime() < 0 )
    {
        GoToIntermission();
        return;
    }

    if ( flFragLimit )
    {
        if( IsTeamplay() == true )
        {
            CTeam *pCombine = g_Teams[TEAM_COMBINE];
            CTeam *pRebels = g_Teams[TEAM_REBELS];

            if ( pCombine->GetScore() >= flFragLimit || pRebels->GetScore() >= flFragLimit )
            {
                GoToIntermission();
                return;
            }
        }
        else
        {
            // check if any player is over the frag limit
            for ( int i = 1; i <= gpGlobals->maxClients; i++ )
            {
                CBasePlayer *pPlayer = UTIL_PlayerByIndex( i );

                if ( pPlayer && pPlayer->FragCount() >= flFragLimit )
                {
                    GoToIntermission();
                    return;
                }
            }
        }
    }

    if ( gpGlobals->curtime > m_tmNextPeriodicThink )
    {
        CheckAllPlayersReady();
        CheckRestartGame();
        m_tmNextPeriodicThink = gpGlobals->curtime + 1.0;
    }

    if ( m_flRestartGameTime > 0.0f && m_flRestartGameTime <= gpGlobals->curtime )
    {
        RestartGame();
    }

    if( m_bAwaitingReadyRestart && m_bHeardAllPlayersReady )
    {
        UTIL_ClientPrintAll( HUD_PRINTCENTER, "All players ready. Game will restart in 5 seconds" );
        UTIL_ClientPrintAll( HUD_PRINTCONSOLE, "All players ready. Game will restart in 5 seconds" );

        m_flRestartGameTime = gpGlobals->curtime + 5;
        m_bAwaitingReadyRestart = false;
    }

    ManageObjectRelocation();

#endif
}
Esempio n. 4
0
void CHUDScoreDiff::Update()
{
	if (!IsMultiplayerGameClient()) return;

	if (GameModeMgr::Instance( ).m_grbEliminationWin)
	{
		CClientInfoMgr *pCIMgr = g_pGameClientShell->GetInterfaceMgr( )->GetClientInfoMgr();
		if (!pCIMgr) return;

		CLIENT_INFO* pCI = pCIMgr->GetFirstClient();

		int32 nEnemiesLeft = 0;
		while (pCI)
		{
			if (pCI && pCI != g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient())
			{
				CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFromClientID(pCI->nID);
				if (pCharacter &&  !pCharacter->IsPlayerDead() && !pCharacter->m_cs.bIsSpectating )
				{
					if (GameModeMgr::Instance( ).m_grbUseTeams)
					{
						if (!pCIMgr->IsLocalTeam(pCI->nTeamID)) 
						{
							++nEnemiesLeft;
						}
					}
					else
					{
						++nEnemiesLeft;
					}
				}
			}
			pCI = pCI->pNext;
		}
		wchar_t wsScore[16] = L"";
		FormatString("HUD_Score_Format",wsScore,LTARRAYSIZE(wsScore),nEnemiesLeft);
		m_Text.SetText(wsScore);
		m_Text.SetColor(m_cTextColor);
	}
	else
	{
		int32 nLocalScore = 0;
		int32 nOtherScore = 0;
		if (GameModeMgr::Instance( ).m_grbUseTeams)
		{
			uint8 nTeam = g_pInterfaceMgr->GetClientInfoMgr()->GetLocalTeam();
			CTeam* pTeam = CTeamMgr::Instance().GetTeam(nTeam);
			if (pTeam)
			{
				nLocalScore = pTeam->GetScore();
			}

			nTeam = 1-nTeam;
			pTeam = CTeamMgr::Instance().GetTeam(nTeam);
			if (pTeam)
			{
				nOtherScore = pTeam->GetScore();
			}
		}
		else
		{
			CLIENT_INFO* pCI = g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient();
			if (pCI)
			{
				nLocalScore = pCI->sScore.GetScore();
			}

			pCI = g_pInterfaceMgr->GetClientInfoMgr()->GetFirstClient();
			if (pCI && pCI == g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient())
			{
				pCI = pCI->pNext;
			}
			if (pCI)
			{
				nOtherScore = pCI->sScore.GetScore();
			}
		}
		wchar_t wsScore[16] = L"";
		int32 nDiff = (nLocalScore-nOtherScore);

		FormatString("HUD_Score_Format",wsScore,LTARRAYSIZE(wsScore),nDiff);
		if (nDiff > 0)
		{
			m_Text.SetColor(m_cWinningTextColor);
			FormatString("HUD_Score_Format_Advantage",wsScore,LTARRAYSIZE(wsScore),nDiff);
		}
		else if (nDiff == 0)
		{
			m_Text.SetColor(m_cTextColor);
		}
		else
		{
			m_Text.SetColor(m_cLosingTextColor);
		}

		m_Text.SetText(wsScore);

	}

}
Esempio n. 5
0
	bool PrintCStrikeEvent( IGameEvent *event )	// print Mod specific logs
	{
		const char *eventName = event->GetName();
	
		// messages that don't have a user associated to them
		if ( !Q_strncmp( eventName, "round_end", Q_strlen("round_end") ) )
		{
			const int winner = event->GetInt( "winner" );
			const int reason = event->GetInt( "reason" );
			const char *msg = event->GetString( "message" );
			msg++; // remove the '#' char

			switch( reason )
			{
			case Game_Commencing:
				UTIL_LogPrintf( "World triggered \"Game_Commencing\"\n" );
				return true;
				break;
			}

			CTeam *ct = GetGlobalTeam( TEAM_CT );
			CTeam *ter = GetGlobalTeam( TEAM_TERRORIST );
			Assert( ct && ter );

			switch ( winner )
			{
			case WINNER_CT:
				UTIL_LogPrintf( "Team \"%s\" triggered \"%s\" (CT \"%i\") (T \"%i\")\n", ct->GetName(), msg, ct->GetScore(), ter->GetScore() );
				break;
			case WINNER_TER:
				UTIL_LogPrintf( "Team \"%s\" triggered \"%s\" (CT \"%i\") (T \"%i\")\n", ter->GetName(), msg, ct->GetScore(), ter->GetScore() );
				break;
			case WINNER_DRAW:
			default:
				UTIL_LogPrintf( "World triggered \"%s\" (CT \"%i\") (T \"%i\")\n", msg, ct->GetScore(), ter->GetScore() );
				break;
			}	

			UTIL_LogPrintf( "Team \"CT\" scored \"%i\" with \"%i\" players\n", ct->GetScore(), ct->GetNumPlayers() );
			UTIL_LogPrintf( "Team \"TERRORIST\" scored \"%i\" with \"%i\" players\n", ter->GetScore(), ter->GetNumPlayers() );
			
			UTIL_LogPrintf("World triggered \"Round_End\"\n");
			return true;
		}
		else if ( !Q_strncmp( eventName, "server_", strlen("server_")) )
		{
			return false; // ignore server_ messages
		}
		
		const int userid = event->GetInt( "userid" );
		CBasePlayer *pPlayer = UTIL_PlayerByUserId( userid );
		if ( !pPlayer )
		{
			return false;
		}

		if ( FStrEq( eventName, "player_hurt" ) )
		{
			const int attackerid = event->GetInt("attacker" );
			const char *weapon = event->GetString( "weapon" );
			CBasePlayer *pAttacker = UTIL_PlayerByUserId( attackerid );
			if ( !pAttacker )
			{
				return false;
			}

			bool isTeamAttack = ( (pPlayer->GetTeamNumber() == pAttacker->GetTeamNumber() ) && (pPlayer != pAttacker) );
			int detail = mp_logdetail.GetInt();
			if ( ( isTeamAttack && ( detail & LOG_DETAIL_TEAMMATE_ATTACKS ) ) ||
				( !isTeamAttack && ( detail & LOG_DETAIL_ENEMY_ATTACKS ) ) )
			{
				int hitgroup = event->GetInt( "hitgroup" );
				const char *hitgroupStr = "GENERIC";
				switch ( hitgroup )
				{
				case HITGROUP_GENERIC:
					hitgroupStr = "generic";
					break;
				case HITGROUP_HEAD:
					hitgroupStr = "head";
					break;
				case HITGROUP_CHEST:
					hitgroupStr = "chest";
					break;
				case HITGROUP_STOMACH:
					hitgroupStr = "stomach";
					break;
				case HITGROUP_LEFTARM:
					hitgroupStr = "left arm";
					break;
				case HITGROUP_RIGHTARM:
					hitgroupStr = "right arm";
					break;
				case HITGROUP_LEFTLEG:
					hitgroupStr = "left leg";
					break;
				case HITGROUP_RIGHTLEG:
					hitgroupStr = "right leg";
					break;
				}

				UTIL_LogPrintf( "\"%s<%i><%s><%s>\" attacked \"%s<%i><%s><%s>\" with \"%s\" (damage \"%d\") (damage_armor \"%d\") (health \"%d\") (armor \"%d\") (hitgroup \"%s\")\n",  
					pAttacker->GetPlayerName(),
					attackerid,
					pAttacker->GetNetworkIDString(),
					pAttacker->GetTeam()->GetName(),
					pPlayer->GetPlayerName(),
					userid,
					pPlayer->GetNetworkIDString(),
					pPlayer->GetTeam()->GetName(),
					weapon,
					event->GetInt( "dmg_health" ),
					event->GetInt( "dmg_armor" ),
					event->GetInt( "health" ),
					event->GetInt( "armor" ),
					hitgroupStr );
			}
			return true;
		}
		else if ( !Q_strncmp( eventName, "player_death", Q_strlen("player_death") ) )
		{
			const int attackerid = event->GetInt("attacker" );
			const char *weapon = event->GetString( "weapon" );
			const bool headShot = (event->GetInt( "headshot" ) == 1);
			CBasePlayer *pAttacker = UTIL_PlayerByUserId( attackerid );

			if ( pPlayer == pAttacker )  
			{  
				UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n",  
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString(),
								pPlayer->GetTeam()->GetName(),
								weapon
								);
			}
			else if ( pAttacker )
			{
				UTIL_LogPrintf( "\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"%s\n",  
								pAttacker->GetPlayerName(),
								attackerid,
								pAttacker->GetNetworkIDString(),
								pAttacker->GetTeam()->GetName(),
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString(),
								pPlayer->GetTeam()->GetName(),
								weapon,
								headShot ? " (headshot)":""
								);								
			}
			else
			{  
				// killed by the world
				UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"world\"\n",
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString(),
								pPlayer->GetTeam()->GetName()
								);
			}
			return true;
		}
		else if ( !Q_strncmp( eventName, "round_start", Q_strlen("round_start") ) )
		{
			UTIL_LogPrintf("World triggered \"Round_Start\"\n");
			return true;
		}
		else if ( !Q_strncmp( eventName, "hostage_follows", Q_strlen("hostage_follows") ) )
		{
			UTIL_LogPrintf( "\"%s<%i><%s><CT>\" triggered \"Touched_A_Hostage\"\n",
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString()
								);
			return true;
		}
		else if ( !Q_strncmp( eventName, "hostage_killed", Q_strlen("hostage_killed") ) )
		{
			UTIL_LogPrintf( "\"%s<%i><%s><%s>\" triggered \"Killed_A_Hostage\"\n", 
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString(),
								pPlayer->GetTeam()->GetName()
								);
			return true;
		}
		else if ( !Q_strncmp( eventName, "hostage_rescued", Q_strlen("hostage_rescued") ) )
		{
			UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Rescued_A_Hostage\"\n",
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString()
								);
			return true;
		}
		else if ( !Q_strncmp( eventName, "bomb_planted", Q_strlen("bomb_planted") ) )
		{
			UTIL_LogPrintf("\"%s<%i><%s><TERRORIST>\" triggered \"Planted_The_Bomb\"\n", 
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString()
								);
			return true;
		}
		else if ( !Q_strncmp( eventName, "bomb_defused", Q_strlen("bomb_defused") ) )
		{
			UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Defused_The_Bomb\"\n", 
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString()
								);
			return true;
		}
		else if ( !Q_strncmp( eventName, "bomb_dropped", Q_strlen("bomb_dropped") ) )
		{
			UTIL_LogPrintf("\"%s<%i><%s><TERRORIST>\" triggered \"Dropped_The_Bomb\"\n", 
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString()
								);
			return true;
		}
		else if ( !Q_strncmp( eventName, "bomb_begindefuse", Q_strlen("bomb_begindefuse") ) )
		{
			const bool haskit = (event->GetInt( "haskit" ) == 1);
			UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"%s\"\n", 
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString(),
								haskit ? "Begin_Bomb_Defuse_With_Kit" : "Begin_Bomb_Defuse_Without_Kit"
								);
			return true;
		}
		else if ( !Q_strncmp( eventName, "bomb_pickup", Q_strlen("bomb_pickup") ) )
		{
			UTIL_LogPrintf("\"%s<%i><%s><TERRORIST>\" triggered \"Got_The_Bomb\"\n", 
								pPlayer->GetPlayerName(),
								userid,
								pPlayer->GetNetworkIDString()
								);
			return true;
		}	
		
// unused events:
//hostage_hurt
//bomb_exploded

		return false;
	}
Esempio n. 6
0
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);
			m_Columns[nTeam][ndx].GetPolyString(4)->SetText(szTmp);

			if (nLocalID == pCI->nID)
			{
				m_Columns[nTeam][ndx].SetColors(playerTextCol,playerTextCol,playerTextCol);
			}
			else
			{
				m_Columns[nTeam][ndx].SetColors(textCol,textCol,textCol);
			}
			
			m_Columns[nTeam][ndx].Show(LTTRUE);

			nHeight[nTeam] += m_Columns[nTeam][ndx].GetBaseHeight();
		}

		pCI = pCI->pNext;
		++count[nTeam];
	}


	
	for (int team = 0; team < kNumTeams; team++)
	{

		m_Team[team].SetColors(textCol,textCol,textCol);
		m_Rounds[team].SetColors(textCol,textCol,textCol);
		m_Header[team].SetColors(textCol,textCol,textCol);

		nHeight[team] += 16;
		m_Frame[team].SetSize(m_nFrameWidth,nHeight[team]);

		while (count[team] < kMaxPlayers)
		{
			m_Columns[team][count[team]].Show(LTFALSE);
			++count[team];
		}

		LTIntPt pos = m_BasePos;
		if (IsTeamGameType() && team > 0)
		{
			pos.y += nHeight[team-1] + 8;
			UpdateTeamPos(team,pos);
		}

	}
	m_SingleFrame.SetSize(m_nFrameWidth,nHeight[0]+8);


	
}
Esempio n. 7
0
// --------------------------------------------------------------------------- //
//
//	ROUTINE:	TeamBalancer::OnEndRound
//
//	PURPOSE:	handle EndRound event
//
// --------------------------------------------------------------------------- //
void TeamBalancer::OnEndRound()
{
	if( !GameModeMgr::Instance().m_grbUseTeams) return;
		

	bool bDidScoreBalance = false;
	if (m_eTeamScoreBalance != eBalanceFrequency_Never)
	{
		++m_nRoundsSinceScoreBalance;

		//if we're doing score balancing, add the player scores to the history
		ServerConnectionMgr::GameClientDataList& gameClientDataList = ServerConnectionMgr::Instance( ).GetGameClientDataList( );
		ServerConnectionMgr::GameClientDataList::iterator iter = gameClientDataList.begin( );
		for( ; iter != gameClientDataList.end( ); iter++ )
		{
			GameClientData* pGameClientData = *iter;
			if( !pGameClientData->GetClient( ))
				continue;
			uint32 nID =  g_pLTServer->GetClientID(pGameClientData->GetClient( ));
			int32 nScore = 0;
			CPlayerScore* pScore = pGameClientData->GetPlayerScore(); 
			if (pScore)
			{
				nScore = pScore->GetScore();
			}
			AddPlayerScore(nID,nScore);
		}

		for (uint8 nTeam = 0;nTeam < 2;++nTeam)
		{
			CTeam* pTeam = CTeamMgr::Instance( ).GetTeam(nTeam);
			if (pTeam)
			{
				m_nTeamScores[nTeam] += pTeam->GetScore();
			}
		}

		//is it time to rebalance?
		bool bDoBalance = false;
		switch(m_eTeamScoreBalance)
		{
		case eBalanceFrequency_OneRound:
			bDoBalance = true;
			break;
		case eBalanceFrequency_TwoRounds:
			bDoBalance = (m_nRoundsSinceScoreBalance >= 2);
			break;
		case eBalanceFrequency_ThreeRounds:
			bDoBalance = (m_nRoundsSinceScoreBalance >= 3);
			break;
		}
		if (bDoBalance)
		{
			bDidScoreBalance = BalanceTeamScore();
		}
	}

	//if we didn't score balance, see if we should size balance
	if (!bDidScoreBalance)
	{
		if (m_eTeamSizeBalance == eBalanceFrequency_QuarterRound ||
			m_eTeamSizeBalance == eBalanceFrequency_HalfRound ||
			m_eTeamSizeBalance == eBalanceFrequency_OneRound
			)
		{
			BalanceTeamSize();
		}
	}
}
Esempio n. 8
0
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;
        }


        int ndx = count[nTeam];



        if (nTeam < kNumTeams)
        {
            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%s%s",pCI->sName.c_str( ), pCI->bIsAdmin ? L"[*]" : L"" );
            m_Columns[nTeam][ndx].SetString( eColumnName, wszTmp );

            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%d",pCI->sScore.GetScore());
            m_Columns[nTeam][ndx].SetString( eColumnScore, wszTmp );

            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%d",pCI->sScore.GetEventCount(CPlayerScore::eKill));
            m_Columns[nTeam][ndx].SetString( eColumnKill, wszTmp );

            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%d",pCI->sScore.GetEventCount(CPlayerScore::eDeath));
            m_Columns[nTeam][ndx].SetString( eColumnDeath, wszTmp );

            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%d",pCI->sScore.GetEventCount(CPlayerScore::eObjective));
            m_Columns[nTeam][ndx].SetString( eColumnObjective, wszTmp );

            if (GameModeMgr::Instance( ).m_grbUseTeams)
            {
                LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%d",pCI->sScore.GetEventCount(CPlayerScore::eTeamKill));
                m_Columns[nTeam][ndx].SetString( eColumnTK, wszTmp );
                m_Columns[nTeam][ndx].ShowColumn(eColumnTK, true);
            }
            else
            {
                m_Columns[nTeam][ndx].ShowColumn(eColumnTK, false);
            }


            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%d",pCI->sScore.GetEventCount(CPlayerScore::eSuicide));
            m_Columns[nTeam][ndx].SetString( eColumnSuicide, wszTmp );

            LTSNPrintF(wszTmp,LTARRAYSIZE(wszTmp),L"%d",pCI->nPing);
            m_Columns[nTeam][ndx].SetString( eColumnPing, wszTmp );

            if (nLocalID == pCI->nID)
            {
                if (!pCharacter || pCharacter->IsPlayerDead() || pCharacter->m_cs.bIsSpectating )
                    m_Columns[nTeam][ndx].SetColor(m_cPlayerDeadColor);
                else
                    m_Columns[nTeam][ndx].SetColor(m_cPlayerTextColor);
            }
            else
            {
                if (!pCharacter || pCharacter->IsPlayerDead() || pCharacter->m_cs.bIsSpectating )
                    m_Columns[nTeam][ndx].SetColor(m_cDeadColor);
                else
                    m_Columns[nTeam][ndx].SetColor(m_cTextColor);
            }

            m_Columns[nTeam][ndx].Show(true);

            nHeight[nTeam] += m_Columns[nTeam][ndx].GetBaseHeight();
        }

        pCI = pCI->pNext;
        ++count[nTeam];
    }



    for (uint8 team = 0; team < kNumTeams; team++)
    {

        m_Team[team].SetColor(m_cTextColor);
        m_Rounds[team].SetColor(m_cTextColor);
        m_Header[team].SetColor(m_cTextColor);

        nHeight[team] += 16;
        m_Frame[team].SetSize(LTVector2n(m_nFrameWidth,nHeight[team]));

        while (count[team] < kMaxPlayers)
        {
            m_Columns[team][count[team]].Show(false);
            ++count[team];
        }

        LTVector2n pos = m_vBasePos;
        g_pInterfaceResMgr->ScaleScreenPos(pos);
        if (GameModeMgr::Instance( ).m_grbUseTeams && team > 0)
        {
            pos.y += nHeight[team-1] + 8;
        }
        UpdateTeamPos(team,pos);

    }
    m_SingleFrame.SetSize(LTVector2n(m_nFrameWidth,nHeight[0]+8));
}