From 6333583141bd14c63bf43f89c444c61efb672b33 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 12 Oct 2014 11:33:36 +0200 Subject: [PATCH] Display message about DDNet client to players not using it --- src/game/server/player.cpp | 10 +++++++++- src/game/server/player.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 5d32d89f1..9fc78f084 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -70,9 +70,10 @@ void CPlayer::Reset() m_TuneZone = 0; m_TuneZoneOld = m_TuneZone; m_Halloween = false; + m_FirstPacket = true; if (g_Config.m_SvEvents) - { + { time_t rawtime; struct tm* timeinfo; char d[16], m[16], y[16]; @@ -355,6 +356,13 @@ void CPlayer::OnPredictedInput(CNetObj_PlayerInput *NewInput) AfkVoteTimer(NewInput); + if(m_FirstPacket) + { + if(m_ClientVersion <= VERSION_DDNET_OLD) + GameServer()->SendBroadcast("Get the client from ddnet.tw to use all features on DDNet.", m_ClientID); + m_FirstPacket = false; + } + if(m_pCharacter && !m_Paused) m_pCharacter->OnPredictedInput(NewInput); } diff --git a/src/game/server/player.h b/src/game/server/player.h index d17df0162..82b077199 100644 --- a/src/game/server/player.h +++ b/src/game/server/player.h @@ -167,6 +167,7 @@ public: int m_DefEmote; int m_DefEmoteReset; bool m_Halloween; + bool m_FirstPacket; #if defined(CONF_SQL) int64 m_LastSQLQuery; #endif