2001-02-22 08:12:13 +00:00
|
|
|
/*
|
|
|
|
cl_cmd.c
|
|
|
|
|
|
|
|
script command processing module
|
|
|
|
|
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
# include <string.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_STRINGS_H
|
|
|
|
# include <strings.h>
|
|
|
|
#endif
|
|
|
|
|
2001-03-27 20:33:07 +00:00
|
|
|
#include "QF/cmd.h"
|
|
|
|
#include "QF/msg.h"
|
|
|
|
#include "QF/sizebuf.h"
|
2007-11-06 10:17:14 +00:00
|
|
|
#include "QF/sys.h"
|
2001-02-22 08:12:13 +00:00
|
|
|
|
2001-08-29 02:12:57 +00:00
|
|
|
#include "client.h"
|
|
|
|
|
|
|
|
|
2001-02-22 08:12:13 +00:00
|
|
|
/*
|
2002-07-31 05:19:03 +00:00
|
|
|
CL_Cmd_ForwardToServer
|
2001-02-22 08:12:13 +00:00
|
|
|
|
|
|
|
Sends the entire command line over to the server
|
|
|
|
*/
|
2001-02-26 06:48:02 +00:00
|
|
|
void
|
2002-07-31 05:19:03 +00:00
|
|
|
CL_Cmd_ForwardToServer (void)
|
2001-02-22 08:12:13 +00:00
|
|
|
{
|
2001-02-26 06:48:02 +00:00
|
|
|
if (cls.state != ca_connected) {
|
2007-11-06 10:17:14 +00:00
|
|
|
Sys_Printf ("Can't \"%s\", not connected\n", Cmd_Argv (0));
|
2001-02-22 08:12:13 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cls.demoplayback)
|
2001-02-26 06:48:02 +00:00
|
|
|
return; // not really connected
|
2001-02-22 08:12:13 +00:00
|
|
|
|
|
|
|
MSG_WriteByte (&cls.message, clc_stringcmd);
|
2001-02-26 06:48:02 +00:00
|
|
|
if (strcasecmp (Cmd_Argv (0), "cmd") != 0) {
|
|
|
|
SZ_Print (&cls.message, Cmd_Argv (0));
|
2001-02-22 08:12:13 +00:00
|
|
|
SZ_Print (&cls.message, " ");
|
|
|
|
}
|
2001-02-26 06:48:02 +00:00
|
|
|
if (Cmd_Argc () > 1)
|
2001-07-10 18:25:54 +00:00
|
|
|
SZ_Print (&cls.message, Cmd_Args (1));
|
2001-02-22 08:12:13 +00:00
|
|
|
else
|
|
|
|
SZ_Print (&cls.message, "\n");
|
|
|
|
}
|