2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // for secure rcon authentication
29 #include "cl_collision.h"
31 /// User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()!
32 cvar_t cl_name = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "_cl_name", "player", "player name"};
33 cvar_t cl_rate = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate", "20000", "connection speed"};
34 cvar_t cl_rate_burstsize = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "rate_burstsize", "1024", "rate control burst size"};
35 cvar_t cl_topcolor = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "topcolor", "0", "color of your shirt"};
36 cvar_t cl_bottomcolor = {CF_CLIENT | CF_ARCHIVE | CF_USERINFO, "bottomcolor", "0", "color of your pants"};
37 cvar_t cl_team = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "team", "none", "QW team (4 character limit, example: blue)"};
38 cvar_t cl_skin = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "skin", "", "QW player skin name (example: base)"};
39 cvar_t cl_noaim = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "noaim", "1", "QW option to disable vertical autoaim"};
40 cvar_t cl_pmodel = {CF_CLIENT | CF_USERINFO | CF_ARCHIVE, "pmodel", "0", "current player model number in nehahra"};
42 cvar_t r_fixtrans_auto = {CF_CLIENT, "r_fixtrans_auto", "0", "automatically fixtrans textures (when set to 2, it also saves the fixed versions to a fixtrans directory)"};
44 extern cvar_t rcon_secure;
45 extern cvar_t rcon_secure_challengetimeout;
51 Sends an entire command string over to the server, unprocessed
54 void CL_ForwardToServer (const char *s)
57 if (cls.state != ca_connected)
59 Con_Printf("Can't \"%s\", not connected\n", s);
66 // LadyHavoc: thanks to Fuh for bringing the pure evil of SZ_Print to my
67 // attention, it has been eradicated from here, its only (former) use in
69 if (cls.protocol == PROTOCOL_QUAKEWORLD)
70 MSG_WriteByte(&cls.netcon->message, qw_clc_stringcmd);
72 MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
73 if ((!strncmp(s, "say ", 4) || !strncmp(s, "say_team ", 9)) && cl_locs_enable.integer)
75 // say/say_team commands can replace % character codes with status info
78 if (*s == '%' && s[1])
80 // handle proquake message macros
84 case 'l': // current location
85 CL_Locs_FindLocationName(temp, sizeof(temp), cl.movement_origin);
87 case 'h': // current health
88 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_HEALTH]);
90 case 'a': // current armor
91 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_ARMOR]);
93 case 'x': // current rockets
94 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_ROCKETS]);
96 case 'c': // current cells
97 dpsnprintf(temp, sizeof(temp), "%i", cl.stats[STAT_CELLS]);
99 // silly proquake macros
100 case 'd': // loc at last death
101 CL_Locs_FindLocationName(temp, sizeof(temp), cl.lastdeathorigin);
103 case 't': // current time
104 dpsnprintf(temp, sizeof(temp), "%.0f:%.0f", floor(cl.time / 60), cl.time - floor(cl.time / 60) * 60);
106 case 'r': // rocket launcher status ("I have RL", "I need rockets", "I need RL")
107 if (!(cl.stats[STAT_ITEMS] & IT_ROCKET_LAUNCHER))
108 dpsnprintf(temp, sizeof(temp), "I need RL");
109 else if (!cl.stats[STAT_ROCKETS])
110 dpsnprintf(temp, sizeof(temp), "I need rockets");
112 dpsnprintf(temp, sizeof(temp), "I have RL");
114 case 'p': // powerup status (outputs "quad" "pent" and "eyes" according to status)
115 if (cl.stats[STAT_ITEMS] & IT_QUAD)
118 dp_strlcat(temp, " ", sizeof(temp));
119 dp_strlcat(temp, "quad", sizeof(temp));
121 if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY)
124 dp_strlcat(temp, " ", sizeof(temp));
125 dp_strlcat(temp, "pent", sizeof(temp));
127 if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
130 dp_strlcat(temp, " ", sizeof(temp));
131 dp_strlcat(temp, "eyes", sizeof(temp));
134 case 'w': // weapon status (outputs "SSG:NG:SNG:GL:RL:LG" with the text between : characters omitted if you lack the weapon)
135 if (cl.stats[STAT_ITEMS] & IT_SUPER_SHOTGUN)
136 dp_strlcat(temp, "SSG", sizeof(temp));
137 dp_strlcat(temp, ":", sizeof(temp));
138 if (cl.stats[STAT_ITEMS] & IT_NAILGUN)
139 dp_strlcat(temp, "NG", sizeof(temp));
140 dp_strlcat(temp, ":", sizeof(temp));
141 if (cl.stats[STAT_ITEMS] & IT_SUPER_NAILGUN)
142 dp_strlcat(temp, "SNG", sizeof(temp));
143 dp_strlcat(temp, ":", sizeof(temp));
144 if (cl.stats[STAT_ITEMS] & IT_GRENADE_LAUNCHER)
145 dp_strlcat(temp, "GL", sizeof(temp));
146 dp_strlcat(temp, ":", sizeof(temp));
147 if (cl.stats[STAT_ITEMS] & IT_ROCKET_LAUNCHER)
148 dp_strlcat(temp, "RL", sizeof(temp));
149 dp_strlcat(temp, ":", sizeof(temp));
150 if (cl.stats[STAT_ITEMS] & IT_LIGHTNING)
151 dp_strlcat(temp, "LG", sizeof(temp));
154 // not a recognized macro, print it as-is...
160 // write the resulting text
161 SZ_Write(&cls.netcon->message, (unsigned char *)temp, (int)strlen(temp));
165 MSG_WriteByte(&cls.netcon->message, *s);
168 MSG_WriteByte(&cls.netcon->message, 0);
170 else // any other command is passed on as-is
171 SZ_Write(&cls.netcon->message, (const unsigned char *)s, (int)strlen(s) + 1);
174 void CL_ForwardToServer_f (cmd_state_t *cmd)
177 char vabuf[MAX_INPUTLINE];
179 if (!strcasecmp(Cmd_Argv(cmd, 0), "cmd"))
181 // we want to strip off "cmd", so just send the args
182 s = Cmd_Argc(cmd) > 1 ? Cmd_Args(cmd) : "";
186 // we need to keep the command name, so send Cmd_Argv(cmd, 0), a space and then Cmd_Args(cmd)
187 i = dpsnprintf(vabuf, sizeof(vabuf), "%s", Cmd_Argv(cmd, 0));
188 if(Cmd_Argc(cmd) > 1)
189 // (i + 1) accounts for the added space
190 dpsnprintf(&vabuf[i], sizeof(vabuf) - (i + 1), " %s", Cmd_Args(cmd));
193 // don't send an empty forward message if the user tries "cmd" by itself
196 CL_ForwardToServer(s);
199 static void CL_SendCvar_f(cmd_state_t *cmd)
202 const char *cvarname;
205 if(Cmd_Argc(cmd) != 2)
207 cvarname = Cmd_Argv(cmd, 1);
208 if (cls.state == ca_connected)
210 c = Cvar_FindVar(&cvars_all, cvarname, CF_CLIENT | CF_SERVER);
211 // LadyHavoc: if there is no such cvar or if it is private, send a
212 // reply indicating that it has no value
213 if(!c || (c->flags & CF_PRIVATE))
214 CL_ForwardToServer(va(vabuf, sizeof(vabuf), "sentcvar %s", cvarname));
216 CL_ForwardToServer(va(vabuf, sizeof(vabuf), "sentcvar %s \"%s\"", c->name, c->string));
225 The logic from div0-stable's Host_Name_f() is now in SV_Name_f().
228 static void CL_Name_f(cmd_state_t *cmd)
232 if (Cmd_Argc(cmd) == 1)
234 Con_Printf("name: \"%s^7\"\n", cl_name.string);
238 // in the single-arg case any enclosing quotes shall be stripped
239 newNameSource = (char *)(Cmd_Argc(cmd) == 2 ? Cmd_Argv(cmd, 1) : Cmd_Args(cmd));
241 if (strlen(newNameSource) >= MAX_SCOREBOARDNAME) // may as well truncate before networking
242 newNameSource[MAX_SCOREBOARDNAME - 1] = '\0'; // this is fine (cbuf stores length)
244 Cvar_SetQuick(&cl_name, newNameSource);
252 cvar_t cl_color = {CF_CLIENT | CF_ARCHIVE, "_cl_color", "0", "internal storage cvar for current player colors (changed by color command)"};
254 // HACK: Ignore the callbacks so this two-to-three way synchronization doesn't cause an infinite loop.
255 static void CL_Color_c(cvar_t *var)
258 void (*callback_save)(cvar_t *);
260 callback_save = cl_topcolor.callback;
261 cl_topcolor.callback = NULL;
262 Cvar_SetQuick(&cl_topcolor, va(vabuf, sizeof(vabuf), "%i", ((var->integer >> 4) & 15)));
263 cl_topcolor.callback = callback_save;
265 callback_save = cl_bottomcolor.callback;
266 cl_bottomcolor.callback = NULL;
267 Cvar_SetQuick(&cl_bottomcolor, va(vabuf, sizeof(vabuf), "%i", (var->integer & 15)));
268 cl_bottomcolor.callback = callback_save;
271 static void CL_Topcolor_c(cvar_t *var)
274 void (*callback_save)(cvar_t *);
276 callback_save = cl_color.callback;
277 cl_color.callback = NULL;
278 Cvar_SetQuick(&cl_color, va(vabuf, sizeof(vabuf), "%i", var->integer*16 + cl_bottomcolor.integer));
279 cl_color.callback = callback_save;
282 static void CL_Bottomcolor_c(cvar_t *var)
285 void (*callback_save)(cvar_t *);
287 callback_save = cl_color.callback;
288 cl_color.callback = NULL;
289 Cvar_SetQuick(&cl_color, va(vabuf, sizeof(vabuf), "%i", cl_topcolor.integer*16 + var->integer));
290 cl_color.callback = callback_save;
293 static void CL_Color_f(cmd_state_t *cmd)
297 if (Cmd_Argc(cmd) == 1)
299 if (cmd->source == src_local)
301 Con_Printf("\"color\" is \"%i %i\"\n", cl_topcolor.integer, cl_bottomcolor.integer);
302 Con_Print("color <0-15> [0-15]\n");
307 if (Cmd_Argc(cmd) == 2)
308 top = bottom = atoi(Cmd_Argv(cmd, 1));
311 top = atoi(Cmd_Argv(cmd, 1));
312 bottom = atoi(Cmd_Argv(cmd, 2));
315 * This is just a convenient way to change topcolor and bottomcolor
316 * We can't change cl_color from here directly because topcolor and
317 * bottomcolor may be changed separately and do not call this function.
318 * So it has to be changed when the userinfo strings are updated, which
319 * happens twice here. Perhaps find a cleaner way?
322 top = top >= 0 ? top : cl_topcolor.integer;
323 bottom = bottom >= 0 ? bottom : cl_bottomcolor.integer;
328 // LadyHavoc: allowing skin colormaps 14 and 15 by commenting this out
334 if (cmd->source == src_local)
336 Cvar_SetValueQuick(&cl_topcolor, top);
337 Cvar_SetValueQuick(&cl_bottomcolor, bottom);
346 user <name or userid>
348 Dump userdata / masterdata for a user
351 static void CL_User_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
356 if (Cmd_Argc(cmd) != 2)
358 Con_Printf ("Usage: user <username / userid>\n");
362 uid = atoi(Cmd_Argv(cmd, 1));
364 for (i = 0;i < cl.maxclients;i++)
366 if (!cl.scores[i].name[0])
368 if (cl.scores[i].qw_userid == uid || !strcasecmp(cl.scores[i].name, Cmd_Argv(cmd, 1)))
370 InfoString_Print(cl.scores[i].qw_userinfo);
374 Con_Printf ("User not in server.\n");
381 Dump userids for all current players
384 static void CL_Users_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
390 Con_Printf ("userid frags name\n");
391 Con_Printf ("------ ----- ----\n");
392 for (i = 0;i < cl.maxclients;i++)
394 if (cl.scores[i].name[0])
396 Con_Printf ("%6i %4i %s\n", cl.scores[i].qw_userid, cl.scores[i].frags, cl.scores[i].name);
401 Con_Printf ("%i total users\n", c);
408 packet <destination> <contents>
410 Contents allows \n escape character
413 static void CL_Packet_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
419 lhnetaddress_t address;
420 lhnetsocket_t *mysocket;
422 if (Cmd_Argc(cmd) != 3)
424 Con_Printf ("packet <destination> <contents>\n");
428 if (!LHNETADDRESS_FromString (&address, Cmd_Argv(cmd, 1), sv_netport.integer))
430 Con_Printf ("Bad address\n");
434 in = Cmd_Argv(cmd, 2);
436 send[0] = send[1] = send[2] = send[3] = -1;
438 l = (int)strlen (in);
439 for (i=0 ; i<l ; i++)
441 if (out >= send + sizeof(send) - 1)
443 if (in[i] == '\\' && in[i+1] == 'n')
448 else if (in[i] == '\\' && in[i+1] == '0')
453 else if (in[i] == '\\' && in[i+1] == 't')
458 else if (in[i] == '\\' && in[i+1] == 'r')
463 else if (in[i] == '\\' && in[i+1] == '"')
472 mysocket = NetConn_ChooseClientSocketForAddress(&address);
474 mysocket = NetConn_ChooseServerSocketForAddress(&address);
476 NetConn_Write(mysocket, send, out - send, &address);
480 =====================
483 ProQuake rcon support
484 =====================
486 static void CL_PQRcon_f(cmd_state_t *cmd)
490 lhnetsocket_t *mysocket;
492 if (Cmd_Argc(cmd) == 1)
494 Con_Printf("%s: Usage: %s command\n", Cmd_Argv(cmd, 0), Cmd_Argv(cmd, 0));
498 if (!rcon_password.string || !rcon_password.string[0] || rcon_secure.integer > 0)
500 Con_Printf ("You must set rcon_password before issuing an pqrcon command, and rcon_secure must be 0.\n");
504 e = strchr(rcon_password.string, ' ');
505 n = e ? e-rcon_password.string : (int)strlen(rcon_password.string);
508 cls.rcon_address = cls.netcon->peeraddress;
511 if (!rcon_address.string[0])
513 Con_Printf ("You must either be connected, or set the rcon_address cvar to issue rcon commands\n");
516 LHNETADDRESS_FromString(&cls.rcon_address, rcon_address.string, sv_netport.integer);
518 mysocket = NetConn_ChooseClientSocketForAddress(&cls.rcon_address);
522 unsigned char bufdata[64];
525 MSG_WriteLong(&buf, 0);
526 MSG_WriteByte(&buf, CCREQ_RCON);
527 SZ_Write(&buf, (const unsigned char*)rcon_password.string, n);
528 MSG_WriteByte(&buf, 0); // terminate the (possibly partial) string
529 MSG_WriteString(&buf, Cmd_Args(cmd));
530 StoreBigLong(buf.data, NETFLAG_CTL | (buf.cursize & NETFLAG_LENGTH_MASK));
531 NetConn_Write(mysocket, buf.data, buf.cursize, &cls.rcon_address);
537 =====================
540 Send the rest of the command line over as
541 an unconnected command.
542 =====================
544 static void CL_Rcon_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
548 lhnetsocket_t *mysocket;
550 if (Cmd_Argc(cmd) == 1)
552 Con_Printf("%s: Usage: %s command\n", Cmd_Argv(cmd, 0), Cmd_Argv(cmd, 0));
556 if (!rcon_password.string || !rcon_password.string[0])
558 Con_Printf ("You must set rcon_password before issuing an rcon command.\n");
562 e = strchr(rcon_password.string, ' ');
563 n = e ? e-rcon_password.string : (int)strlen(rcon_password.string);
566 cls.rcon_address = cls.netcon->peeraddress;
569 if (!rcon_address.string[0])
571 Con_Printf ("You must either be connected, or set the rcon_address cvar to issue rcon commands\n");
574 LHNETADDRESS_FromString(&cls.rcon_address, rcon_address.string, sv_netport.integer);
576 mysocket = NetConn_ChooseClientSocketForAddress(&cls.rcon_address);
577 if (mysocket && Cmd_Args(cmd)[0])
579 // simply put together the rcon packet and send it
580 if(Cmd_Argv(cmd, 0)[0] == 's' || rcon_secure.integer > 1)
582 if(cls.rcon_commands[cls.rcon_ringpos][0])
585 LHNETADDRESS_ToString(&cls.rcon_addresses[cls.rcon_ringpos], s, sizeof(s), true);
586 Con_Printf("rcon to %s (for command %s) failed: too many buffered commands (possibly increase MAX_RCONS)\n", s, cls.rcon_commands[cls.rcon_ringpos]);
587 cls.rcon_commands[cls.rcon_ringpos][0] = 0;
590 for (i = 0;i < MAX_RCONS;i++)
591 if(cls.rcon_commands[i][0])
592 if (!LHNETADDRESS_Compare(&cls.rcon_address, &cls.rcon_addresses[i]))
596 NetConn_WriteString(mysocket, "\377\377\377\377getchallenge", &cls.rcon_address); // otherwise we'll request the challenge later
597 dp_strlcpy(cls.rcon_commands[cls.rcon_ringpos], Cmd_Args(cmd), sizeof(cls.rcon_commands[cls.rcon_ringpos]));
598 cls.rcon_addresses[cls.rcon_ringpos] = cls.rcon_address;
599 cls.rcon_timeout[cls.rcon_ringpos] = host.realtime + rcon_secure_challengetimeout.value;
600 cls.rcon_ringpos = (cls.rcon_ringpos + 1) % MAX_RCONS;
602 else if(rcon_secure.integer > 0)
606 dpsnprintf(argbuf, sizeof(argbuf), "%ld.%06d %s", (long) time(NULL), (int) (rand() % 1000000), Cmd_Args(cmd));
607 memcpy(buf, "\377\377\377\377srcon HMAC-MD4 TIME ", 24);
608 if(HMAC_MDFOUR_16BYTES((unsigned char *) (buf + 24), (unsigned char *) argbuf, (int)strlen(argbuf), (unsigned char *) rcon_password.string, n))
611 dp_strlcpy(buf + 41, argbuf, sizeof(buf) - 41);
612 NetConn_Write(mysocket, buf, 41 + (int)strlen(buf + 41), &cls.rcon_address);
618 memcpy(buf, "\377\377\377\377", 4);
619 dpsnprintf(buf+4, sizeof(buf)-4, "rcon %.*s %s", n, rcon_password.string, Cmd_Args(cmd));
620 NetConn_WriteString(mysocket, buf, &cls.rcon_address);
629 Sent by server when serverinfo changes
632 // TODO: shouldn't this be a cvar instead?
633 static void CL_FullServerinfo_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
636 if (Cmd_Argc(cmd) != 2)
638 Con_Printf ("usage: fullserverinfo <complete info string>\n");
642 dp_strlcpy (cl.qw_serverinfo, Cmd_Argv(cmd, 1), sizeof(cl.qw_serverinfo));
643 InfoString_GetValue(cl.qw_serverinfo, "teamplay", temp, sizeof(temp));
644 cl.qw_teamplay = atoi(temp);
651 Allow clients to change userinfo
655 static void CL_FullInfo_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
661 if (Cmd_Argc(cmd) != 2)
663 Con_Printf ("fullinfo <complete info string>\n");
667 s = Cmd_Argv(cmd, 1);
672 size_t len = strcspn(s, "\\");
673 if (len >= sizeof(key)) {
674 len = sizeof(key) - 1;
676 dp_strlcpy(key, s, len + 1);
680 Con_Printf ("MISSING VALUE\n");
683 ++s; // Skip over backslash.
685 len = strcspn(s, "\\");
686 if (len >= sizeof(value)) {
687 len = sizeof(value) - 1;
689 dp_strlcpy(value, s, len + 1);
691 CL_SetInfo(key, value, false, false, false, false);
698 ++s; // Skip over backslash.
706 Allow clients to change userinfo
709 static void CL_SetInfo_f(cmd_state_t *cmd) // credit: taken from QuakeWorld
711 if (Cmd_Argc(cmd) == 1)
713 InfoString_Print(cls.userinfo);
716 if (Cmd_Argc(cmd) != 3)
718 Con_Printf ("usage: setinfo [ <key> <value> ]\n");
721 CL_SetInfo(Cmd_Argv(cmd, 1), Cmd_Argv(cmd, 2), true, false, false, false);
724 static void CL_PingPLReport_f(cmd_state_t *cmd)
728 int l = Cmd_Argc(cmd);
729 if (l > cl.maxclients)
731 for (i = 0;i < l;i++)
733 cl.scores[i].qw_ping = atoi(Cmd_Argv(cmd, 1+i*2));
734 cl.scores[i].qw_packetloss = strtol(Cmd_Argv(cmd, 1+i*2+1), &errbyte, 0);
735 if(errbyte && *errbyte == ',')
736 cl.scores[i].qw_movementloss = atoi(errbyte + 1);
738 cl.scores[i].qw_movementloss = 0;
742 void CL_InitCommands(void)
744 dpsnprintf(cls.userinfo, sizeof(cls.userinfo), "\\name\\player\\team\\none\\topcolor\\0\\bottomcolor\\0\\rate\\10000\\msg\\1\\noaim\\1\\*ver\\dp");
746 /* In Quake `name` is a command that concatenates its arguments (quotes unnecessary)
747 * which is expected in most DP-based games.
748 * In QuakeWorld it's a cvar which requires quotes if spaces are used.
750 Cvar_RegisterVariable(&cl_name);
751 if ((0)) // TODO: if (gamemode == GAME_QUAKEWORLD)
752 Cvar_RegisterVirtual(&cl_name, "name");
754 Cmd_AddCommand(CF_CLIENT, "name", CL_Name_f, "change your player name");
756 Cvar_RegisterVariable(&cl_rate);
757 Cvar_RegisterVirtual(&cl_rate, "_cl_rate");
758 Cvar_RegisterVariable(&cl_rate_burstsize);
759 Cvar_RegisterVirtual(&cl_rate_burstsize, "_cl_rate_burstsize");
760 Cvar_RegisterVariable(&cl_pmodel);
761 Cvar_RegisterVirtual(&cl_pmodel, "_cl_pmodel");
762 Cvar_RegisterVariable(&cl_color);
763 Cvar_RegisterCallback(&cl_color, CL_Color_c);
764 Cvar_RegisterVariable(&cl_topcolor);
765 Cvar_RegisterCallback(&cl_topcolor, CL_Topcolor_c);
766 Cvar_RegisterVariable(&cl_bottomcolor);
767 Cvar_RegisterCallback(&cl_bottomcolor, CL_Bottomcolor_c);
768 Cvar_RegisterVariable(&r_fixtrans_auto);
769 Cvar_RegisterVariable(&cl_team);
770 Cvar_RegisterVariable(&cl_skin);
771 Cvar_RegisterVariable(&cl_noaim);
773 Cmd_AddCommand(CF_CLIENT | CF_CLIENT_FROM_SERVER, "cmd", CL_ForwardToServer_f, "send a console commandline to the server (used by some mods)");
774 Cmd_AddCommand(CF_CLIENT, "color", CL_Color_f, "change your player shirt and pants colors");
775 Cmd_AddCommand(CF_CLIENT, "rcon", CL_Rcon_f, "sends a command to the server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's); note: if rcon_secure is set, client and server clocks must be synced e.g. via NTP");
776 Cmd_AddCommand(CF_CLIENT, "srcon", CL_Rcon_f, "sends a command to the server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's); this always works as if rcon_secure is set; note: client and server clocks must be synced e.g. via NTP");
777 Cmd_AddCommand(CF_CLIENT, "pqrcon", CL_PQRcon_f, "sends a command to a proquake server console (if your rcon_password matches the server's rcon_password), or to the address specified by rcon_address when not connected (again rcon_password must match the server's)");
778 Cmd_AddCommand(CF_SHARED, "user", CL_User_f, "prints additional information about a player number or name on the scoreboard");
779 Cmd_AddCommand(CF_SHARED, "users", CL_Users_f, "prints additional information about all players on the scoreboard");
780 Cmd_AddCommand(CF_CLIENT, "packet", CL_Packet_f, "send a packet to the specified address:port containing a text string");
781 Cmd_AddCommand(CF_CLIENT, "fullinfo", CL_FullInfo_f, "allows client to modify their userinfo");
782 Cmd_AddCommand(CF_CLIENT, "setinfo", CL_SetInfo_f, "modifies your userinfo");
783 Cmd_AddCommand(CF_CLIENT, "fixtrans", Image_FixTransparentPixels_f, "change alpha-zero pixels in an image file to sensible values, and write out a new TGA (warning: SLOW)");
784 host.hook.CL_SendCvar = CL_SendCvar_f;
786 // commands that are only sent by server to client for execution
787 Cmd_AddCommand(CF_CLIENT_FROM_SERVER, "pingplreport", CL_PingPLReport_f, "command sent by server containing client ping and packet loss values for scoreboard, triggered by pings command from client (not used by QW servers)");
788 Cmd_AddCommand(CF_CLIENT_FROM_SERVER, "fullserverinfo", CL_FullServerinfo_f, "internal use only, sent by server to client to update client's local copy of serverinfo string");