mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
Print MOTD to console
This commit is contained in:
parent
5313f30e24
commit
d9f712bfcb
|
@ -61,6 +61,7 @@ void CMotd::OnMessage(int MsgType, void *pRawMsg)
|
|||
{
|
||||
CNetMsg_Sv_Motd *pMsg = (CNetMsg_Sv_Motd *)pRawMsg;
|
||||
|
||||
char* pLast = m_aServerMotd;
|
||||
// process escaping
|
||||
str_copy(m_aServerMotd, pMsg->m_pMessage, sizeof(m_aServerMotd));
|
||||
for(int i = 0; m_aServerMotd[i]; i++)
|
||||
|
@ -69,12 +70,16 @@ void CMotd::OnMessage(int MsgType, void *pRawMsg)
|
|||
{
|
||||
if(m_aServerMotd[i+1] == 'n')
|
||||
{
|
||||
m_aServerMotd[i] = '\0';
|
||||
m_pClient->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "motd", pLast, true);
|
||||
m_aServerMotd[i] = ' ';
|
||||
m_aServerMotd[i+1] = '\n';
|
||||
i++;
|
||||
pLast = m_aServerMotd+i+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_pClient->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "motd", pLast, true);
|
||||
|
||||
if(m_aServerMotd[0] && g_Config.m_ClMotdTime)
|
||||
m_ServerMotdTime = time_get()+time_freq()*g_Config.m_ClMotdTime;
|
||||
|
|
Loading…
Reference in a new issue