str*cmp -> str*equal, where appropriate.

This commit is contained in:
Jeff Teunissen 2001-02-21 22:38:58 +00:00
parent 42ce5b1184
commit e4608744d2
6 changed files with 27 additions and 28 deletions

View file

@ -591,7 +591,7 @@ CL_FullServerinfo_f (void)
Con_Printf ("Invalid standards version: %s", p);
}
if ((p = Info_ValueForKey (cl.serverinfo, "skybox")) && *p) {
if (strcasecmp (p, "none") == 0) {
if (!strcaseequal (p, "none")) {
allowskybox = false;
} else {
allowskybox = true;
@ -689,7 +689,7 @@ CL_FullInfo_f (void)
if (*s)
s++;
if (!strcasecmp (key, pmodel_name) || !strcasecmp (key, emodel_name))
if (strcaseequal (key, pmodel_name) || strcaseequal (key, emodel_name))
continue;
Info_SetValueForKey (cls.userinfo, key, value, MAX_INFO_STRING);
@ -712,8 +712,9 @@ CL_SetInfo_f (void)
Con_Printf ("usage: setinfo [ <key> <value> ]\n");
return;
}
if (!strcasecmp (Cmd_Argv (1), pmodel_name)
|| !strcmp (Cmd_Argv (1), emodel_name)) return;
if (strcaseequal (Cmd_Argv (1), pmodel_name)
|| strcaseequal (Cmd_Argv (1), emodel_name))
return;
Info_SetValueForKey (cls.userinfo, Cmd_Argv (1), Cmd_Argv (2),
MAX_INFO_STRING);

View file

@ -617,9 +617,7 @@ CL_ParseServerData (void)
protover = MSG_ReadLong ();
if (protover != PROTOCOL_VERSION &&
!(cls.demoplayback
&& (protover == 26 || protover == 27
|| protover ==
28)))
&& (protover <= 26 && protover >= 28)))
Host_EndGame
("Server returned version %i, not %i\nYou probably need to upgrade.\nCheck http://www.quakeworld.net/",
protover, PROTOCOL_VERSION);
@ -629,7 +627,7 @@ CL_ParseServerData (void)
// game directory
str = MSG_ReadString ();
if (strcasecmp (gamedirfile, str)) {
if (!strequal (gamedirfile, str)) {
// save current config
Host_WriteConfiguration ();
cflag = true;

View file

@ -223,8 +223,8 @@ Info_SetValueForStarKey (char *s, char *key, char *value, size_t maxsize)
// only copy ascii values
s += strlen (s);
v = newstr;
is_name = strcasecmp (key, "name") == 0;
is_team = strcasecmp (key, "team") == 0;
is_name = strcaseequal (key, "name");
is_team = strcaseequal (key, "team");
while (*v) {
c = (unsigned char) *v++;
// client only allows highbits on name

View file

@ -328,7 +328,7 @@ SV_Map_f (void)
if (!f) {
Con_Printf ("Can't find %s\n", expanded);
// If curlevel == level, something is SCREWED! --KB
if (strcasecmp (level, curlevel) == 0)
if (strcaseequal (level, curlevel))
SV_Error ("map: cannot restart level\n");
else
Cbuf_AddText (va ("map %s", curlevel));

View file

@ -704,9 +704,9 @@ SVC_DirectConnect (void)
s = Info_ValueForKey (userinfo, "spectator");
if (s[0] && strcmp (s, "0")) {
if (spectator_password->string[0] &&
strcasecmp (spectator_password->string, "none") &&
strcmp (spectator_password->string, s)) { // failed
Con_Printf ("%s:spectator password failed\n",
!strcaseequal (spectator_password->string, "none") &&
!strequal (spectator_password->string, s)) { // failed
Con_Printf ("%s: spectator password failed\n",
NET_AdrToString (net_from));
Netchan_OutOfBandPrint (net_from,
"%c\nrequires a spectator password\n\n",
@ -718,8 +718,9 @@ SVC_DirectConnect (void)
spectator = true;
} else {
s = Info_ValueForKey (userinfo, "password");
if (password->string[0] &&
strcasecmp (password->string, "none") && strcmp (password->string, s)) {
if (password->string[0]
&& !strcaseequal (password->string, "none")
&& !strequal (password->string, s)) {
Con_Printf ("%s:password failed\n", NET_AdrToString (net_from));
Netchan_OutOfBandPrint (net_from,
"%c\nserver requires a password\n\n",
@ -1748,7 +1749,7 @@ SV_ExtractFromUserinfo (client_t *cl)
val = Info_ValueForKey (cl->userinfo, "name");
}
if (!val[0] || !strcasecmp (val, "console")) {
if (!val[0] || strcaseequal (val, "console")) {
Info_SetValueForKey (cl->userinfo, "name", "unnamed", MAX_INFO_STRING);
val = Info_ValueForKey (cl->userinfo, "name");
}
@ -1757,7 +1758,7 @@ SV_ExtractFromUserinfo (client_t *cl)
for (i = 0, client = svs.clients; i < MAX_CLIENTS; i++, client++) {
if (client->state != cs_spawned || client == cl)
continue;
if (!strcasecmp (client->name, val))
if (strcaseequal (client->name, val))
break;
}
if (i != MAX_CLIENTS) { // dup name

View file

@ -117,16 +117,15 @@ PR_Profile_f (void)
int
ED_Parse_Extra_Fields (progs_t *pr, char *key, char *value)
{
// If skyname is set, we want to allow skyboxes and set what
// the skybox name should be. "qlsky" is supported since
// at least one other map uses it already. --KB
if (strcasecmp (key, "sky") == 0 || // LordHavoc: added "sky" key
// (Quake2 and DarkPlaces use
// this)
strcasecmp (key, "skyname") == 0 ||
strcasecmp (key, "qlsky") == 0) {
Info_SetValueForKey (svs.info, "skybox",
"1", MAX_SERVERINFO_STRING);
/*
If skyname is set, we want to allow skyboxes and set what the skybox
name should be. "qlsky" is supported since at least one other map
uses it already.
*/
if (strcaseequal (key, "skyname") // QuakeForge
|| strcaseequal (key, "sky") // Q2/DarkPlaces
|| strcaseequal (key, "qlsky")) { // QuakeLives
Info_SetValueForKey (svs.info, "skybox", "1", MAX_SERVERINFO_STRING);
Cvar_Set (r_skyname, value);
return 1;
}