From e1448bebc78dd709579bdb625dbd935f8a1ea5c1 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Thu, 11 Feb 2021 23:33:50 +0100 Subject: [PATCH 1/2] Fix top time not being displayed on old servers Fix #3599. (Forgot to check for both NETMSG_RECORD and NETMSG_RECORDLEGACY in one place.) --- src/game/client/components/scoreboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index bc607f6ad..19840313a 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -46,7 +46,7 @@ void CScoreboard::OnRelease() void CScoreboard::OnMessage(int MsgType, void *pRawMsg) { - if(MsgType == NETMSGTYPE_SV_RECORD) + if(MsgType == NETMSGTYPE_SV_RECORD || MsgType == NETMSGTYPE_SV_RECORDLEGACY) { CNetMsg_Sv_Record *pMsg = (CNetMsg_Sv_Record *)pRawMsg; m_ServerRecord = (float)pMsg->m_ServerTimeBest / 100; From f199b5101f0775b2e4aba08fd9d1d61c180c606d Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Fri, 12 Feb 2021 00:31:51 +0100 Subject: [PATCH 2/2] Change record message to record@netmsg.ddnet.tw Now that I understand that the message is still in use, rename it from `weird-record@netmsg.ddnet.tw`. --- datasrc/network.py | 2 +- src/game/client/components/hud.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/datasrc/network.py b/datasrc/network.py index b201781a4..b049c603a 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -469,7 +469,7 @@ Messages = [ NetIntRange("m_Finish", 0, 1), ]), - NetMessageEx("Sv_Record", "weird-record@netmsg.ddnet.tw", [ + NetMessageEx("Sv_Record", "record@netmsg.ddnet.tw", [ NetIntAny("m_ServerTimeBest"), NetIntAny("m_PlayerTimeBest"), ]), diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index dec77c5b0..b092534e5 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -882,7 +882,7 @@ void CHud::OnMessage(int MsgType, void *pRawMsg) CNetMsg_Sv_Record *pMsg = (CNetMsg_Sv_Record *)pRawMsg; // NETMSGTYPE_SV_RACETIME on old race servers - if(GameClient()->m_GameInfo.m_DDRaceRecordMessage) + if(MsgType == NETMSGTYPE_SV_RECORDLEGACY && GameClient()->m_GameInfo.m_DDRaceRecordMessage) { m_DDRaceTimeReceived = true; @@ -896,7 +896,7 @@ void CHud::OnMessage(int MsgType, void *pRawMsg) m_CheckpointTick = Client()->GameTick(g_Config.m_ClDummy); } } - else if(GameClient()->m_GameInfo.m_RaceRecordMessage) + else if(MsgType == NETMSGTYPE_SV_RECORD || GameClient()->m_GameInfo.m_RaceRecordMessage) { m_ServerRecord = (float)pMsg->m_ServerTimeBest / 100; m_PlayerRecord[g_Config.m_ClDummy] = (float)pMsg->m_PlayerTimeBest / 100;