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

View file

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

View file

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

View file

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

View file

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

View file

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