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

Function DMFCInputCommand_RemoveBan

netgames/dmfc/dmfcinputcommand.cpp:761–787  ·  view source on GitHub ↗

handles removing a ban from a player, given the ban index num (see $banlist) Usage: "$removeban " where bannum is the number corresponding to that given during a $banlist

Source from the content-addressed store, hash-verified

759// handles removing a ban from a player, given the ban index num (see $banlist)
760// Usage: "$removeban <int bannum>" where bannum is the number corresponding to that given during a $banlist
761void DMFCInputCommand_RemoveBan(const char *input_string) {
762 if (basethis->GetLocalRole() != LR_SERVER)
763 return;
764
765 int d;
766 char temp[20];
767
768 //"$removeban"
769 if (!StringParseWord(input_string, temp, 20, &input_string)) {
770 basethis->DisplayInputCommandHelp(DTXT_IC_REMOVEBAN);
771 return;
772 }
773
774 // value
775 if (!StringParseNumber(input_string, &d, &input_string)) {
776 basethis->DisplayInputCommandHelp(DTXT_IC_REMOVEBAN);
777 return;
778 }
779
780 if (basethis->RemoveBan(d)) {
781 DLLAddHUDMessage(DTXT_BANREMOVEDMSG);
782 DPrintf(DTXT_BANREMOVEDMSG);
783 } else {
784 DLLAddHUDMessage(DTXT_BANNOTREMOVEDMSG);
785 DPrintf(DTXT_BANNOTREMOVEDMSG);
786 }
787}
788
789// handles changing the filter for death messages
790// Usage: "$killmsgfilter <full/simple/none>"

Callers

nothing calls this directly

Calls 5

StringParseWordFunction · 0.85
StringParseNumberFunction · 0.85
GetLocalRoleMethod · 0.80
RemoveBanMethod · 0.80

Tested by

no test coverage detected