mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-10 06:31:35 +00:00
Merge pull request #1 from Naievil/removed_registration
Remove registered version check
This commit is contained in:
commit
b15cebeade
2 changed files with 1 additions and 58 deletions
|
@ -29,15 +29,12 @@ static char *argvdummy = " ";
|
||||||
static char *safeargvs[NUM_SAFE_ARGVS] =
|
static char *safeargvs[NUM_SAFE_ARGVS] =
|
||||||
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"};
|
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"};
|
||||||
|
|
||||||
cvar_t registered = {"registered","0"};
|
|
||||||
cvar_t cmdline = {"cmdline","0", false, true};
|
cvar_t cmdline = {"cmdline","0", false, true};
|
||||||
|
|
||||||
qboolean com_modified; // set true if using non-id files
|
qboolean com_modified; // set true if using non-id files
|
||||||
|
|
||||||
qboolean proghack;
|
qboolean proghack;
|
||||||
|
|
||||||
int static_registered = 1; // only for startup check, then set
|
|
||||||
|
|
||||||
qboolean msg_suppress_1 = 0;
|
qboolean msg_suppress_1 = 0;
|
||||||
|
|
||||||
void COM_InitFilesystem (void);
|
void COM_InitFilesystem (void);
|
||||||
|
@ -1002,50 +999,6 @@ int COM_CheckParm (char *parm)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
COM_CheckRegistered
|
|
||||||
|
|
||||||
Looks for the pop.txt file and verifies it.
|
|
||||||
Sets the "registered" cvar.
|
|
||||||
Immediately exits out if an alternate game was attempted to be started without
|
|
||||||
being registered.
|
|
||||||
================
|
|
||||||
*/
|
|
||||||
void COM_CheckRegistered (void)
|
|
||||||
{
|
|
||||||
int h;
|
|
||||||
unsigned short check[128];
|
|
||||||
int i;
|
|
||||||
|
|
||||||
COM_OpenFile("gfx/pop.lmp", &h);
|
|
||||||
static_registered = 0;
|
|
||||||
|
|
||||||
if (h == -1)
|
|
||||||
{
|
|
||||||
#if WINDED
|
|
||||||
Sys_Error ("This dedicated server requires a full registered copy of Quake");
|
|
||||||
#endif
|
|
||||||
Con_Printf ("Playing shareware version.\n");
|
|
||||||
if (com_modified)
|
|
||||||
Sys_Error ("You must have the registered version to use modified games");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Sys_FileRead (h, check, sizeof(check));
|
|
||||||
COM_CloseFile (h);
|
|
||||||
|
|
||||||
for (i=0 ; i<128 ; i++)
|
|
||||||
if (pop[i] != (unsigned short)BigShort (check[i]))
|
|
||||||
Sys_Error ("Corrupted data file.");
|
|
||||||
|
|
||||||
Cvar_Set ("cmdline", com_cmdline);
|
|
||||||
Cvar_Set ("registered", "1");
|
|
||||||
static_registered = 1;
|
|
||||||
Con_Printf ("Playing registered version.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void COM_Path_f (void);
|
void COM_Path_f (void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1148,12 +1101,10 @@ void COM_Init (char *basedir)
|
||||||
LittleFloat = FloatSwap;
|
LittleFloat = FloatSwap;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cvar_RegisterVariable (®istered);
|
|
||||||
Cvar_RegisterVariable (&cmdline);
|
Cvar_RegisterVariable (&cmdline);
|
||||||
Cmd_AddCommand ("path", COM_Path_f);
|
Cmd_AddCommand ("path", COM_Path_f);
|
||||||
|
|
||||||
COM_InitFilesystem ();
|
COM_InitFilesystem ();
|
||||||
COM_CheckRegistered ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1414,13 +1365,7 @@ int COM_FindFile (char *filename, int *handle, FILE **file)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// check a file in the directory tree
|
// check a file in the directory tree
|
||||||
if (!static_registered)
|
|
||||||
{ // if not a registered version, don't ever go beyond base
|
|
||||||
if ( strchr (filename, '/') || strchr (filename,'\\'))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf (netpath, "%s/%s",search->filename, filename);
|
sprintf (netpath, "%s/%s",search->filename, filename);
|
||||||
|
|
||||||
findtime = Sys_FileTime (netpath);
|
findtime = Sys_FileTime (netpath);
|
||||||
|
|
|
@ -2738,8 +2738,6 @@ void M_NetStart_Change (int dir)
|
||||||
//PGM 03/02/97 added 1 for dmatch episode
|
//PGM 03/02/97 added 1 for dmatch episode
|
||||||
else if (rogue)
|
else if (rogue)
|
||||||
count = 4;
|
count = 4;
|
||||||
else if (registered.value)
|
|
||||||
count = 7;
|
|
||||||
else
|
else
|
||||||
count = 2;
|
count = 2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue