handles kicking a player from the game Usage: "$kick " where pnum is the playernumber of the player you want to kick
| 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 |
| 330 | void 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 |
nothing calls this directly
no test coverage detected