- add some comments to libs/console/inputline.c

- rename pr_deadbeef to pr_deadbeef_ents
- add pr_deadbeef_locals, which does uninited locals.  (crashes from
  it are undeniably buggy code, unlike pr_deadeef_ents)
- add a missing break to packetlog printing's switch
- add sv_kickfake, which kicks people for attempting to fake messages,
  or replaces the ^Ms with # if disabled.
This commit is contained in:
Adam Olsen 2001-09-23 00:36:21 +00:00
parent ea966952be
commit a159e852e6
5 changed files with 32 additions and 10 deletions

View file

@ -456,6 +456,7 @@ Parse_Server_Packet ()
switch (c) {
case svc_bad:
Net_LogPrintf (" - should not happen");
break;
case svc_nop:
Net_LogPrintf (" No operation");
break;

View file

@ -72,6 +72,8 @@ cvar_t *sv_timekick;
cvar_t *sv_timekick_fuzz;
cvar_t *sv_timekick_interval;
cvar_t *sv_kickfake;
extern cvar_t *sv_maxrate;
extern vec3_t player_mins;
@ -788,6 +790,7 @@ SV_Say (qboolean team)
char text[2048];
char t1[32];
const char *t2;
char *i;
if (Cmd_Argc () < 2)
return;
@ -842,6 +845,17 @@ SV_Say (qboolean team)
p[strlen (p) - 1] = 0;
}
for (i = p; *i; i++)
if (*i == 13) { // ^M
if (sv_kickfake->int_val) {
SV_BroadcastPrintf (PRINT_HIGH, "%s was kicked for attempting to fake messages\n", host_client->name);
SV_ClientPrintf (host_client, PRINT_HIGH, "You were kicked for attempting to fake messages\n");
SV_DropClient (host_client);
return;
} else
*i = '#';
}
strncat (text, p, sizeof (text) - strlen (text));
strncat (text, "\n", sizeof (text) - strlen (text));
@ -1814,5 +1828,7 @@ SV_UserInit (void)
"Toggles the ability of spectators to talk to players");
sv_mapcheck = Cvar_Get ("sv_mapcheck", "1", CVAR_NONE, NULL,
"Toggle the use of map checksumming to check for players who edit maps to cheat");
sv_kickfake = Cvar_Get ("sv_kickfake", "1", CVAR_NONE, NULL,
"Kick users sending to send fake talk messages");
}