2000-05-10 20:33:16 +00:00
|
|
|
/*
|
2000-05-11 16:03:29 +00:00
|
|
|
sv_ccmds.c
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
(description)
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
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.
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
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.
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-11 16:03:29 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
$Id$
|
2000-05-10 20:33:16 +00:00
|
|
|
*/
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-05-17 10:03:19 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2000-12-08 06:51:37 +00:00
|
|
|
# include "config.h"
|
2000-05-17 10:03:19 +00:00
|
|
|
#endif
|
2000-05-21 08:24:45 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
2000-12-30 02:16:36 +00:00
|
|
|
#ifdef HAVE_STRING_H
|
2000-05-21 08:24:45 +00:00
|
|
|
#include <string.h>
|
2000-12-30 02:16:36 +00:00
|
|
|
#endif
|
2000-05-26 03:55:27 +00:00
|
|
|
#ifdef HAVE_STRINGS_H
|
|
|
|
#include <strings.h>
|
|
|
|
#endif
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-30 02:16:36 +00:00
|
|
|
#include "bothdefs.h"
|
|
|
|
#include "cmd.h"
|
|
|
|
#include "msg.h"
|
|
|
|
#include "qargs.h"
|
|
|
|
#include "qendian.h"
|
|
|
|
#include "quakefs.h"
|
|
|
|
#include "server.h"
|
|
|
|
#include "sys.h"
|
|
|
|
#include "va.h"
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
qboolean sv_allow_cheats;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
int fp_messages = 4, fp_persecond = 4, fp_secondsdead = 10;
|
|
|
|
char fp_msg[255] = { 0 };
|
2000-05-16 04:47:41 +00:00
|
|
|
extern cvar_t *cl_warncmd;
|
2000-06-10 00:23:56 +00:00
|
|
|
extern redirect_t sv_redirected;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-10 11:29:38 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
OPERATOR CONSOLE ONLY COMMANDS
|
|
|
|
|
|
|
|
These commands can only be entered from stdin or by a remote operator datagram
|
|
|
|
===============================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
====================
|
|
|
|
SV_SetMaster_f
|
|
|
|
|
|
|
|
Make a master server current
|
|
|
|
====================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_SetMaster_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
char data[2];
|
|
|
|
int i;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
memset (&master_adr, 0, sizeof (master_adr));
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 1; i < Cmd_Argc (); i++) {
|
|
|
|
if (!strcmp (Cmd_Argv (i), "none")
|
|
|
|
|| !NET_StringToAdr (Cmd_Argv (i), &master_adr[i - 1])) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Setting nomaster mode.\n");
|
|
|
|
return;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
if (master_adr[i - 1].port == 0)
|
|
|
|
master_adr[i - 1].port = BigShort (27000);
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("Master server at %s\n",
|
|
|
|
NET_AdrToString (master_adr[i - 1]));
|
2000-05-10 11:29:38 +00:00
|
|
|
|
|
|
|
Con_Printf ("Sending a ping.\n");
|
|
|
|
|
|
|
|
data[0] = A2A_PING;
|
|
|
|
data[1] = 0;
|
2000-12-08 06:51:37 +00:00
|
|
|
NET_SendPacket (2, data, master_adr[i - 1]);
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
svs.last_heartbeat = -99999;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_Quit_f
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Quit_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
|
|
|
SV_FinalMessage ("server shutdown\n");
|
|
|
|
Con_Printf ("Shutting down.\n");
|
|
|
|
SV_Shutdown ();
|
|
|
|
Sys_Quit ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
SV_Logfile_f
|
|
|
|
============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Logfile_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
char name[MAX_OSPATH];
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (sv_logfile) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("File logging off.\n");
|
2000-09-27 19:44:26 +00:00
|
|
|
Qclose (sv_logfile);
|
2000-05-10 11:29:38 +00:00
|
|
|
sv_logfile = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
snprintf (name, sizeof (name), "%s/qconsole.log", com_gamedir);
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Logging text to %s.\n", name);
|
2000-09-27 19:44:26 +00:00
|
|
|
sv_logfile = Qopen (name, "w");
|
2000-05-10 11:29:38 +00:00
|
|
|
if (!sv_logfile)
|
|
|
|
Con_Printf ("failed.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
============
|
|
|
|
SV_Fraglogfile_f
|
|
|
|
============
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Fraglogfile_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
char name[MAX_OSPATH];
|
|
|
|
int i;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (sv_fraglogfile) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Frag file logging off.\n");
|
2000-09-27 19:44:26 +00:00
|
|
|
Qclose (sv_fraglogfile);
|
2000-05-10 11:29:38 +00:00
|
|
|
sv_fraglogfile = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// find an unused name
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0; i < 1000; i++) {
|
|
|
|
snprintf (name, sizeof (name), "%s/frag_%i.log", com_gamedir, i);
|
2000-09-27 19:44:26 +00:00
|
|
|
sv_fraglogfile = Qopen (name, "r");
|
2000-12-08 06:51:37 +00:00
|
|
|
if (!sv_fraglogfile) { // can't read it, so create this one
|
2000-09-27 19:44:26 +00:00
|
|
|
sv_fraglogfile = Qopen (name, "w");
|
2000-05-10 11:29:38 +00:00
|
|
|
if (!sv_fraglogfile)
|
2000-12-08 06:51:37 +00:00
|
|
|
i = 1000; // give error
|
2000-05-10 11:29:38 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-09-27 19:44:26 +00:00
|
|
|
Qclose (sv_fraglogfile);
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
if (i == 1000) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Can't open any logfiles.\n");
|
|
|
|
sv_fraglogfile = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Con_Printf ("Logging frags to %s.\n", name);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_SetPlayer
|
|
|
|
|
|
|
|
Sets host_client and sv_player to the player with idnum Cmd_Argv(1)
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
qboolean
|
|
|
|
SV_SetPlayer (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
client_t *cl;
|
|
|
|
int i;
|
|
|
|
int idnum;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
idnum = atoi (Cmd_Argv (1));
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
2000-05-10 11:29:38 +00:00
|
|
|
if (!cl->state)
|
|
|
|
continue;
|
2000-12-08 06:51:37 +00:00
|
|
|
if (cl->userid == idnum) {
|
2000-05-10 11:29:38 +00:00
|
|
|
host_client = cl;
|
|
|
|
sv_player = host_client->edict;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Con_Printf ("Userid %i is not on the server\n", idnum);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_God_f
|
|
|
|
|
|
|
|
Sets client to godmode
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_God_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
if (!sv_allow_cheats) {
|
|
|
|
Con_Printf
|
|
|
|
("You must run the server with -cheats to enable this command.\n");
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!SV_SetPlayer ())
|
|
|
|
return;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
sv_player->v.flags = (int) sv_player->v.flags ^ FL_GODMODE;
|
|
|
|
if (!((int) sv_player->v.flags & FL_GODMODE))
|
2000-05-10 11:29:38 +00:00
|
|
|
SV_ClientPrintf (host_client, PRINT_HIGH, "godmode OFF\n");
|
|
|
|
else
|
|
|
|
SV_ClientPrintf (host_client, PRINT_HIGH, "godmode ON\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Noclip_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
if (!sv_allow_cheats) {
|
|
|
|
Con_Printf
|
|
|
|
("You must run the server with -cheats to enable this command.\n");
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!SV_SetPlayer ())
|
|
|
|
return;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (sv_player->v.movetype != MOVETYPE_NOCLIP) {
|
2000-05-10 11:29:38 +00:00
|
|
|
sv_player->v.movetype = MOVETYPE_NOCLIP;
|
|
|
|
SV_ClientPrintf (host_client, PRINT_HIGH, "noclip ON\n");
|
2000-12-08 06:51:37 +00:00
|
|
|
} else {
|
2000-05-10 11:29:38 +00:00
|
|
|
sv_player->v.movetype = MOVETYPE_WALK;
|
|
|
|
SV_ClientPrintf (host_client, PRINT_HIGH, "noclip OFF\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_Give_f
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Give_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
char *t;
|
|
|
|
int v;
|
|
|
|
|
|
|
|
if (!sv_allow_cheats) {
|
|
|
|
Con_Printf
|
|
|
|
("You must run the server with -cheats to enable this command.\n");
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 11:29:38 +00:00
|
|
|
if (!SV_SetPlayer ())
|
|
|
|
return;
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
t = Cmd_Argv (2);
|
|
|
|
v = atoi (Cmd_Argv (3));
|
|
|
|
|
|
|
|
switch (t[0]) {
|
|
|
|
case '2':
|
|
|
|
case '3':
|
|
|
|
case '4':
|
|
|
|
case '5':
|
|
|
|
case '6':
|
|
|
|
case '7':
|
|
|
|
case '8':
|
|
|
|
case '9':
|
|
|
|
sv_player->v.items =
|
|
|
|
(int) sv_player->v.items | IT_SHOTGUN << (t[0] - '2');
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 's':
|
|
|
|
sv_player->v.ammo_shells = v;
|
|
|
|
break;
|
|
|
|
case 'n':
|
|
|
|
sv_player->v.ammo_nails = v;
|
|
|
|
break;
|
|
|
|
case 'r':
|
|
|
|
sv_player->v.ammo_rockets = v;
|
|
|
|
break;
|
|
|
|
case 'h':
|
|
|
|
sv_player->v.health = v;
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
sv_player->v.ammo_cells = v;
|
|
|
|
break;
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-05-18 01:36:42 +00:00
|
|
|
// Use this to keep track of current level --KB
|
2000-12-08 06:51:37 +00:00
|
|
|
static char curlevel[MAX_QPATH] = "";
|
|
|
|
|
2000-05-10 11:29:38 +00:00
|
|
|
/*
|
|
|
|
======================
|
|
|
|
SV_Map_f
|
|
|
|
|
|
|
|
handle a
|
|
|
|
map <mapname>
|
|
|
|
command from the console or progs.
|
|
|
|
======================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Map_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
char level[MAX_QPATH];
|
|
|
|
char expanded[MAX_QPATH];
|
|
|
|
QFile *f;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () != 2) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("map <levelname> : continue game on a new level\n");
|
|
|
|
return;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
strcpy (level, Cmd_Argv (1));
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-05-10 11:29:38 +00:00
|
|
|
// check to make sure the level exists
|
2000-12-08 06:51:37 +00:00
|
|
|
snprintf (expanded, sizeof (expanded), "maps/%s.bsp", level);
|
2000-05-10 11:29:38 +00:00
|
|
|
COM_FOpenFile (expanded, &f);
|
2000-12-08 06:51:37 +00:00
|
|
|
if (!f) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Can't find %s\n", expanded);
|
2000-05-18 01:36:42 +00:00
|
|
|
// If curlevel == level, something is SCREWED! --KB
|
|
|
|
if (stricmp (level, curlevel) == 0)
|
|
|
|
SV_Error ("map: cannot restart level\n");
|
|
|
|
else
|
2000-12-08 06:51:37 +00:00
|
|
|
Cbuf_AddText (va ("map %s", curlevel));
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2000-09-27 19:44:26 +00:00
|
|
|
Qclose (f);
|
2000-05-10 11:29:38 +00:00
|
|
|
|
|
|
|
SV_BroadcastCommand ("changing\n");
|
|
|
|
SV_SendMessagesToAll ();
|
|
|
|
|
2000-05-18 01:36:42 +00:00
|
|
|
strcpy (curlevel, level);
|
2000-05-10 11:29:38 +00:00
|
|
|
SV_SpawnServer (level);
|
|
|
|
|
|
|
|
SV_BroadcastCommand ("reconnect\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_Kick_f
|
|
|
|
|
|
|
|
Kick a user off of the server
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Kick_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
|
|
|
client_t *cl;
|
|
|
|
int uid;
|
|
|
|
|
|
|
|
uid = atoi (Cmd_Argv (1));
|
|
|
|
|
|
|
|
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
2000-05-10 11:29:38 +00:00
|
|
|
if (!cl->state)
|
|
|
|
continue;
|
2000-12-08 06:51:37 +00:00
|
|
|
if (cl->userid == uid) {
|
2000-05-10 11:29:38 +00:00
|
|
|
SV_BroadcastPrintf (PRINT_HIGH, "%s was kicked\n", cl->name);
|
|
|
|
// print directly, because the dropped client won't get the
|
|
|
|
// SV_BroadcastPrintf message
|
|
|
|
SV_ClientPrintf (cl, PRINT_HIGH, "You were kicked from the game\n");
|
2000-12-08 06:51:37 +00:00
|
|
|
SV_DropClient (cl);
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Con_Printf ("Couldn't find user number %i\n", uid);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
SV_Status_f
|
|
|
|
================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Status_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int i;
|
|
|
|
client_t *cl;
|
|
|
|
float cpu, avg, pak;
|
|
|
|
char *s;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
cpu = (svs.stats.latched_active + svs.stats.latched_idle);
|
2000-05-10 11:29:38 +00:00
|
|
|
if (cpu)
|
2000-12-08 06:51:37 +00:00
|
|
|
cpu = 100 * svs.stats.latched_active / cpu;
|
|
|
|
avg = 1000 * svs.stats.latched_active / STATFRAMES;
|
|
|
|
pak = (float) svs.stats.latched_packets / STATFRAMES;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("net address : %s\n", NET_AdrToString (net_local_adr));
|
|
|
|
Con_Printf ("cpu utilization : %3i%%\n", (int) cpu);
|
|
|
|
Con_Printf ("avg response time: %i ms\n", (int) avg);
|
2000-12-31 07:43:09 +00:00
|
|
|
Con_Printf ("packets/frame : %5.2f (%d)\n", pak, sv_progs.num_prstr);
|
2000-10-07 10:56:33 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
// min fps lat drp
|
|
|
|
if (sv_redirected != RD_NONE) {
|
|
|
|
// most remote clients are 40 columns
|
2000-12-08 06:51:37 +00:00
|
|
|
// 0123456789012345678901234567890123456789
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("name userid frags\n");
|
2000-10-02 03:08:43 +00:00
|
|
|
Con_Printf (" address rate ping drop\n");
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf (" ---------------- ---- ---- -----\n");
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
if (!cl->state)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
Con_Printf ("%-16.16s ", cl->name);
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("%6i %5i", cl->userid, (int) cl->edict->v.frags);
|
2000-05-10 20:33:16 +00:00
|
|
|
if (cl->spectator)
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf (" (s)\n");
|
2000-10-07 10:56:33 +00:00
|
|
|
else
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("\n");
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
s = NET_BaseAdrToString (cl->netchan.remote_address);
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf (" %-16.16s", s);
|
2000-12-08 06:51:37 +00:00
|
|
|
if (cl->state == cs_connected) {
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("CONNECTING\n");
|
|
|
|
continue;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
if (cl->state == cs_zombie) {
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("ZOMBIE\n");
|
|
|
|
continue;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("%4i %4i %5.2f\n", (int) (1000 * cl->netchan.frame_rate)
|
|
|
|
, (int) SV_CalcPing (cl)
|
|
|
|
,
|
|
|
|
100.0 * cl->netchan.drop_count /
|
|
|
|
cl->netchan.incoming_sequence);
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
} else {
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf
|
|
|
|
("frags userid address name rate ping drop qport\n");
|
|
|
|
Con_Printf
|
|
|
|
("----- ------ --------------- --------------- ---- ---- ----- -----\n");
|
|
|
|
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
2000-05-10 11:29:38 +00:00
|
|
|
if (!cl->state)
|
|
|
|
continue;
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("%5i %6i ", (int) cl->edict->v.frags, cl->userid);
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
s = NET_BaseAdrToString (cl->netchan.remote_address);
|
2000-10-07 10:56:33 +00:00
|
|
|
|
|
|
|
Con_Printf ("%-15.15s ", s);
|
|
|
|
|
|
|
|
Con_Printf ("%-15.15s ", cl->name);
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (cl->state == cs_connected) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("CONNECTING\n");
|
|
|
|
continue;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
if (cl->state == cs_zombie) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("ZOMBIE\n");
|
|
|
|
continue;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("%4i %4i %3.1f %4i",
|
|
|
|
(int) (1000 * cl->netchan.frame_rate),
|
|
|
|
(int) SV_CalcPing (cl),
|
|
|
|
100.0 * cl->netchan.drop_count /
|
|
|
|
cl->netchan.incoming_sequence, cl->netchan.qport);
|
2000-05-10 20:33:16 +00:00
|
|
|
if (cl->spectator)
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf (" (s)\n");
|
2000-10-07 10:56:33 +00:00
|
|
|
else
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf ("\n");
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-10-07 10:56:33 +00:00
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
Con_Printf ("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_ConSay_f
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_ConSay_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
client_t *client;
|
|
|
|
int j;
|
|
|
|
char *p;
|
|
|
|
char text[1024];
|
2000-05-10 11:29:38 +00:00
|
|
|
|
|
|
|
if (Cmd_Argc () < 2)
|
|
|
|
return;
|
|
|
|
|
2000-05-21 08:24:45 +00:00
|
|
|
strcpy (text, "console: ");
|
2000-12-08 06:51:37 +00:00
|
|
|
p = Cmd_Args ();
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (*p == '"') {
|
2000-05-10 11:29:38 +00:00
|
|
|
p++;
|
2000-12-08 06:51:37 +00:00
|
|
|
p[strlen (p) - 1] = 0;
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
strncat (text, p, sizeof (text) - strlen (text));
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (j = 0, client = svs.clients; j < MAX_CLIENTS; j++, client++) {
|
2000-05-10 11:29:38 +00:00
|
|
|
if (client->state != cs_spawned)
|
|
|
|
continue;
|
2000-12-08 06:51:37 +00:00
|
|
|
SV_ClientPrintf (client, PRINT_CHAT, "%s\n", text);
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_Heartbeat_f
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Heartbeat_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
|
|
|
svs.last_heartbeat = -9999;
|
|
|
|
}
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_SendServerInfoChange (char *key, char *value)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
|
|
|
if (!sv.state)
|
|
|
|
return;
|
|
|
|
|
|
|
|
MSG_WriteByte (&sv.reliable_datagram, svc_serverinfo);
|
|
|
|
MSG_WriteString (&sv.reliable_datagram, key);
|
|
|
|
MSG_WriteString (&sv.reliable_datagram, value);
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
===========
|
|
|
|
SV_Serverinfo_f
|
|
|
|
|
|
|
|
Examine or change the serverinfo string
|
|
|
|
===========
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
char *CopyString (char *s);
|
|
|
|
void
|
|
|
|
SV_Serverinfo_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
cvar_t *var;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () == 1) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Server info settings:\n");
|
|
|
|
Info_Print (svs.info);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () != 3) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("usage: serverinfo [ <key> <value> ]\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argv (1)[0] == '*') {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Star variables cannot be changed.\n");
|
|
|
|
return;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
Info_SetValueForKey (svs.info, Cmd_Argv (1), Cmd_Argv (2),
|
|
|
|
MAX_SERVERINFO_STRING);
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
// if this is a cvar, change it too
|
|
|
|
var = Cvar_FindVar (Cmd_Argv (1));
|
2000-05-10 11:29:38 +00:00
|
|
|
if (var)
|
2000-12-08 06:51:37 +00:00
|
|
|
Cvar_Set (var, Cmd_Argv (2));
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-10-15 04:31:32 +00:00
|
|
|
if (!var || !(var->flags & CVAR_SERVERINFO))
|
|
|
|
// Cvar_Set will send the change if CVAR_SERVERINFO is set
|
2000-12-08 06:51:37 +00:00
|
|
|
SV_SendServerInfoChange (Cmd_Argv (1), Cmd_Argv (2));
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
===========
|
|
|
|
SV_Serverinfo_f
|
|
|
|
|
|
|
|
Examine or change the serverinfo string
|
|
|
|
===========
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
char *CopyString (char *s);
|
|
|
|
void
|
|
|
|
SV_Localinfo_f (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () == 1) {
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("Local info settings:\n");
|
|
|
|
Info_Print (localinfo);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () != 3) {
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("usage: localinfo [ <key> <value> ]\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argv (1)[0] == '*') {
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("Star variables cannot be changed.\n");
|
|
|
|
return;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
Info_SetValueForKey (localinfo, Cmd_Argv (1), Cmd_Argv (2),
|
|
|
|
MAX_LOCALINFO_STRING);
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
===========
|
|
|
|
SV_User_f
|
|
|
|
|
|
|
|
Examine a users info strings
|
|
|
|
===========
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_User_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () != 2) {
|
2001-01-04 03:45:47 +00:00
|
|
|
Con_Printf ("Usage: user <userid>\n");
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!SV_SetPlayer ())
|
|
|
|
return;
|
|
|
|
|
|
|
|
Info_Print (host_client->userinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
SV_Gamedir
|
|
|
|
|
|
|
|
Sets the fake *gamedir to a different directory.
|
|
|
|
================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Gamedir (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
char *dir;
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () == 1) {
|
|
|
|
Con_Printf ("Current *gamedir: %s\n",
|
|
|
|
Info_ValueForKey (svs.info, "*gamedir"));
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () != 2) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("Usage: sv_gamedir <newgamedir>\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
dir = Cmd_Argv (1);
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (strstr (dir, "..") || strstr (dir, "/")
|
|
|
|
|| strstr (dir, "\\") || strstr (dir, ":")) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("*Gamedir should be a single filename, not a path\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Info_SetValueForStarKey (svs.info, "*gamedir", dir, MAX_SERVERINFO_STRING);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
SV_Floodport_f
|
|
|
|
|
|
|
|
Sets the gamedir and path to a different directory.
|
|
|
|
================
|
|
|
|
*/
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Floodprot_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int arg1, arg2, arg3;
|
|
|
|
|
|
|
|
if (Cmd_Argc () == 1) {
|
2000-05-10 11:29:38 +00:00
|
|
|
if (fp_messages) {
|
2000-12-08 06:51:37 +00:00
|
|
|
Con_Printf
|
|
|
|
("Current floodprot settings: \nAfter %d msgs per %d seconds, silence for %d seconds\n",
|
|
|
|
fp_messages, fp_persecond, fp_secondsdead);
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
} else
|
|
|
|
Con_Printf ("No floodprots enabled.\n");
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () != 4) {
|
|
|
|
Con_Printf
|
|
|
|
("Usage: floodprot <# of messages> <per # of seconds> <seconds to silence>\n");
|
|
|
|
Con_Printf
|
|
|
|
("Use floodprotmsg to set a custom message to say to the flooder.\n");
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
arg1 = atoi (Cmd_Argv (1));
|
|
|
|
arg2 = atoi (Cmd_Argv (2));
|
|
|
|
arg3 = atoi (Cmd_Argv (3));
|
2000-05-10 11:29:38 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (arg1 <= 0 || arg2 <= 0 || arg3 <= 0) {
|
2000-05-10 11:29:38 +00:00
|
|
|
Con_Printf ("All values must be positive numbers\n");
|
|
|
|
return;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
|
2000-05-10 11:29:38 +00:00
|
|
|
if (arg1 > 10) {
|
|
|
|
Con_Printf ("Can only track up to 10 messages.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
fp_messages = arg1;
|
2000-05-10 11:29:38 +00:00
|
|
|
fp_persecond = arg2;
|
|
|
|
fp_secondsdead = arg3;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Floodprotmsg_f (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () == 1) {
|
|
|
|
Con_Printf ("Current msg: %s\n", fp_msg);
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
2000-12-08 06:51:37 +00:00
|
|
|
} else if (Cmd_Argc () != 2) {
|
|
|
|
Con_Printf ("Usage: floodprotmsg \"<message>\"\n");
|
2000-05-10 11:29:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2000-12-08 06:51:37 +00:00
|
|
|
snprintf (fp_msg, sizeof (fp_msg), "%s", Cmd_Argv (1));
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
2000-05-10 20:33:16 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
SV_Snap
|
|
|
|
================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Snap (int uid)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
client_t *cl;
|
|
|
|
char pcxname[80];
|
|
|
|
char checkname[MAX_OSPATH];
|
|
|
|
int i;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
if (!cl->state)
|
|
|
|
continue;
|
|
|
|
if (cl->userid == uid)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i >= MAX_CLIENTS) {
|
|
|
|
Con_Printf ("userid not found\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
snprintf (pcxname, sizeof (pcxname), "%d-00.pcx", uid);
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
snprintf (checkname, sizeof (checkname), "%s/snap", com_gamedir);
|
2000-11-08 06:07:03 +00:00
|
|
|
COM_CreatePath (va ("%s/dummy", checkname));
|
2000-12-08 06:51:37 +00:00
|
|
|
|
|
|
|
for (i = 0; i <= 99; i++) {
|
|
|
|
pcxname[strlen (pcxname) - 6] = i / 10 + '0';
|
|
|
|
pcxname[strlen (pcxname) - 5] = i % 10 + '0';
|
|
|
|
snprintf (checkname, sizeof (checkname), "%s/snap/%s", com_gamedir,
|
|
|
|
pcxname);
|
|
|
|
if (Sys_FileTime (checkname) == -1)
|
|
|
|
break; // file doesn't exist
|
|
|
|
}
|
|
|
|
if (i == 100) {
|
|
|
|
Con_Printf ("Snap: Couldn't create a file, clean some out.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
strcpy (cl->uploadfn, checkname);
|
|
|
|
|
|
|
|
memcpy (&cl->snap_from, &net_from, sizeof (net_from));
|
2000-05-10 20:33:16 +00:00
|
|
|
if (sv_redirected != RD_NONE)
|
|
|
|
cl->remote_snap = true;
|
|
|
|
else
|
|
|
|
cl->remote_snap = false;
|
|
|
|
|
|
|
|
ClientReliableWrite_Begin (cl, svc_stufftext, 24);
|
2001-01-02 22:58:32 +00:00
|
|
|
ClientReliableWrite_String (cl, "cmd snap\n");
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("Requesting snap from user %d...\n", uid);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
SV_Snap_f
|
|
|
|
================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_Snap_f (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
int uid;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
if (Cmd_Argc () != 2) {
|
2000-05-10 20:33:16 +00:00
|
|
|
Con_Printf ("Usage: snap <userid>\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
uid = atoi (Cmd_Argv (1));
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
SV_Snap (uid);
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
SV_Snap
|
|
|
|
================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_SnapAll_f (void)
|
2000-05-10 20:33:16 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
client_t *cl;
|
|
|
|
int i;
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++) {
|
2000-05-10 20:33:16 +00:00
|
|
|
if (cl->state < cs_connected || cl->spectator)
|
|
|
|
continue;
|
2000-12-08 06:51:37 +00:00
|
|
|
SV_Snap (cl->userid);
|
2000-05-10 20:33:16 +00:00
|
|
|
}
|
|
|
|
}
|
2000-05-10 11:29:38 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
SV_InitOperatorCommands
|
|
|
|
==================
|
|
|
|
*/
|
2000-12-08 06:51:37 +00:00
|
|
|
void
|
|
|
|
SV_InitOperatorCommands (void)
|
2000-05-10 11:29:38 +00:00
|
|
|
{
|
2000-12-08 06:51:37 +00:00
|
|
|
if (COM_CheckParm ("-cheats")) {
|
2000-05-10 11:29:38 +00:00
|
|
|
sv_allow_cheats = true;
|
2000-12-08 06:51:37 +00:00
|
|
|
Info_SetValueForStarKey (svs.info, "*cheats", "ON",
|
|
|
|
MAX_SERVERINFO_STRING);
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Cmd_AddCommand ("logfile", SV_Logfile_f);
|
|
|
|
Cmd_AddCommand ("fraglogfile", SV_Fraglogfile_f);
|
|
|
|
|
2000-05-10 20:33:16 +00:00
|
|
|
Cmd_AddCommand ("snap", SV_Snap_f);
|
|
|
|
Cmd_AddCommand ("snapall", SV_SnapAll_f);
|
2000-05-10 11:29:38 +00:00
|
|
|
Cmd_AddCommand ("kick", SV_Kick_f);
|
|
|
|
Cmd_AddCommand ("status", SV_Status_f);
|
|
|
|
|
|
|
|
Cmd_AddCommand ("map", SV_Map_f);
|
|
|
|
Cmd_AddCommand ("setmaster", SV_SetMaster_f);
|
|
|
|
|
|
|
|
Cmd_AddCommand ("say", SV_ConSay_f);
|
|
|
|
Cmd_AddCommand ("heartbeat", SV_Heartbeat_f);
|
|
|
|
Cmd_AddCommand ("quit", SV_Quit_f);
|
|
|
|
Cmd_AddCommand ("god", SV_God_f);
|
|
|
|
Cmd_AddCommand ("give", SV_Give_f);
|
|
|
|
Cmd_AddCommand ("noclip", SV_Noclip_f);
|
2000-05-10 20:33:16 +00:00
|
|
|
Cmd_AddCommand ("serverinfo", SV_Serverinfo_f);
|
2000-05-10 11:29:38 +00:00
|
|
|
Cmd_AddCommand ("localinfo", SV_Localinfo_f);
|
|
|
|
Cmd_AddCommand ("user", SV_User_f);
|
|
|
|
Cmd_AddCommand ("sv_gamedir", SV_Gamedir);
|
|
|
|
Cmd_AddCommand ("floodprot", SV_Floodprot_f);
|
2000-05-10 20:33:16 +00:00
|
|
|
Cmd_AddCommand ("floodprotmsg", SV_Floodprotmsg_f);
|
2000-10-02 17:22:37 +00:00
|
|
|
Cmd_AddCommand ("maplist", COM_Maplist_f);
|
2000-05-10 20:33:16 +00:00
|
|
|
|
2000-12-08 06:51:37 +00:00
|
|
|
cl_warncmd =
|
2000-12-31 04:46:04 +00:00
|
|
|
Cvar_Get ("cl_warncmd", "1", CVAR_NONE, "Toggles the display of error messages for unknown commands");
|
2000-12-08 06:51:37 +00:00
|
|
|
// poor
|
|
|
|
// description
|
2000-05-10 11:29:38 +00:00
|
|
|
}
|