mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
dropped CVAR_SERVERINFO flag from the cmdline cvar: sending cmdline upon
CCREQ_RULE_INFO is evil... while I was there, did some whitespace clean-up in common.c. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@568 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
e2a17c9bcf
commit
338da9a4c8
1 changed files with 164 additions and 165 deletions
|
@ -29,7 +29,7 @@ static char argvdummy[] = " ";
|
|||
int safemode;
|
||||
|
||||
cvar_t registered = {"registered","0",CVAR_ROM};
|
||||
cvar_t cmdline = {"cmdline","",CVAR_ROM|CVAR_SERVERINFO}; /* sending cmdline upon CCREQ_RULE_INFO is evil... */
|
||||
cvar_t cmdline = {"cmdline","",CVAR_ROM/*|CVAR_SERVERINFO*/}; /* sending cmdline upon CCREQ_RULE_INFO is evil */
|
||||
|
||||
qboolean com_modified; // set true if using non-id files
|
||||
|
||||
|
@ -47,35 +47,34 @@ char com_token[1024];
|
|||
int com_argc;
|
||||
char **com_argv;
|
||||
|
||||
#define CMDLINE_LENGTH 256 //johnfitz -- mirrored in cmd.c
|
||||
#define CMDLINE_LENGTH 256 /* johnfitz -- mirrored in cmd.c */
|
||||
char com_cmdline[CMDLINE_LENGTH];
|
||||
|
||||
qboolean standard_quake = true, rogue, hipnotic;
|
||||
|
||||
// this graphic needs to be in the pak file to use registered features
|
||||
unsigned short pop[] =
|
||||
static unsigned short pop[] =
|
||||
{
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
|
||||
,0x0000,0x0000,0x6600,0x0000,0x0000,0x0000,0x6600,0x0000
|
||||
,0x0000,0x0066,0x0000,0x0000,0x0000,0x0000,0x0067,0x0000
|
||||
,0x0000,0x6665,0x0000,0x0000,0x0000,0x0000,0x0065,0x6600
|
||||
,0x0063,0x6561,0x0000,0x0000,0x0000,0x0000,0x0061,0x6563
|
||||
,0x0064,0x6561,0x0000,0x0000,0x0000,0x0000,0x0061,0x6564
|
||||
,0x0064,0x6564,0x0000,0x6469,0x6969,0x6400,0x0064,0x6564
|
||||
,0x0063,0x6568,0x6200,0x0064,0x6864,0x0000,0x6268,0x6563
|
||||
,0x0000,0x6567,0x6963,0x0064,0x6764,0x0063,0x6967,0x6500
|
||||
,0x0000,0x6266,0x6769,0x6a68,0x6768,0x6a69,0x6766,0x6200
|
||||
,0x0000,0x0062,0x6566,0x6666,0x6666,0x6666,0x6562,0x0000
|
||||
,0x0000,0x0000,0x0062,0x6364,0x6664,0x6362,0x0000,0x0000
|
||||
,0x0000,0x0000,0x0000,0x0062,0x6662,0x0000,0x0000,0x0000
|
||||
,0x0000,0x0000,0x0000,0x0061,0x6661,0x0000,0x0000,0x0000
|
||||
,0x0000,0x0000,0x0000,0x0000,0x6500,0x0000,0x0000,0x0000
|
||||
,0x0000,0x0000,0x0000,0x0000,0x6400,0x0000,0x0000,0x0000
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x6600,0x0000,0x0000,0x0000,0x6600,0x0000,
|
||||
0x0000,0x0066,0x0000,0x0000,0x0000,0x0000,0x0067,0x0000,
|
||||
0x0000,0x6665,0x0000,0x0000,0x0000,0x0000,0x0065,0x6600,
|
||||
0x0063,0x6561,0x0000,0x0000,0x0000,0x0000,0x0061,0x6563,
|
||||
0x0064,0x6561,0x0000,0x0000,0x0000,0x0000,0x0061,0x6564,
|
||||
0x0064,0x6564,0x0000,0x6469,0x6969,0x6400,0x0064,0x6564,
|
||||
0x0063,0x6568,0x6200,0x0064,0x6864,0x0000,0x6268,0x6563,
|
||||
0x0000,0x6567,0x6963,0x0064,0x6764,0x0063,0x6967,0x6500,
|
||||
0x0000,0x6266,0x6769,0x6a68,0x6768,0x6a69,0x6766,0x6200,
|
||||
0x0000,0x0062,0x6566,0x6666,0x6666,0x6666,0x6562,0x0000,
|
||||
0x0000,0x0000,0x0062,0x6364,0x6664,0x6362,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0062,0x6662,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0061,0x6661,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x6500,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x6400,0x0000,0x0000,0x0000
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
|
||||
All of Quake's data access is through a hierchal file system, but the contents
|
||||
of the file system can be transparently merged from several sources.
|
||||
|
||||
|
@ -180,11 +179,11 @@ void Q_memset (void *dest, int fill, size_t count)
|
|||
{
|
||||
count >>= 2;
|
||||
fill = fill | (fill<<8) | (fill<<16) | (fill<<24);
|
||||
for (i=0 ; i<count ; i++)
|
||||
for (i = 0; i < count; i++)
|
||||
((int *)dest)[i] = fill;
|
||||
}
|
||||
else
|
||||
for (i=0 ; i<count ; i++)
|
||||
for (i = 0; i < count; i++)
|
||||
((byte *)dest)[i] = fill;
|
||||
}
|
||||
|
||||
|
@ -194,12 +193,12 @@ void Q_memcpy (void *dest, const void *src, size_t count)
|
|||
|
||||
if (( ( (size_t)dest | (size_t)src | count) & 3) == 0 )
|
||||
{
|
||||
count>>=2;
|
||||
for (i=0 ; i<count ; i++)
|
||||
count >>= 2;
|
||||
for (i = 0; i < count; i++)
|
||||
((int *)dest)[i] = ((int *)src)[i];
|
||||
}
|
||||
else
|
||||
for (i=0 ; i<count ; i++)
|
||||
for (i = 0; i < count; i++)
|
||||
((byte *)dest)[i] = ((byte *)src)[i];
|
||||
}
|
||||
|
||||
|
@ -249,7 +248,10 @@ char *Q_strrchr(const char *s, char c)
|
|||
int len = Q_strlen(s);
|
||||
s += len;
|
||||
while (len--)
|
||||
if (*--s == c) return (char *)s;
|
||||
{
|
||||
if (*--s == c)
|
||||
return (char *)s;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -480,7 +482,7 @@ float (*LittleFloat) (float l);
|
|||
|
||||
short ShortSwap (short l)
|
||||
{
|
||||
byte b1,b2;
|
||||
byte b1, b2;
|
||||
|
||||
b1 = l&255;
|
||||
b2 = (l>>8)&255;
|
||||
|
@ -495,7 +497,7 @@ short ShortNoSwap (short l)
|
|||
|
||||
int LongSwap (int l)
|
||||
{
|
||||
byte b1,b2,b3,b4;
|
||||
byte b1, b2, b3, b4;
|
||||
|
||||
b1 = l&255;
|
||||
b2 = (l>>8)&255;
|
||||
|
@ -604,7 +606,6 @@ void MSG_WriteFloat (sizebuf_t *sb, float f)
|
|||
int l;
|
||||
} dat;
|
||||
|
||||
|
||||
dat.f = f;
|
||||
dat.l = LittleLong (dat.l);
|
||||
|
||||
|
@ -761,7 +762,7 @@ float MSG_ReadFloat (void)
|
|||
const char *MSG_ReadString (void)
|
||||
{
|
||||
static char string[2048];
|
||||
int l,c;
|
||||
int l, c;
|
||||
|
||||
l = 0;
|
||||
do
|
||||
|
@ -814,7 +815,6 @@ float MSG_ReadAngle16 (void)
|
|||
//johnfitz
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void SZ_Alloc (sizebuf_t *buf, int startsize)
|
||||
|
@ -872,7 +872,7 @@ void SZ_Print (sizebuf_t *buf, const char *data)
|
|||
{
|
||||
int len;
|
||||
|
||||
len = Q_strlen(data)+1;
|
||||
len = Q_strlen(data) + 1;
|
||||
|
||||
// byte * cast to keep VC++ happy
|
||||
if (buf->data[buf->cursize-1])
|
||||
|
@ -1104,9 +1104,9 @@ skipwhite:
|
|||
len++;
|
||||
c = *data;
|
||||
/* commented out the check for ':' so that ip:port works */
|
||||
if (c=='{' || c=='}'|| c==')'|| c=='(' || c=='\'' /* || c==':' */)
|
||||
if (c == '{' || c == '}'|| c == ')'|| c == '(' || c == '\'' /* || c == ':' */)
|
||||
break;
|
||||
} while (c>32);
|
||||
} while (c > 32);
|
||||
|
||||
com_token[len] = 0;
|
||||
return data;
|
||||
|
@ -1125,7 +1125,7 @@ int COM_CheckParm (const char *parm)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i=1 ; i<com_argc ; i++)
|
||||
for (i = 1; i < com_argc; i++)
|
||||
{
|
||||
if (!com_argv[i])
|
||||
continue; // NEXTSTEP sometimes clears appkit vars.
|
||||
|
@ -1168,7 +1168,7 @@ void COM_CheckRegistered (void)
|
|||
Sys_FileRead (h, check, sizeof(check));
|
||||
COM_CloseFile (h);
|
||||
|
||||
for (i=0 ; i<128 ; i++)
|
||||
for (i = 0; i < 128; i++)
|
||||
if (pop[i] != (unsigned short)BigShort (check[i]))
|
||||
Sys_Error ("Corrupted data file.");
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ void COM_InitArgv (int argc, char **argv)
|
|||
// reconstitute the command line for the cmdline externally visible cvar
|
||||
n = 0;
|
||||
|
||||
for (j=0 ; (j<MAX_NUM_ARGVS) && (j< argc) ; j++)
|
||||
for (j = 0; (j<MAX_NUM_ARGVS) && (j< argc); j++)
|
||||
{
|
||||
i = 0;
|
||||
|
||||
|
@ -1213,7 +1213,7 @@ void COM_InitArgv (int argc, char **argv)
|
|||
|
||||
Con_Printf("Command line: %s\n", com_cmdline);
|
||||
|
||||
for (com_argc=0 ; (com_argc<MAX_NUM_ARGVS) && (com_argc < argc) ; com_argc++)
|
||||
for (com_argc = 0; (com_argc < MAX_NUM_ARGVS) && (com_argc < argc); com_argc++)
|
||||
{
|
||||
largv[com_argc] = argv[com_argc];
|
||||
if (!Q_strcmp ("-safe", argv[com_argc]))
|
||||
|
@ -1348,7 +1348,7 @@ int memsearch (byte *start, int count, int search)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<count ; i++)
|
||||
for (i = 0; i < count; i++)
|
||||
if (start[i] == search)
|
||||
return i;
|
||||
return -1;
|
||||
|
@ -1427,7 +1427,7 @@ void COM_Path_f (void)
|
|||
searchpath_t *s;
|
||||
|
||||
Con_Printf ("Current search path:\n");
|
||||
for (s=com_searchpaths ; s ; s=s->next)
|
||||
for (s = com_searchpaths; s; s = s->next)
|
||||
{
|
||||
if (s->pack)
|
||||
{
|
||||
|
@ -1475,7 +1475,7 @@ void COM_CreatePath (char *path)
|
|||
{
|
||||
char *ofs;
|
||||
|
||||
for (ofs = path+1 ; *ofs ; ofs++)
|
||||
for (ofs = path + 1; *ofs; ofs++)
|
||||
{
|
||||
if (*ofs == '/')
|
||||
{ // create the directory
|
||||
|
@ -1519,8 +1519,7 @@ static int COM_FindFile (const char *filename, int *handle, FILE **file,
|
|||
searchpath_t *search;
|
||||
char netpath[MAX_OSPATH];
|
||||
pack_t *pak;
|
||||
int i;
|
||||
int findtime;
|
||||
int i, findtime;
|
||||
|
||||
if (file && handle)
|
||||
Sys_Error ("COM_FindFile: both handle and file set");
|
||||
|
@ -1535,7 +1534,7 @@ static int COM_FindFile (const char *filename, int *handle, FILE **file,
|
|||
if (search->pack) /* look through all the pak file elements */
|
||||
{
|
||||
pak = search->pack;
|
||||
for (i=0 ; i<pak->numfiles ; i++)
|
||||
for (i = 0; i < pak->numfiles; i++)
|
||||
{
|
||||
if (strcmp(pak->files[i].name, filename) != 0)
|
||||
continue;
|
||||
|
@ -1660,7 +1659,7 @@ void COM_CloseFile (int h)
|
|||
{
|
||||
searchpath_t *s;
|
||||
|
||||
for (s = com_searchpaths ; s ; s=s->next)
|
||||
for (s = com_searchpaths; s; s = s->next)
|
||||
if (s->pack && s->pack->handle == h)
|
||||
return;
|
||||
|
||||
|
@ -1829,13 +1828,13 @@ pack_t *COM_LoadPackFile (const char *packfile)
|
|||
|
||||
// crc the directory to check for modifications
|
||||
CRC_Init (&crc);
|
||||
for (i = 0; i < header.dirlen ; i++)
|
||||
for (i = 0; i < header.dirlen; i++)
|
||||
CRC_ProcessByte (&crc, ((byte *)info)[i]);
|
||||
if (crc != PAK0_CRC)
|
||||
com_modified = true;
|
||||
|
||||
// parse the directory
|
||||
for (i = 0; i < numpackfiles ; i++)
|
||||
for (i = 0; i < numpackfiles; i++)
|
||||
{
|
||||
q_strlcpy (newfiles[i].name, info[i].name, sizeof(newfiles[i].name));
|
||||
newfiles[i].filepos = LittleLong(info[i].filepos);
|
||||
|
|
Loading…
Reference in a new issue