MCPcopy Create free account
hub / github.com/demoth/jake2 / SVC_RemoteCommand

Method SVC_RemoteCommand

server/src/main/java/jake2/server/SV_MAIN.java:368–388  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 8

Rcon_ValidateMethod · 0.95
PrintfMethod · 0.95
BeginRedirectMethod · 0.95
ExecuteStringMethod · 0.95
getArgumentsMethod · 0.95
EndRedirectMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected