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

Function DMFCInputCommand_Kick

netgames/dmfc/dmfcinputcommand.cpp:330–353  ·  view source on GitHub ↗

handles kicking a player from the game Usage: "$kick " where pnum is the playernumber of the player you want to kick

Source from the content-addressed store, hash-verified

328// handles kicking a player from the game
329// Usage: "$kick <int pnum>" where pnum is the playernumber of the player you want to kick
330void DMFCInputCommand_Kick(const char *input_string) {
331 if (basethis->GetLocalRole() != LR_SERVER)
332 return;
333 int p;
334 char temp[20];
335
336 // parse "$kick"
337 if (!StringParseWord(input_string, temp, 20, &input_string)) {
338 basethis->DisplayInputCommandHelp(DTXT_IC_KICK);
339 return;
340 }
341
342 // parse pnum
343 if (!StringParseNumber(input_string, &p, &input_string)) {
344 basethis->DisplayInputCommandHelp(DTXT_IC_KICK);
345 return;
346 }
347
348 if (!basethis->CheckPlayerNum(p))
349 return;
350 KickPlayer(p);
351 if (p != *basethis->Player_num)
352 DLLAddHUDMessage(DTXT_KICKMSG, basethis->Players[p].callsign);
353}
354
355// handles banning a player from the game
356// Usage: "$ban <int pnum>" where pnum is the playernumber of the player to ban

Callers

nothing calls this directly

Calls 6

StringParseWordFunction · 0.85
StringParseNumberFunction · 0.85
KickPlayerFunction · 0.85
GetLocalRoleMethod · 0.80
CheckPlayerNumMethod · 0.80

Tested by

no test coverage detected