MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DisplayInputCommandHelp

Method DisplayInputCommandHelp

netgames/dmfc/dmfcbase.cpp:3650–3700  ·  view source on GitHub ↗

Displays dedicated server help

Source from the content-addressed store, hash-verified

3648
3649// Displays dedicated server help
3650void DMFCBase::DisplayInputCommandHelp(const char *s) {
3651 if (!IAmDedicatedServer())
3652 return;
3653
3654 tInputCommandNode *node = m_InputCommandRootNode;
3655
3656 if (s[0] == '\0') {
3657 char buffer[80];
3658 DPrintf(DTXT_IC_HEADEERLIST);
3659 DPrintf(DTXT_IC_HEADERINSTRUCT);
3660 // just display the list of commands
3661 while (node) {
3662 memset(buffer, ' ', 80);
3663 memcpy(&buffer[0], node->data, strlen(node->data));
3664 node = node->next;
3665 if (node) {
3666 memcpy(&buffer[30], node->data, strlen(node->data));
3667 int pos = 30 + strlen(node->data);
3668 if (pos <= 78) {
3669 buffer[pos] = '\n';
3670 buffer[pos + 1] = '\0';
3671 }
3672 }
3673 buffer[78] = '\n';
3674 buffer[79] = '\0';
3675
3676 DPrintf(buffer);
3677
3678 if (node)
3679 node = node->next;
3680 }
3681
3682 return;
3683 }
3684
3685 // display help description
3686 while (node) {
3687 if (!stricmp(node->data, s)) {
3688 // we found a match!
3689 DPrintf("%s:\n", node->data);
3690 if (node->desc)
3691 DPrintf("%s\n", node->desc);
3692 else
3693 DPrintf(DTXT_IC_NOADDITIONALINFO);
3694 return;
3695 }
3696 node = node->next;
3697 }
3698
3699 DPrintf(DTXT_IC_COMMANDNOTFOUND);
3700}
3701
3702// copies a string from src to dest, making dest all lower case
3703void strlowcpy(char *dest, const char *src) {

Calls

no outgoing calls

Tested by

no test coverage detected