MCPcopy Create free account
hub / github.com/ddnet/ddnet / PrintCommandList

Method PrintCommandList

src/engine/shared/console.cpp:775–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773}
774
775void CConsole::PrintCommandList(EAccessLevel MinAccessLevel, int ExcludeFlagMask)
776{
777 char aBuf[240] = "";
778 int Used = 0;
779
780 for(CCommand *pCommand = m_pFirstCommand; pCommand; pCommand = pCommand->Next())
781 {
782 if((pCommand->m_Flags & m_FlagMask) &&
783 !(pCommand->m_Flags & ExcludeFlagMask) &&
784 pCommand->GetAccessLevel() >= MinAccessLevel)
785 {
786 int Length = str_length(pCommand->m_pName);
787 if(Used + Length + 2 < (int)(sizeof(aBuf)))
788 {
789 if(Used > 0)
790 {
791 Used += 2;
792 str_append(aBuf, ", ");
793 }
794 str_append(aBuf, pCommand->m_pName);
795 Used += Length;
796 }
797 else
798 {
799 Print(OUTPUT_LEVEL_STANDARD, "chatresp", aBuf);
800 str_copy(aBuf, pCommand->m_pName);
801 Used = Length;
802 }
803 }
804 }
805 if(Used > 0)
806 Print(OUTPUT_LEVEL_STANDARD, "chatresp", aBuf);
807}
808
809void CConsole::ConCommandStatus(IResult *pResult, void *pUser)
810{

Callers 2

ConCommandStatusMethod · 0.80
ConUserCommandStatusMethod · 0.80

Calls 5

str_lengthFunction · 0.85
GetAccessLevelMethod · 0.80
str_appendFunction · 0.50
str_copyFunction · 0.50
NextMethod · 0.45

Tested by

no test coverage detected