Remove time-score

This commit is contained in:
Learath 2019-05-14 15:21:07 +02:00 committed by Learath2
parent 131a0e370d
commit 23255a04b3
7 changed files with 4 additions and 32 deletions

View file

@ -212,7 +212,6 @@ public:
virtual void OnRconType(bool UsernameReq) = 0;
virtual void OnRconLine(const char *pLine) = 0;
virtual void OnTimeScore(int AllowTimeScore, bool Dummy) = 0;
virtual void OnInit() = 0;
virtual void OnNewSnapshot() = 0;
virtual void OnEnterGame() = 0;

View file

@ -725,8 +725,6 @@ void CClient::Connect(const char *pAddress, const char *pPassword)
m_GametimeMarginGraph.Init(-150.0f, 150.0f);
GenerateTimeoutCodes();
GameClient()->OnTimeScore(1, false);
}
void CClient::DisconnectWithReason(const char *pReason)
@ -812,8 +810,6 @@ void CClient::DummyConnect()
//connecting to the server
m_NetClient[1].Connect(&m_ServerAddress);
GameClient()->OnTimeScore(1, true);
}
void CClient::DummyDisconnect(const char *pReason)
@ -1948,13 +1944,6 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket)
bool UsernameReq = Unpacker.GetInt() & 1;
GameClient()->OnRconType(UsernameReq);
}
else if(Msg == NETMSG_TIME_SCORE)
{
int NewTimeScore = Unpacker.GetInt();
if (Unpacker.Error())
return;
GameClient()->OnTimeScore(NewTimeScore, g_Config.m_ClDummy);
}
}
else
{
@ -2183,13 +2172,6 @@ void CClient::ProcessServerPacketDummy(CNetChunk *pPacket)
}
}
}
else if(Msg == NETMSG_TIME_SCORE)
{
int NewTimeScore = Unpacker.GetInt();
if (Unpacker.Error())
return;
GameClient()->OnTimeScore(NewTimeScore, true);
}
}
else
{

View file

@ -25,4 +25,3 @@ UUID(NETMSG_IDONTKNOW, "i-dont-know@ddnet.tw")
UUID(NETMSG_RCONTYPE, "rcon-type@ddnet.tw")
UUID(NETMSG_MAP_DETAILS, "map-details@ddnet.tw")
UUID(NETMSG_TIME_SCORE, "time-score@ddnet.tw")

View file

@ -340,7 +340,7 @@ void CHud::RenderScoreHud()
{
CServerInfo Info;
Client()->GetServerInfo(&Info);
if(IsRace(&Info) && g_Config.m_ClDDRaceScoreBoard && m_pClient->m_AllowTimeScore[g_Config.m_ClDummy])
if(IsRace(&Info) && g_Config.m_ClDDRaceScoreBoard)
{
if(apPlayerInfo[t]->m_Score != -9999)
str_format(aScore[t], sizeof(aScore[t]), "%02d:%02d", abs(apPlayerInfo[t]->m_Score)/60, abs(apPlayerInfo[t]->m_Score)%60);

View file

@ -231,7 +231,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
}
}
if(m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard && m_pClient->m_AllowTimeScore[g_Config.m_ClDummy])
if(m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard)
{
if (m_ServerRecord > 0)
{
@ -294,7 +294,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
// render headlines
y += 50.0f;
float HeadlineFontsize = 22.0f;
const char* pScore = (m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard && m_pClient->m_AllowTimeScore[g_Config.m_ClDummy]) ? Localize("Time") : Localize("Score");
const char* pScore = (m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard) ? Localize("Time") : Localize("Score");
float ScoreWidth = TextRender()->TextWidth(0, HeadlineFontsize, pScore, -1);
tw = ScoreLength > ScoreWidth ? ScoreLength : ScoreWidth;
TextRender()->Text(0, ScoreOffset+ScoreLength-tw, y + (HeadlineFontsize * 2.f - HeadlineFontsize) / 2.f, HeadlineFontsize, pScore, -1);
@ -414,7 +414,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
}
// score
if(m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard && m_pClient->m_AllowTimeScore[g_Config.m_ClDummy])
if(m_IsGameTypeRace && g_Config.m_ClDDRaceScoreBoard)
{
if (pInfo->m_Score == -9999)
aBuf[0] = 0;

View file

@ -906,11 +906,6 @@ void CGameClient::OnRconLine(const char *pLine)
m_pGameConsole->PrintLine(CGameConsole::CONSOLETYPE_REMOTE, pLine);
}
void CGameClient::OnTimeScore(int AllowTimeScore, bool Dummy)
{
m_AllowTimeScore[Dummy] = AllowTimeScore;
}
void CGameClient::ProcessEvents()
{
if(m_SuppressEvents)

View file

@ -161,8 +161,6 @@ public:
};
int m_ServerMode;
int m_AllowTimeScore[2];
int m_DemoSpecID;
vec2 m_LocalCharacterPos;
@ -347,7 +345,6 @@ public:
virtual void OnEnterGame();
virtual void OnRconType(bool UsernameReq);
virtual void OnRconLine(const char *pLine);
virtual void OnTimeScore(int AllowTimeScore, bool Dummy);
virtual void OnGameOver();
virtual void OnStartGame();
virtual void OnFlagGrab(int TeamID);