mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix chat commands being too verbose if console_output_level is set on config file. Close #116
This commit is contained in:
parent
fcf6a1dad5
commit
24fc16543c
|
@ -756,6 +756,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
||||||
Console()->SetAccessLevel(pPlayer->m_Authed == CServer::AUTHED_ADMIN ? IConsole::ACCESS_LEVEL_ADMIN : IConsole::ACCESS_LEVEL_MOD);
|
Console()->SetAccessLevel(pPlayer->m_Authed == CServer::AUTHED_ADMIN ? IConsole::ACCESS_LEVEL_ADMIN : IConsole::ACCESS_LEVEL_MOD);
|
||||||
else
|
else
|
||||||
Console()->SetAccessLevel(IConsole::ACCESS_LEVEL_USER);
|
Console()->SetAccessLevel(IConsole::ACCESS_LEVEL_USER);
|
||||||
|
Console()->SetPrintOutputLevel(m_ChatPrintCBIndex, 0);
|
||||||
|
|
||||||
Console()->ExecuteLine(pMsg->m_pMessage + 1, ClientID);
|
Console()->ExecuteLine(pMsg->m_pMessage + 1, ClientID);
|
||||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "chat-command", pMsg->m_pMessage);
|
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "chat-command", pMsg->m_pMessage);
|
||||||
|
@ -1638,7 +1639,7 @@ void CGameContext::OnConsoleInit()
|
||||||
m_pServer = Kernel()->RequestInterface<IServer>();
|
m_pServer = Kernel()->RequestInterface<IServer>();
|
||||||
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
m_pConsole = Kernel()->RequestInterface<IConsole>();
|
||||||
|
|
||||||
Console()->RegisterPrintCallback(0, SendChatResponse, this);
|
m_ChatPrintCBIndex = Console()->RegisterPrintCallback(0, SendChatResponse, this);
|
||||||
|
|
||||||
Console()->Register("tune", "si", CFGFLAG_SERVER, ConTuneParam, this, "Tune variable to value");
|
Console()->Register("tune", "si", CFGFLAG_SERVER, ConTuneParam, this, "Tune variable to value");
|
||||||
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConTuneReset, this, "Reset tuning");
|
Console()->Register("tune_reset", "", CFGFLAG_SERVER, ConTuneReset, this, "Reset tuning");
|
||||||
|
|
|
@ -270,6 +270,7 @@ public:
|
||||||
void ResetTuning();
|
void ResetTuning();
|
||||||
|
|
||||||
int m_ChatResponseTargetID;
|
int m_ChatResponseTargetID;
|
||||||
|
int m_ChatPrintCBIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int CmaskAll() { return -1; }
|
inline int CmaskAll() { return -1; }
|
||||||
|
|
Loading…
Reference in a new issue