From 324424f7dacb3c068895adc26ad1c53e8d698a62 Mon Sep 17 00:00:00 2001 From: GreYFoXGTi Date: Fri, 1 Oct 2010 00:30:54 +0200 Subject: [PATCH] Added Server Best and Personal best to broadcast when not in race Signed-off-by: GreYFoXGTi --- src/game/server/entities/character.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 02baca00f..3529a8b21 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -770,13 +770,20 @@ void CCharacter::Tick() } else { - if( g_Config.m_SvBroadcast[0] != 0) { + + if( g_Config.m_SvBroadcast[0] != 0 && m_pPlayer->m_IsUsingRaceClient) { char aTmp[128]; str_format(aTmp, sizeof(aTmp), "%s\n", g_Config.m_SvBroadcast); strcat(aBuftime, aTmp); GameServer()->SendBroadcast(g_Config.m_SvBroadcast, m_pPlayer->GetCID()); } - + else if( g_Config.m_SvBroadcast[0] != 0) { + char aTmp[128],aYourBest[64]; + str_format(aYourBest, sizeof(aYourBest), "Your Best:'%s%d:%d'", ((pData->m_BestTime / 60) < 10)?"0":"", (int)(pData->m_BestTime / 60), (int)pData->m_BestTime % 60); + CPlayerData *pData = GameServer()->Score()->PlayerData(m_pPlayer->GetCID()); + str_format(aTmp, sizeof(aTmp), "%s\nServer Best:'%s%d:%d' %s", g_Config.m_SvBroadcast, ((GameServer()->m_pController->m_CurrentRecord / 60) < 10)?"0":"", (int)(GameServer()->m_pController->m_CurrentRecord / 60), (int)GameServer()->m_pController->m_CurrentRecord % 60, (pData->m_BestTime)?aYourBest:""); + GameServer()->SendBroadcast(aTmp, m_pPlayer->GetCID()); + } } m_RefreshTime = Server()->Tick(); }