o Fixed a logfile print issue for end of round score ( %f instead of %d )

o 0001154: Do not display Weapon/Res/Level Information to players in the Ready Room
o 0001155: Do not display "Points" to players in the Ready Room
o Fixed a bug where team score was not being reset if mp_tournament mode was changed from 0 to 1
o Fixed a bug where team score was being displayed in the kills column.
o Moved the level/res/weapon column back to the lhs of the value columns.



git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@535 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-06-16 15:07:51 +00:00
parent b5601b6f5f
commit a8a4d4aba3
6 changed files with 40 additions and 32 deletions

View file

@ -147,10 +147,10 @@ SBColumnInfo g_ColumnInfo[NUM_COLUMNS] =
{NULL, 24, Label::a_east}, // status icons
{NULL, 110, Label::a_east}, // name
{NULL, 56, Label::a_east}, // class
{NULL, 40, Label::a_east}, // resources
{"#SCORE", 40, Label::a_east}, // score
{"#KILLS", 40, Label::a_east}, // kills
{"#DEATHS", 40, Label::a_east}, // deaths
{NULL, 40, Label::a_east}, // resources
{"#LATENCY", 40, Label::a_east}, // ping
{"#VOICE", 40, Label::a_east},
{NULL, 2, Label::a_east}, // blank column to take up the slack
@ -482,8 +482,8 @@ void ScorePanel::SortTeams()
for ( int i = 1; i <= m_iNumTeams; i++ )
{
if ( !g_TeamInfo[i].scores_overriden )
g_TeamInfo[i].score = g_TeamInfo[i].frags = g_TeamInfo[i].deaths = 0;
g_TeamInfo[i].ping = g_TeamInfo[i].packetloss = 0;
g_TeamInfo[i].score =0;
g_TeamInfo[i].deaths = g_TeamInfo[i].ping = g_TeamInfo[i].packetloss = 0;
}
// recalc the team scores, then draw them
@ -507,10 +507,10 @@ void ScorePanel::SortTeams()
if ( !g_TeamInfo[j].scores_overriden )
{
g_TeamInfo[j].score += g_PlayerExtraInfo[i].score;
g_TeamInfo[j].frags += g_PlayerExtraInfo[i].frags;
g_TeamInfo[j].deaths += g_PlayerExtraInfo[i].deaths;
}
g_TeamInfo[j].deaths += g_PlayerExtraInfo[i].deaths;
g_TeamInfo[j].frags += g_PlayerExtraInfo[i].frags;
g_TeamInfo[j].ping += g_PlayerInfoList[i].ping;
g_TeamInfo[j].packetloss += g_PlayerInfoList[i].packetloss;
@ -993,7 +993,7 @@ void ScorePanel::FillGrid()
break;
case COLUMN_SCORE:
// Don't show score for enemies unless spectating or in RR
if ((m_iIsATeam[row] == TEAM_YES) && team_info && ((theLocalPlayerTeam == 0) || (theLocalPlayerTeam == team_info->teamnumber)))
if ((m_iIsATeam[row] == TEAM_YES) && team_info && (theLocalPlayerTeam == team_info->teamnumber))
sprintf(sz, "%d", team_info->score);
break;
case COLUMN_EXTRA:
@ -1231,7 +1231,7 @@ void ScorePanel::FillGrid()
#endif
break;
case COLUMN_SCORE:
if(!theIsForEnemy)
if(!theIsForEnemy && theLocalPlayerTeam != TEAM_IND )
{
const float kDeltaDisplayTime = 3.0f;
float theTimeSinceChange = gHUD.GetTimeOfLastUpdate() - theExtraPlayerInfo->timeOfLastScoreChange;
@ -1250,7 +1250,7 @@ void ScorePanel::FillGrid()
break;
case COLUMN_EXTRA:
if(!theIsForEnemy && theExtraPlayerInfo->teamnumber != TEAM_IND && theExtraPlayerInfo->teamnumber != TEAM_SPECT )
if(( !theIsForEnemy || theLocalPlayerTeam == TEAM_SPECT )&& theLocalPlayerTeam != TEAM_IND && theExtraPlayerInfo->teamnumber != TEAM_IND && theExtraPlayerInfo->teamnumber != TEAM_SPECT )
{
if ( isNsMode ) {
if ( theExtraPlayerInfo->teamnumber == TEAM_ONE || theExtraPlayerInfo->teamnumber == TEAM_THREE ) {

View file

@ -20,10 +20,10 @@
#define COLUMN_RANK_ICON 1
#define COLUMN_NAME 2
#define COLUMN_CLASS 3
#define COLUMN_SCORE 4
#define COLUMN_KILLS 5
#define COLUMN_DEATHS 6
#define COLUMN_EXTRA 7
#define COLUMN_EXTRA 4
#define COLUMN_SCORE 5
#define COLUMN_KILLS 6
#define COLUMN_DEATHS 7
#define COLUMN_LATENCY 8
#define COLUMN_VOICE 9
#define COLUMN_BLANK 10

View file

@ -2580,8 +2580,8 @@ int TeamFortressViewport::MsgFunc_ScoreInfo( const char *pszName, int iSize, voi
int TeamFortressViewport::MsgFunc_TeamScore( const char *pszName, int iSize, void *pbuf )
{
string team_name;
int score, deaths;
NetMsg_TeamScore( pbuf, iSize, team_name, score, deaths );
int score, reset;
NetMsg_TeamScore( pbuf, iSize, team_name, score, reset);
// find the team matching the name
for ( int i = 1; i <= m_pScoreBoard->m_iNumTeams; i++ )
@ -2594,9 +2594,12 @@ int TeamFortressViewport::MsgFunc_TeamScore( const char *pszName, int iSize, voi
return 1;
// use this new score data instead of combined player scores
g_TeamInfo[i].scores_overriden = TRUE;
g_TeamInfo[i].frags = score;
g_TeamInfo[i].deaths = deaths;
if ( reset )
g_TeamInfo[i]. scores_overriden = FALSE;
else
g_TeamInfo[i]. scores_overriden = TRUE;
g_TeamInfo[i].score = score;
return 1;
}

View file

@ -1916,8 +1916,8 @@ void AvHGamerules::TallyVictoryStats() const
theLosingTeam = &this->mTeamA;
}
ALERT(at_logged, "Team \"%d\" scored \"%d\" with \"%d\" players\n", this->mTeamA.GetTeamNumber(), this->mTeamA.GetTotalResourcesGathered(), this->mTeamA.GetPlayerCount());
ALERT(at_logged, "Team \"%d\" scored \"%d\" with \"%d\" players\n", this->mTeamB.GetTeamNumber(), this->mTeamB.GetTotalResourcesGathered(), this->mTeamB.GetPlayerCount());
ALERT(at_logged, "Team \"%d\" scored \"%.2f\" with \"%d\" players\n", this->mTeamA.GetTeamNumber(), this->mTeamA.GetTotalResourcesGathered(), this->mTeamA.GetPlayerCount());
ALERT(at_logged, "Team \"%d\" scored \"%.2f\" with \"%d\" players\n", this->mTeamB.GetTeamNumber(), this->mTeamB.GetTotalResourcesGathered(), this->mTeamB.GetPlayerCount());
if(!this->mVictoryDraw)
{
@ -4116,13 +4116,18 @@ void AvHGamerules::UpdateVictoryStatus(void)
// Final game time update to all clients have same winning time
this->SendGameTimeUpdate(true);
// Send final score to everyone if needed
this->mTeamA.SendResourcesGatheredScore(false);
this->mTeamB.SendResourcesGatheredScore(false);
END_FOR_ALL_ENTITIES(kAvHPlayerClassName)
// Send final score to everyone if needed
this->mTeamA.SendResourcesGatheredScore(false);
this->mTeamB.SendResourcesGatheredScore(false);
// Tell everyone that the game ended
NetMsg_GameStatus_State( kGameStatusEnded, this->mMapMode );
NetMsg_TeamScore(this->mTeamA.GetTeamName(), 0, 1 );
NetMsg_TeamScore(this->mTeamB.GetTeamName(), 0, 1 );
}
}
}

View file

@ -732,30 +732,30 @@ void Net_InitializeMessages(void)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#ifndef AVH_SERVER
void NetMsg_TeamScore( void* const buffer, const int size, string& team_name, int& score, int& deaths )
void NetMsg_TeamScore( void* const buffer, const int size, string& team_name, int& score, int& reset )
{
BEGIN_READ( buffer, size );
team_name = READ_STRING();
score = READ_SHORT();
deaths = READ_SHORT();
reset = READ_SHORT();
END_READ();
}
#else
void NetMsg_TeamScore( entvars_t* const pev, const string& team_name, const int score, const int deaths )
void NetMsg_TeamScore( entvars_t* const pev, const string& team_name, const int score, const int reset )
{
MESSAGE_BEGIN( MSG_ONE, g_msgTeamScore, NULL, pev );
WRITE_STRING( team_name.c_str() );
WRITE_SHORT( score );
WRITE_SHORT( deaths );
WRITE_SHORT( reset );
MESSAGE_END();
}
void NetMsg_TeamScore( const string& team_name, const int score, const int deaths )
void NetMsg_TeamScore( const string& team_name, const int score, const int reset )
{
MESSAGE_BEGIN( MSG_ALL, g_msgTeamScore );
WRITE_STRING( team_name.c_str() );
WRITE_SHORT( score );
WRITE_SHORT( deaths );
WRITE_SHORT( reset );
MESSAGE_END();
}
#endif
@ -2206,4 +2206,4 @@ const int kEntHierFlagUnderAttack = 0x04;
MESSAGE_END();
}
#endif
// :tankefugl
// :tankefugl

View file

@ -65,7 +65,7 @@
void NetMsg_StatusValue( entvars_t* const pev, const int location, const int state );
void NetMsg_TeamInfo( entvars_t* const pev, const int player_index, const string& team_id );
void NetMsg_TeamNames( entvars_t* const pev, const vector<string>& team_names );
void NetMsg_TeamScore( entvars_t* const pev, const string& team_name, const int score, const int deaths );
void NetMsg_TeamScore( entvars_t* const pev, const string& team_name, const int score, const int reset );
void NetMsg_TextMsg( entvars_t* const pev, const int destination, const vector<string>& message );
void NetMsg_Train( entvars_t* const pev, const int state );
void NetMsg_WeaponList( entvars_t* const pev, const WeaponList& weapon );
@ -116,7 +116,7 @@
void NetMsg_GameStatus_Time( const int status_code, const int map_mode, const int game_time, const int timelimit, const int attacking_team_number, const bool is_reliable );
void NetMsg_SayText( const int entity_index, const string& text, const string& location );
void NetMsg_TeamInfo( const int player_index, const string& team_id );
void NetMsg_TeamScore( const string& team_name, const int score, const int deaths );
void NetMsg_TeamScore( const string& team_name, const int score, const int reset );
void NetMsg_TextMsg( const int destination, const vector<string>& message );
void NetMsg_ScoreInfo( const ScoreInfo& info );
void NetMsg_UpdateCountdown( const int countdown );
@ -162,7 +162,7 @@
void NetMsg_StatusValue( void* const buffer, const int size, int& location, int& state );
void NetMsg_TeamInfo( void* const buffer, const int size, int& player_index, string& team_id );
void NetMsg_TeamNames( void* const buffer, const int size, vector<string>& team_names );
void NetMsg_TeamScore( void* const buffer, const int size, string& team_name, int& score, int& deaths );
void NetMsg_TeamScore( void* const buffer, const int size, string& team_name, int& score, int& reset );
void NetMsg_TextMsg( void* const buffer, const int size, int& destination, vector<string>& message );
//30
void NetMsg_Train( void* const buffer, const int size, int& state );