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)
|
CL_Rcon_f (void)
|
||||||
{
|
{
|
||||||
char message[1024];
|
char message[1024];
|
||||||
int len, i;
|
|
||||||
netadr_t to;
|
netadr_t to;
|
||||||
|
|
||||||
snprintf (message, sizeof (message), "\377\377\377\377rcon %s ",
|
snprintf (message, sizeof (message), "\377\377\377\377rcon %s %s",
|
||||||
rcon_password->string);
|
rcon_password->string, Cmd_Args (1));
|
||||||
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 (" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cls.state >= ca_connected)
|
if (cls.state >= ca_connected)
|
||||||
to = cls.netchan.remote_address;
|
to = cls.netchan.remote_address;
|
||||||
|
|
|
@ -927,9 +927,7 @@ Name_of_sender (void)
|
||||||
void
|
void
|
||||||
SVC_RemoteCommand (void)
|
SVC_RemoteCommand (void)
|
||||||
{
|
{
|
||||||
int i;
|
const char *command;
|
||||||
int len = 0;
|
|
||||||
char remaining[1024];
|
|
||||||
char *name;
|
char *name;
|
||||||
qboolean admin_cmd = false;
|
qboolean admin_cmd = false;
|
||||||
qboolean do_cmd = false;
|
qboolean do_cmd = false;
|
||||||
|
@ -966,21 +964,15 @@ SVC_RemoteCommand (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_cmd) {
|
if (do_cmd) {
|
||||||
remaining[0] = 0;
|
command = Cmd_Args (2);
|
||||||
|
|
||||||
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 " "
|
|
||||||
}
|
|
||||||
|
|
||||||
SV_Printf ("Rcon from %s:\n\trcon (hidden) %s\n",
|
SV_Printf ("Rcon from %s:\n\trcon (hidden) %s\n",
|
||||||
NET_AdrToString (net_from), remaining);
|
NET_AdrToString (net_from), command);
|
||||||
|
|
||||||
SV_BeginRedirect (RD_PACKET);
|
SV_BeginRedirect (RD_PACKET);
|
||||||
if (name)
|
if (name)
|
||||||
rcon_from_user = true;
|
rcon_from_user = true;
|
||||||
Cmd_ExecuteString (remaining, src_command);
|
Cmd_ExecuteString (command, src_command);
|
||||||
rcon_from_user = false;
|
rcon_from_user = false;
|
||||||
} else {
|
} else {
|
||||||
SV_Printf ("Bad rcon from %s:\n%s\n", NET_AdrToString (net_from),
|
SV_Printf ("Bad rcon from %s:\n%s\n", NET_AdrToString (net_from),
|
||||||
|
|
Loading…
Reference in a new issue