forward port the client info string filtering from 0.3 and remove info.h from

a couple of c files that no longer need it.
This commit is contained in:
Bill Currie 2001-09-11 03:10:29 +00:00
parent 8c026417d8
commit 74e9f89e8c
8 changed files with 63 additions and 18 deletions

View file

@ -44,6 +44,24 @@
#include "compat.h"
/*
Info_FilterForKey
Searches for key in the "client-needed" info string list
*/
qboolean
Info_FilterForKey (const char *key, const char **filter_list)
{
const char **s;
for (s = filter_list; *s; s++) {
if (strequal (*s, key)) {
return true;
}
}
return false;
}
/*
Info_ValueForKey
@ -138,7 +156,7 @@ Info_RemoveKey (char *s, const char *key)
}
void
Info_RemovePrefixedKeys (char *start, char prefix)
Info_RemovePrefixedKeys (char *start, char prefix, const char **filter_list)
{
char *s;
char pkey[512];
@ -167,7 +185,8 @@ Info_RemovePrefixedKeys (char *start, char prefix)
}
*o = 0;
if (pkey[0] == prefix) {
if (pkey[0] == prefix
|| (filter_list && !Info_FilterForKey (pkey, filter_list))) {
Info_RemoveKey (start, pkey);
s = start;
}