A client issued an rcon command. Shift down the remaining args Redirect all printfs from the server to the client.
(List<String> args, final netadr_t from)
| 366 | * all printfs from the server to the client. |
| 367 | */ |
| 368 | private static void SVC_RemoteCommand(List<String> args, final netadr_t from) { |
| 369 | |
| 370 | boolean rconIsValid = Rcon_Validate(args); |
| 371 | |
| 372 | if (rconIsValid) { |
| 373 | Com.Printf("Rcon from " + from + ":\n" + args + "\n"); |
| 374 | } else { |
| 375 | Com.Printf("Bad rcon from " + from + ":\n" + args + "\n"); |
| 376 | } |
| 377 | |
| 378 | |
| 379 | Com.BeginRedirect((buffer) -> Netchan.sendConnectionlessPacket(NS_SERVER, from, ConnectionlessCommand.print, "\n" + buffer.toString())); |
| 380 | if (rconIsValid) { |
| 381 | Cmd.ExecuteString(Cmd.getArguments(args, 2)); |
| 382 | } else { |
| 383 | // redirected to client |
| 384 | Com.Printf("Bad rcon_password.\n"); |
| 385 | } |
| 386 | |
| 387 | Com.EndRedirect(); |
| 388 | } |
| 389 | |
| 390 | /** |
| 391 | * A connectionless packet has four leading 0xff characters to distinguish |
no test coverage detected