Cleaned up some precompiler conditions.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1553 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-11-03 23:40:51 +00:00
parent c916e40299
commit 118d71793d
5 changed files with 24 additions and 5 deletions

View file

@ -5114,12 +5114,14 @@ void PF_infokey (progfuncs_t *prinst, struct globalvars_s *pr_globals)
// value = ""; // value = "";
else if (!strcmp(key, "trustlevel")) //info for progs. else if (!strcmp(key, "trustlevel")) //info for progs.
{ {
#ifdef SVRANKING
rankstats_t rs; rankstats_t rs;
if (!svs.clients[e1-1].rankid) if (!svs.clients[e1-1].rankid)
value = ""; value = "";
else if (Rank_GetPlayerStats(svs.clients[e1-1].rankid, &rs)) else if (Rank_GetPlayerStats(svs.clients[e1-1].rankid, &rs))
sprintf(ov, "%d", rs.trustlevel); sprintf(ov, "%d", rs.trustlevel);
else else
#endif
value = ""; value = "";
} }
else else
@ -7443,7 +7445,7 @@ void PF_plaque_draw(progfuncs_t *prinst, struct globalvars_s *pr_globals)
MSG_WriteByte (QWWriteDest(G_FLOAT(OFS_PARM0)), 'P'); MSG_WriteByte (QWWriteDest(G_FLOAT(OFS_PARM0)), 'P');
} }
MSG_WriteString (QWWriteDest(G_FLOAT(OFS_PARM0)), s); MSG_WriteString (QWWriteDest(G_FLOAT(OFS_PARM0)), s);
#ifdef NQPROT
MSG_WriteByte (NQWriteDest(G_FLOAT(OFS_PARM0)), svc_centerprint); MSG_WriteByte (NQWriteDest(G_FLOAT(OFS_PARM0)), svc_centerprint);
if (*s) if (*s)
{ {
@ -7451,6 +7453,7 @@ void PF_plaque_draw(progfuncs_t *prinst, struct globalvars_s *pr_globals)
MSG_WriteByte (NQWriteDest(G_FLOAT(OFS_PARM0)), 'P'); MSG_WriteByte (NQWriteDest(G_FLOAT(OFS_PARM0)), 'P');
} }
MSG_WriteString (NQWriteDest(G_FLOAT(OFS_PARM0)), s); MSG_WriteString (NQWriteDest(G_FLOAT(OFS_PARM0)), s);
#endif
} }
} }

View file

@ -209,7 +209,7 @@ void SV_Logfile_f (void)
Con_Printf(va("Logging to %s/%s/%s.log.\n", com_basedir, d, f)); Con_Printf(va("Logging to %s/%s/%s.log.\n", com_basedir, d, f));
Cvar_SetValue(&log_enable, 1); Cvar_SetValue(&log_enable, 1);
} }
} }
/* /*
@ -659,8 +659,9 @@ void SV_BanName_f (void)
{ {
client_t *cl; client_t *cl;
int clnum=-1; int clnum=-1;
#ifdef SVRANKING
rankstats_t rs; rankstats_t rs;
#endif
while((cl = SV_GetClientForString(Cmd_Argv(1), &clnum))) while((cl = SV_GetClientForString(Cmd_Argv(1), &clnum)))
@ -669,6 +670,7 @@ void SV_BanName_f (void)
// print directly, because the dropped client won't get the // print directly, because the dropped client won't get the
// SV_BroadcastPrintf message // SV_BroadcastPrintf message
SV_ClientTPrintf (cl, PRINT_HIGH, STL_YOUWEREBANNED); SV_ClientTPrintf (cl, PRINT_HIGH, STL_YOUWEREBANNED);
#ifdef SVRANKING
if (cl->rankid) if (cl->rankid)
{ {
if (Rank_GetPlayerStats(cl->rankid, &rs)) if (Rank_GetPlayerStats(cl->rankid, &rs))
@ -679,6 +681,7 @@ void SV_BanName_f (void)
} }
else else
Con_Printf("User is not using an account\n"); Con_Printf("User is not using an account\n");
#endif
SV_DropClient (cl); SV_DropClient (cl);
} }
@ -1196,7 +1199,7 @@ void SV_Serverinfo_f (void)
else else
Info_RemoveKey(svs.info, k); //we can remove this one though, so yay. Info_RemoveKey(svs.info, k); //we can remove this one though, so yay.
} }
return; return;
} }
Con_TPrintf (TL_STARKEYPROTECTED); Con_TPrintf (TL_STARKEYPROTECTED);

View file

@ -526,7 +526,9 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
#ifndef SERVERONLY #ifndef SERVERONLY
Wads_Flush(); //server code is responsable for flushing old state Wads_Flush(); //server code is responsable for flushing old state
#endif #endif
#ifdef SVRANKING
Rank_Flush(); Rank_Flush();
#endif
for (i = 0; i < MAX_CLIENTS; i++) for (i = 0; i < MAX_CLIENTS; i++)
{ {

View file

@ -460,8 +460,10 @@ void SV_DropClient (client_t *drop)
drop->istobeloaded = false; drop->istobeloaded = false;
drop->old_frags = 0; drop->old_frags = 0;
#ifdef SVRANKING
drop->kills = 0; drop->kills = 0;
drop->deaths = 0; drop->deaths = 0;
#endif
if (svprogfuncs && drop->edict) if (svprogfuncs && drop->edict)
drop->edict->v->frags = 0; drop->edict->v->frags = 0;
drop->name[0] = 0; drop->name[0] = 0;
@ -1935,6 +1937,7 @@ void SVC_RemoteCommand (void)
if (!Rcon_Validate ()) if (!Rcon_Validate ())
{ {
#ifdef SVRANKING
if (cmd_allowaccess.value) //try and find a username, match the numeric password if (cmd_allowaccess.value) //try and find a username, match the numeric password
{ {
int rid; int rid;
@ -1989,6 +1992,7 @@ void SVC_RemoteCommand (void)
} }
} }
} }
#endif
Con_Printf ("Bad rcon from %s:\n%s\n" Con_Printf ("Bad rcon from %s:\n%s\n"
, NET_AdrToString (net_from), net_message.data+4); , NET_AdrToString (net_from), net_message.data+4);
@ -3360,6 +3364,7 @@ void SV_FixupName(char *in, char *out)
qboolean ReloadRanking(client_t *cl, char *newname) qboolean ReloadRanking(client_t *cl, char *newname)
{ {
#ifdef SVRANKING
int newid; int newid;
int j; int j;
rankstats_t rs; rankstats_t rs;
@ -3412,6 +3417,7 @@ qboolean ReloadRanking(client_t *cl, char *newname)
cl->trustlevel = rs.trustlevel; cl->trustlevel = rs.trustlevel;
return true; return true;
} }
#endif
return false; return false;
} }
/* /*

View file

@ -2860,10 +2860,12 @@ void Cmd_Observe_f (void)
void SV_EnableClientsCSQC(void) void SV_EnableClientsCSQC(void)
{ {
#ifdef PEXT_CSQC
if (host_client->fteprotocolextensions & PEXT_CSQC) if (host_client->fteprotocolextensions & PEXT_CSQC)
host_client->csqcactive = true; host_client->csqcactive = true;
else else
Con_DPrintf("CSQC enabled without protocol extensions\n"); Con_DPrintf("CSQC enabled without protocol extensions\n");
#endif
} }
void SV_MVDList_f (void); void SV_MVDList_f (void);
@ -3002,9 +3004,11 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC)
u = ucmdsq2; u = ucmdsq2;
else else
#endif #endif
#ifdef NQPROT
if (ISNQCLIENT(host_client)) if (ISNQCLIENT(host_client))
u = nqucmds; u = nqucmds;
else else
#endif
u=ucmds; u=ucmds;
for ( ; u->name ; u++) for ( ; u->name ; u++)
@ -3031,7 +3035,7 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC)
host_client = oldhost; host_client = oldhost;
return; return;
} }
#ifdef SVRANKING
if (sv_cmdlikercon.value && host_client->rankid) if (sv_cmdlikercon.value && host_client->rankid)
{ {
char remaining[1024]; char remaining[1024];
@ -3071,6 +3075,7 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC)
SV_EndRedirect (); SV_EndRedirect ();
return; return;
} }
#endif
Con_Printf ("Bad user command: %s\n", Cmd_Argv(0)); Con_Printf ("Bad user command: %s\n", Cmd_Argv(0));
} }