mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
'rcon localinfo motd "hi there"' now works
This commit is contained in:
parent
9448063c67
commit
0425afb190
2 changed files with 6 additions and 23 deletions
|
@ -378,19 +378,10 @@ void
|
|||
CL_Rcon_f (void)
|
||||
{
|
||||
char message[1024];
|
||||
int len, i;
|
||||
netadr_t to;
|
||||
|
||||
snprintf (message, sizeof (message), "\377\377\377\377rcon %s ",
|
||||
rcon_password->string);
|
||||
len = strlen (message);
|
||||
|
||||
for (i = 1; i < Cmd_Argc (); i++) {
|
||||
strncat (message, Cmd_Argv (i), sizeof (message) - len - 1);
|
||||
len += strlen (Cmd_Argv (i));
|
||||
strncat (message, " ", sizeof (message) - len - 1);
|
||||
len += strlen (" ");
|
||||
}
|
||||
snprintf (message, sizeof (message), "\377\377\377\377rcon %s %s",
|
||||
rcon_password->string, Cmd_Args (1));
|
||||
|
||||
if (cls.state >= ca_connected)
|
||||
to = cls.netchan.remote_address;
|
||||
|
|
|
@ -927,9 +927,7 @@ Name_of_sender (void)
|
|||
void
|
||||
SVC_RemoteCommand (void)
|
||||
{
|
||||
int i;
|
||||
int len = 0;
|
||||
char remaining[1024];
|
||||
const char *command;
|
||||
char *name;
|
||||
qboolean admin_cmd = false;
|
||||
qboolean do_cmd = false;
|
||||
|
@ -966,21 +964,15 @@ SVC_RemoteCommand (void)
|
|||
}
|
||||
|
||||
if (do_cmd) {
|
||||
remaining[0] = 0;
|
||||
|
||||
for (i = 2; i < Cmd_Argc (); i++) {
|
||||
strncat (remaining, Cmd_Argv (i), sizeof (remaining) - len - 1);
|
||||
strncat (remaining, " ", sizeof (remaining) - len - 2);
|
||||
len += strlen (Cmd_Argv (i)) + 1; // +1 for " "
|
||||
}
|
||||
command = Cmd_Args (2);
|
||||
|
||||
SV_Printf ("Rcon from %s:\n\trcon (hidden) %s\n",
|
||||
NET_AdrToString (net_from), remaining);
|
||||
NET_AdrToString (net_from), command);
|
||||
|
||||
SV_BeginRedirect (RD_PACKET);
|
||||
if (name)
|
||||
rcon_from_user = true;
|
||||
Cmd_ExecuteString (remaining, src_command);
|
||||
Cmd_ExecuteString (command, src_command);
|
||||
rcon_from_user = false;
|
||||
} else {
|
||||
SV_Printf ("Bad rcon from %s:\n%s\n", NET_AdrToString (net_from),
|
||||
|
|
Loading…
Reference in a new issue