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

Function DMFCInputCommand_SetPPS

netgames/dmfc/dmfcinputcommand.cpp:712–739  ·  view source on GitHub ↗

handle the server changing the pps threshold of the game Usage: "$setpps " where pps is the Packets Per Second

Source from the content-addressed store, hash-verified

710// handle the server changing the pps threshold of the game
711// Usage: "$setpps <int pps>" where pps is the Packets Per Second
712void DMFCInputCommand_SetPPS(const char *input_string) {
713 if (basethis->GetLocalRole() != LR_SERVER)
714 return;
715 int d;
716 char temp[20];
717
718 //"$setpps"
719 if (!StringParseWord(input_string, temp, 20, &input_string)) {
720 basethis->DisplayInputCommandHelp(DTXT_IC_SETPPS);
721 return;
722 }
723
724 // parse value
725 if (!StringParseNumber(input_string, &d, &input_string)) {
726 basethis->DisplayInputCommandHelp(DTXT_IC_SETPPS);
727 return;
728 }
729
730 if (d < 1)
731 d = 1;
732 if (d > 20)
733 d = 20;
734 basethis->Netgame->packets_per_second = d;
735
736 DLLAddHUDMessage(DTXT_PPSSETMSG, d);
737
738 basethis->SendNetGameInfoSync();
739}
740
741// handles listing the ban list on a dedicated server (so if you want to remove a player from it)
742// Usage: "$banlist"

Callers

nothing calls this directly

Calls 5

StringParseWordFunction · 0.85
StringParseNumberFunction · 0.85
GetLocalRoleMethod · 0.80
SendNetGameInfoSyncMethod · 0.80

Tested by

no test coverage detected