Minor console output cleanup

This commit is contained in:
def 2014-09-06 23:22:35 +02:00
parent ff4779e214
commit 54497647b4
2 changed files with 16 additions and 16 deletions

View file

@ -1735,7 +1735,7 @@ void CServer::ConTestingCommands(CConsole::IResult *pResult, void *pUser)
{ {
char aBuf[128]; char aBuf[128];
str_format(aBuf, sizeof(aBuf), "Value: %d", g_Config.m_SvTestingCommands); str_format(aBuf, sizeof(aBuf), "Value: %d", g_Config.m_SvTestingCommands);
((CConsole*)pUser)->Print(CConsole::OUTPUT_LEVEL_STANDARD, "Console", aBuf); ((CConsole*)pUser)->Print(CConsole::OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
void CServer::ConKick(IConsole::IResult *pResult, void *pUser) void CServer::ConKick(IConsole::IResult *pResult, void *pUser)

View file

@ -339,7 +339,7 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID)
{ {
char aBuf[256]; char aBuf[256];
str_format(aBuf, sizeof(aBuf), "Invalid arguments... Usage: %s %s", pCommand->m_pName, pCommand->m_pParams); str_format(aBuf, sizeof(aBuf), "Invalid arguments... Usage: %s %s", pCommand->m_pName, pCommand->m_pParams);
Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
else if(m_StoreCommands && pCommand->m_Flags&CFGFLAG_STORE) else if(m_StoreCommands && pCommand->m_Flags&CFGFLAG_STORE)
{ {
@ -381,14 +381,14 @@ void CConsole::ExecuteLineStroked(int Stroke, const char *pStr, int ClientID)
{ {
char aBuf[256]; char aBuf[256];
str_format(aBuf, sizeof(aBuf), "Access for command %s denied.", Result.m_pCommand); str_format(aBuf, sizeof(aBuf), "Access for command %s denied.", Result.m_pCommand);
Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
} }
else if(Stroke) else if(Stroke)
{ {
char aBuf[256]; char aBuf[256];
str_format(aBuf, sizeof(aBuf), "No such command: %s.", Result.m_pCommand); str_format(aBuf, sizeof(aBuf), "No such command: %s.", Result.m_pCommand);
Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
pStr = pNextPart; pStr = pNextPart;
@ -484,7 +484,7 @@ void CConsole::ExecuteFile(const char *pFilename, int ClientID)
void CConsole::Con_Echo(IResult *pResult, void *pUserData) void CConsole::Con_Echo(IResult *pResult, void *pUserData)
{ {
((CConsole*)pUserData)->Print(IConsole::OUTPUT_LEVEL_STANDARD, "Console", pResult->GetString(0)); ((CConsole*)pUserData)->Print(IConsole::OUTPUT_LEVEL_STANDARD, "console", pResult->GetString(0));
} }
void CConsole::Con_Exec(IResult *pResult, void *pUserData) void CConsole::Con_Exec(IResult *pResult, void *pUserData)
@ -503,20 +503,20 @@ void CConsole::ConModCommandAccess(IResult *pResult, void *pUser)
{ {
pCommand->SetAccessLevel(pResult->GetInteger(1)); pCommand->SetAccessLevel(pResult->GetInteger(1));
str_format(aBuf, sizeof(aBuf), "moderator access for '%s' is now %s", pResult->GetString(0), pCommand->GetAccessLevel() ? "enabled" : "disabled"); str_format(aBuf, sizeof(aBuf), "moderator access for '%s' is now %s", pResult->GetString(0), pCommand->GetAccessLevel() ? "enabled" : "disabled");
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
str_format(aBuf, sizeof(aBuf), "user access for '%s' is now %s", pResult->GetString(0), pCommand->GetAccessLevel() >= ACCESS_LEVEL_USER ? "enabled" : "disabled"); str_format(aBuf, sizeof(aBuf), "user access for '%s' is now %s", pResult->GetString(0), pCommand->GetAccessLevel() >= ACCESS_LEVEL_USER ? "enabled" : "disabled");
} }
else else
{ {
str_format(aBuf, sizeof(aBuf), "moderator access for '%s' is %s", pResult->GetString(0), pCommand->GetAccessLevel() ? "enabled" : "disabled"); str_format(aBuf, sizeof(aBuf), "moderator access for '%s' is %s", pResult->GetString(0), pCommand->GetAccessLevel() ? "enabled" : "disabled");
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
str_format(aBuf, sizeof(aBuf), "user access for '%s' is %s", pResult->GetString(0), pCommand->GetAccessLevel() >= ACCESS_LEVEL_USER ? "enabled" : "disabled"); str_format(aBuf, sizeof(aBuf), "user access for '%s' is %s", pResult->GetString(0), pCommand->GetAccessLevel() >= ACCESS_LEVEL_USER ? "enabled" : "disabled");
} }
} }
else else
str_format(aBuf, sizeof(aBuf), "No such command: '%s'.", pResult->GetString(0)); str_format(aBuf, sizeof(aBuf), "No such command: '%s'.", pResult->GetString(0));
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
void CConsole::ConModCommandStatus(IResult *pResult, void *pUser) void CConsole::ConModCommandStatus(IResult *pResult, void *pUser)
@ -543,7 +543,7 @@ void CConsole::ConModCommandStatus(IResult *pResult, void *pUser)
} }
else else
{ {
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
mem_zero(aBuf, sizeof(aBuf)); mem_zero(aBuf, sizeof(aBuf));
str_copy(aBuf, pCommand->m_pName, sizeof(aBuf)); str_copy(aBuf, pCommand->m_pName, sizeof(aBuf));
Used = Length; Used = Length;
@ -551,7 +551,7 @@ void CConsole::ConModCommandStatus(IResult *pResult, void *pUser)
} }
} }
if(Used > 0) if(Used > 0)
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
struct CIntVariableData struct CIntVariableData
@ -592,7 +592,7 @@ static void IntVariableCommand(IConsole::IResult *pResult, void *pUserData)
{ {
char aBuf[1024]; char aBuf[1024];
str_format(aBuf, sizeof(aBuf), "Value: %d", *(pData->m_pVariable)); str_format(aBuf, sizeof(aBuf), "Value: %d", *(pData->m_pVariable));
pData->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "Console", aBuf); pData->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
} }
@ -627,7 +627,7 @@ static void StrVariableCommand(IConsole::IResult *pResult, void *pUserData)
{ {
char aBuf[1024]; char aBuf[1024];
str_format(aBuf, sizeof(aBuf), "Value: %s", pData->m_pStr); str_format(aBuf, sizeof(aBuf), "Value: %s", pData->m_pStr);
pData->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "Console", aBuf); pData->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
} }
@ -664,7 +664,7 @@ void CConsole::ConToggle(IConsole::IResult *pResult, void *pUser)
str_format(aBuf, sizeof(aBuf), "No such command: '%s'.", pResult->GetString(0)); str_format(aBuf, sizeof(aBuf), "No such command: '%s'.", pResult->GetString(0));
if(aBuf[0] != 0) if(aBuf[0] != 0)
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
void CConsole::ConToggleStroke(IConsole::IResult *pResult, void *pUser) void CConsole::ConToggleStroke(IConsole::IResult *pResult, void *pUser)
@ -697,7 +697,7 @@ void CConsole::ConToggleStroke(IConsole::IResult *pResult, void *pUser)
str_format(aBuf, sizeof(aBuf), "No such command: '%s'.", pResult->GetString(1)); str_format(aBuf, sizeof(aBuf), "No such command: '%s'.", pResult->GetString(1));
if(aBuf[0] != 0) if(aBuf[0] != 0)
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
CConsole::CConsole(int FlagMask) CConsole::CConsole(int FlagMask)
@ -997,7 +997,7 @@ void CConsole::ConUserCommandStatus(IResult *pResult, void *pUser)
} }
else else
{ {
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
mem_zero(aBuf, sizeof(aBuf)); mem_zero(aBuf, sizeof(aBuf));
str_copy(aBuf, pCommand->m_pName, sizeof(aBuf)); str_copy(aBuf, pCommand->m_pName, sizeof(aBuf));
Used = Length; Used = Length;
@ -1005,7 +1005,7 @@ void CConsole::ConUserCommandStatus(IResult *pResult, void *pUser)
} }
} }
if(Used > 0) if(Used > 0)
pConsole->Print(OUTPUT_LEVEL_STANDARD, "Console", aBuf); pConsole->Print(OUTPUT_LEVEL_STANDARD, "console", aBuf);
} }
int CConsole::CResult::GetVictim() int CConsole::CResult::GetVictim()