MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Receive_ADMIN_RCON

Method Receive_ADMIN_RCON

src/network/network_admin.cpp:487–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

485}
486
487NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_RCON(Packet &p)
488{
489 if (this->status <= ADMIN_STATUS_AUTHENTICATE) return this->SendError(NETWORK_ERROR_NOT_EXPECTED);
490
491 std::string command = p.Recv_string(NETWORK_RCONCOMMAND_LENGTH);
492
493 Debug(net, 3, "[admin] Rcon command from '{}' ({}): {}", this->admin_name, this->admin_version, command);
494
495 _redirect_console_to_admin = this->index;
496 IConsoleCmdExec(command);
497 _redirect_console_to_admin = AdminID::Invalid();
498 return this->SendRconEnd(command);
499}
500
501NetworkRecvStatus ServerNetworkAdminSocketHandler::Receive_ADMIN_GAMESCRIPT(Packet &p)
502{

Callers

nothing calls this directly

Calls 5

SendErrorMethod · 0.95
SendRconEndMethod · 0.95
IConsoleCmdExecFunction · 0.85
InvalidFunction · 0.85
Recv_stringMethod · 0.80

Tested by

no test coverage detected