mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2025-01-19 07:00:58 +00:00
Version cleanup, not completely happy with it yet..
Removed the registered game checking, but added a little back for backword compatibility..
This commit is contained in:
parent
ceb0162eb0
commit
47e85cdd29
19 changed files with 113 additions and 256 deletions
|
@ -15,3 +15,11 @@
|
|||
/* Define this if you have GL_COLOR_INDEX8_EXT in GL/gl.h */
|
||||
#undef HAVE_GL_COLOR_INDEX8_EXT
|
||||
|
||||
#if defined(X11)
|
||||
# define OUTPUT_STR "X11"
|
||||
#elif defined(GGI)
|
||||
# define OUTPUT_STR "GGI"
|
||||
#else
|
||||
# define OUTPUT_STR "Unknown"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -620,28 +620,20 @@ Draw_ConsoleBackground
|
|||
*/
|
||||
void Draw_ConsoleBackground (int lines)
|
||||
{
|
||||
int i, x, y, v;
|
||||
int i, x, y, v;
|
||||
byte *src, *dest;
|
||||
unsigned short *pusdest;
|
||||
int f, fstep;
|
||||
unsigned short *pusdest;
|
||||
int f, fstep;
|
||||
qpic_t *conback;
|
||||
char ver[100];
|
||||
static char saveback[320*8];
|
||||
#ifdef QUAKEWORLD
|
||||
char ver[] = "QuakeForge (Software QW) " VERSION;
|
||||
#else
|
||||
char ver[] = "QuakeForge (Software UQ) " VERSION;
|
||||
#endif
|
||||
|
||||
conback = Draw_CachePic ("gfx/conback.lmp");
|
||||
|
||||
// hack the version number directly into the pic
|
||||
#ifdef _WIN32
|
||||
sprintf (ver, "QuakeForge (Win32) v%s", VERSION);
|
||||
#elif defined(X11)
|
||||
sprintf (ver, "QuakeForge (X11) v%s", VERSION);
|
||||
#elif defined(GGI)
|
||||
sprintf (ver, "QuakeForge (GGI) v%s", VERSION);
|
||||
#elif defined(__linux__)
|
||||
sprintf (ver, "QuakeForge (Linux) v%s", VERSION);
|
||||
#else
|
||||
sprintf (ver, "QuakeForge (Unknown) v%s", VERSION);
|
||||
#endif
|
||||
dest = conback->data + 320 - (strlen(ver)*8 + 11) + 320*186;
|
||||
|
||||
memcpy(saveback, conback->data + 320*186, 320*8);
|
||||
|
|
|
@ -390,13 +390,6 @@ void Draw_Init (void)
|
|||
Sys_Error ("Couldn't load gfx/conback.lmp");
|
||||
SwapPic (cb);
|
||||
|
||||
#ifdef SCALEVER
|
||||
sprintf (ver, VERSION);
|
||||
dest = cb->data + 320 + 320*186 - 11 - 8*strlen(ver);
|
||||
for (x=0 ; x<strlen(ver) ; x++)
|
||||
Draw_CharToConback (ver[x], dest+(x<<3));
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
conback->width = vid.conwidth;
|
||||
conback->height = vid.conheight;
|
||||
|
@ -758,7 +751,11 @@ Draw_ConsoleBackground
|
|||
*/
|
||||
void Draw_ConsoleBackground (int lines)
|
||||
{
|
||||
char ver[80];
|
||||
#ifdef QUAKEWORLD
|
||||
char ver[] = "QuakeForge (GL QW) " VERSION;
|
||||
#else
|
||||
char ver[] = "QuakeForge (GL UQ) " VERSION;
|
||||
#endif
|
||||
int x, i;
|
||||
int y;
|
||||
|
||||
|
@ -770,7 +767,6 @@ void Draw_ConsoleBackground (int lines)
|
|||
|
||||
// hack the version number directly into the pic
|
||||
y = lines-14;
|
||||
sprintf (ver, "QuakeForge (GL) " VERSION);
|
||||
x = vid.conwidth - (strlen(ver)*8 + 11);
|
||||
for (i=0 ; i<strlen(ver) ; i++)
|
||||
Draw_Character (x + i * 8, y, ver[i] | 0x80);
|
||||
|
|
49
common/register_check.c
Normal file
49
common/register_check.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
cvar_t registered = {"registered","0"};
|
||||
|
||||
/*
|
||||
================
|
||||
COM_CheckRegistered
|
||||
|
||||
Looks for the pop.txt file.
|
||||
Sets the "registered" cvar.
|
||||
================
|
||||
*/
|
||||
void register_check ()
|
||||
{
|
||||
FILE *h;
|
||||
|
||||
Cvar_RegisterVariable (®istered);
|
||||
|
||||
COM_FOpenFile("gfx/pop.lmp", &h);
|
||||
|
||||
if (!h) {
|
||||
Con_Printf ("Playing shareware version.\n");
|
||||
} else {
|
||||
Cvar_Set ("registered", "1");
|
||||
Con_Printf ("Playing registered version.\n");
|
||||
}
|
||||
|
||||
fclose (h);
|
||||
}
|
27
common/register_check.h
Normal file
27
common/register_check.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _REGISTER_CHECK_H
|
||||
#define _REGISTER_CHECK_H
|
||||
|
||||
extern struct cvar_s registered;
|
||||
void register_check ();
|
||||
|
||||
#endif // _REGISTER_CHECK_H
|
|
@ -145,7 +145,7 @@ UQ_NET_SRC = net_dgrm.c net_loop.c net_main.c net_vcr.c $(NET_SRC)
|
|||
#
|
||||
# Common source files
|
||||
#
|
||||
MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c
|
||||
MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c register_check.c wad.c zone.c
|
||||
|
||||
#
|
||||
# Rendering source files
|
||||
|
|
|
@ -1076,9 +1076,7 @@ void CL_Init (void)
|
|||
Info_SetValueForKey (cls.userinfo, "bottomcolor", "0", MAX_INFO_STRING);
|
||||
Info_SetValueForKey (cls.userinfo, "rate", "2500", MAX_INFO_STRING);
|
||||
Info_SetValueForKey (cls.userinfo, "msg", "1", MAX_INFO_STRING);
|
||||
//sprintf (st, "%4.2f-%04d", VERSION, build_number());
|
||||
sprintf (st, "%s", VERSION);
|
||||
Info_SetValueForStarKey (cls.userinfo, "*ver", st, MAX_INFO_STRING);
|
||||
Info_SetValueForStarKey(cls.userinfo, "*ver", VERSION, MAX_INFO_STRING);
|
||||
|
||||
CL_InitInput ();
|
||||
CL_InitTEnts ();
|
||||
|
@ -1515,7 +1513,7 @@ void Host_Init (quakeparms_t *parms)
|
|||
|
||||
host_initialized = true;
|
||||
|
||||
Con_Printf ("\nClient Version %s (Build %04d)\n\n", VERSION, build_number());
|
||||
Con_Printf ("\nClient Version %s\n\n", VERSION);
|
||||
|
||||
Con_Printf ("€<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> QuakeWorld Initialized <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‚\n");
|
||||
}
|
||||
|
|
|
@ -38,12 +38,8 @@ static char *argvdummy = " ";
|
|||
static char *safeargvs[NUM_SAFE_ARGVS] =
|
||||
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse"};
|
||||
|
||||
cvar_t registered = {"registered","0"};
|
||||
|
||||
qboolean com_modified; // set true if using non-id files
|
||||
|
||||
int static_registered = 1; // only for startup check, then set
|
||||
|
||||
qboolean msg_suppress_1 = 0;
|
||||
|
||||
void COM_InitFilesystem (void);
|
||||
|
@ -58,27 +54,6 @@ qboolean standard_quake = true, rogue, hipnotic;
|
|||
|
||||
char gamedirfile[MAX_OSPATH];
|
||||
|
||||
// this graphic needs to be in the pak file to use registered features
|
||||
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
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
@ -1096,50 +1071,6 @@ int COM_CheckParm (char *parm)
|
|||
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)
|
||||
{
|
||||
FILE *h;
|
||||
unsigned short check[128];
|
||||
int i;
|
||||
|
||||
COM_FOpenFile("gfx/pop.lmp", &h);
|
||||
static_registered = 0;
|
||||
|
||||
if (!h)
|
||||
{
|
||||
Con_Printf ("Playing shareware version.\n");
|
||||
#ifndef SERVERONLY
|
||||
// FIXME DEBUG -- only temporary
|
||||
if (com_modified)
|
||||
Sys_Error ("You must have the registered version to play QuakeWorld");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
fread (check, 1, sizeof(check), h);
|
||||
fclose (h);
|
||||
|
||||
for (i=0 ; i<128 ; i++)
|
||||
if (pop[i] != (unsigned short)BigShort (check[i]))
|
||||
Sys_Error ("Corrupted data file.");
|
||||
|
||||
Cvar_Set ("registered", "1");
|
||||
static_registered = 1;
|
||||
Con_Printf ("Playing registered version.\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
COM_InitArgv
|
||||
|
@ -1211,11 +1142,10 @@ void COM_Init (void)
|
|||
LittleFloat = FloatNoSwap;
|
||||
#endif
|
||||
|
||||
Cvar_RegisterVariable (®istered);
|
||||
Cmd_AddCommand ("path", COM_Path_f);
|
||||
|
||||
COM_InitFilesystem ();
|
||||
COM_CheckRegistered ();
|
||||
register_check ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1500,12 +1430,6 @@ int COM_FOpenFile (char *filename, FILE **file)
|
|||
else
|
||||
{
|
||||
// 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);
|
||||
|
||||
findtime = Sys_FileTime (netpath);
|
||||
|
@ -2245,45 +2169,3 @@ byte COM_BlockSequenceCRCByte (byte *base, int length, int sequence)
|
|||
|
||||
return crc;
|
||||
}
|
||||
|
||||
// char *date = "Oct 24 1996";
|
||||
static char *date = __DATE__ ;
|
||||
static char *mon[12] =
|
||||
{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||
static char mond[12] =
|
||||
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
// returns days since Oct 24 1996
|
||||
int build_number( void )
|
||||
{
|
||||
int m = 0;
|
||||
int d = 0;
|
||||
int y = 0;
|
||||
static int b = 0;
|
||||
|
||||
if (b != 0)
|
||||
return b;
|
||||
|
||||
for (m = 0; m < 11; m++)
|
||||
{
|
||||
if (Q_strncasecmp( &date[0], mon[m], 3 ) == 0)
|
||||
break;
|
||||
d += mond[m];
|
||||
}
|
||||
|
||||
d += atoi( &date[4] ) - 1;
|
||||
|
||||
y = atoi( &date[7] ) - 1900;
|
||||
|
||||
b = d + (int)((y - 1) * 365.25);
|
||||
|
||||
if (((y % 4) == 0) && m > 1)
|
||||
{
|
||||
b += 1;
|
||||
}
|
||||
|
||||
b -= 35778; // Dec 16 1998
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// comndef.h -- general definitions
|
||||
|
||||
#include <bothdefs.h>
|
||||
#include <register_check.h>
|
||||
|
||||
typedef unsigned char byte;
|
||||
#define _DEF_BYTE_
|
||||
|
@ -204,7 +205,6 @@ void COM_LoadCacheFile (char *path, struct cache_user_s *cu);
|
|||
void COM_CreatePath (char *path);
|
||||
void COM_Gamedir (char *dir);
|
||||
|
||||
extern struct cvar_s registered;
|
||||
extern qboolean standard_quake, rogue, hipnotic;
|
||||
|
||||
char *Info_ValueForKey (char *s, char *key);
|
||||
|
@ -218,5 +218,3 @@ unsigned Com_BlockChecksum (void *buffer, int length);
|
|||
void Com_BlockFullChecksum (void *buffer, int len, unsigned char *outbuf);
|
||||
byte COM_BlockSequenceCheckByte (byte *base, int length, int sequence, unsigned mapchecksum);
|
||||
byte COM_BlockSequenceCRCByte (byte *base, int length, int sequence);
|
||||
|
||||
int build_number( void );
|
||||
|
|
|
@ -44,7 +44,6 @@ if (Cvar_VariableValue ("r_draworder"))
|
|||
Interpreted prog code can access cvars with the cvar(name) or
|
||||
cvar_set (name, value) internal functions:
|
||||
teamplay = cvar("teamplay");
|
||||
cvar_set ("registered", "1");
|
||||
|
||||
The user can access cvars from the console in two ways:
|
||||
r_draworder prints the current value
|
||||
|
|
|
@ -74,7 +74,8 @@ targets = $(SRVQUAKE)
|
|||
|
||||
GENERAL_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c \
|
||||
$(QW_NET_SRC) net_chan.c $(SRV_SRC) $(QW_SRV_SRC) \
|
||||
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(QW_GENERAL_SRC)
|
||||
$(SRV_PR_SRC) $(QW_SRV_SYS_SRC) $(QW_GENERAL_SRC) \
|
||||
register_check.c
|
||||
ALL_QW_SRV_SRC = $(GENERAL_SRC) model.c
|
||||
# XXX - add dos/win specifc source
|
||||
|
||||
|
|
|
@ -1366,7 +1366,7 @@ void SV_InitLocal (void)
|
|||
for (i=0 ; i<MAX_MODELS ; i++)
|
||||
sprintf (localmodels[i], "*%i", i);
|
||||
|
||||
Info_SetValueForStarKey (svs.info, "*version", va("%s", VERSION), MAX_SERVERINFO_STRING);
|
||||
Info_SetValueForStarKey (svs.info, "*version", VERSION, MAX_SERVERINFO_STRING);
|
||||
|
||||
// init fraglog stuff
|
||||
svs.logsequence = 1;
|
||||
|
@ -1644,7 +1644,7 @@ void SV_Init (quakeparms_t *parms)
|
|||
Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
|
||||
Con_Printf ("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0));
|
||||
|
||||
Con_Printf ("\nServer Version %s (Build %04d)\n\n", VERSION, build_number());
|
||||
Con_Printf ("\nServer Version %s\n\n", VERSION);
|
||||
|
||||
Con_Printf ("======== QuakeWorld Initialized ========\n");
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ UQ_NET_SRC = net_dgrm.c net_loop.c net_main.c net_vcr.c $(NET_SRC)
|
|||
#
|
||||
# Common source files
|
||||
#
|
||||
MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c wad.c zone.c
|
||||
MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c register_check.c wad.c zone.c
|
||||
|
||||
#
|
||||
# Rendering source files
|
||||
|
|
|
@ -29,15 +29,12 @@ static char *argvdummy = " ";
|
|||
static char *safeargvs[NUM_SAFE_ARGVS] =
|
||||
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"};
|
||||
|
||||
cvar_t registered = {"registered","0"};
|
||||
cvar_t cmdline = {"cmdline","0", false, true};
|
||||
|
||||
qboolean com_modified; // set true if using non-id files
|
||||
|
||||
qboolean proghack;
|
||||
|
||||
int static_registered = 1; // only for startup check, then set
|
||||
|
||||
qboolean msg_suppress_1 = 0;
|
||||
|
||||
void COM_InitFilesystem (void);
|
||||
|
@ -55,27 +52,6 @@ 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[] =
|
||||
{
|
||||
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
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
@ -1000,50 +976,6 @@ int COM_CheckParm (char *parm)
|
|||
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);
|
||||
|
||||
|
||||
|
@ -1138,12 +1070,11 @@ void COM_Init (char *basedir)
|
|||
LittleFloat = FloatNoSwap;
|
||||
#endif
|
||||
|
||||
Cvar_RegisterVariable (®istered);
|
||||
Cvar_RegisterVariable (&cmdline);
|
||||
Cmd_AddCommand ("path", COM_Path_f);
|
||||
|
||||
COM_InitFilesystem ();
|
||||
COM_CheckRegistered ();
|
||||
register_check ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1405,12 +1336,6 @@ int COM_FindFile (char *filename, int *handle, FILE **file)
|
|||
else
|
||||
{
|
||||
// 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);
|
||||
|
||||
findtime = Sys_FileTime (netpath);
|
||||
|
|
|
@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
// comndef.h -- general definitions
|
||||
|
||||
#include <register_check.h>
|
||||
|
||||
#if !defined BYTE_DEFINED
|
||||
typedef unsigned char byte;
|
||||
#define BYTE_DEFINED 1
|
||||
|
@ -175,7 +177,4 @@ byte *COM_LoadTempFile (char *path);
|
|||
byte *COM_LoadHunkFile (char *path);
|
||||
void COM_LoadCacheFile (char *path, struct cache_user_s *cu);
|
||||
|
||||
|
||||
extern struct cvar_s registered;
|
||||
|
||||
extern qboolean standard_quake, rogue, hipnotic;
|
||||
|
|
|
@ -44,7 +44,6 @@ if (Cvar_VariableValue ("r_draworder"))
|
|||
Interpreted prog code can access cvars with the cvar(name) or
|
||||
cvar_set (name, value) internal functions:
|
||||
teamplay = cvar("teamplay");
|
||||
cvar_set ("registered", "1");
|
||||
|
||||
The user can access cvars from the console in two ways:
|
||||
r_draworder prints the current value
|
||||
|
|
|
@ -2741,10 +2741,8 @@ void M_NetStart_Change (int dir)
|
|||
//PGM 03/02/97 added 1 for dmatch episode
|
||||
else if (rogue)
|
||||
count = 4;
|
||||
else if (registered.value)
|
||||
count = 7;
|
||||
else
|
||||
count = 2;
|
||||
count = 7;
|
||||
|
||||
if (startepisode < 0)
|
||||
startepisode = count - 1;
|
||||
|
|
|
@ -571,10 +571,7 @@ void Sys_Quit (void)
|
|||
|
||||
|
||||
// load the sell screen before shuting everything down
|
||||
if (registered.value)
|
||||
d = COM_LoadHunkFile ("end2.bin");
|
||||
else
|
||||
d = COM_LoadHunkFile ("end1.bin");
|
||||
d = COM_LoadHunkFile ("end2.bin");
|
||||
if (d)
|
||||
memcpy (screen, d, sizeof(screen));
|
||||
|
||||
|
|
|
@ -102,21 +102,10 @@ void Sys_Printf (char *fmt, ...)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static char end1[] = "\x1b[?7h\x1b[40m\x1b[2J\x1b[0;1;41m\x1b[1;1H QUAKE: The Doomed Dimension \x1b[33mby \x1b[44mid\x1b[41m Software \x1b[2;1H ---------------------------------------------------------------------------- \x1b[3;1H CALL 1-800-IDGAMES TO ORDER OR FOR TECHNICAL SUPPORT \x1b[4;1H PRICE: $45.00 (PRICES MAY VARY OUTSIDE THE US.) \x1b[5;1H \x1b[6;1H \x1b[37mYes! You only have one fourth of this incredible epic. That is because most \x1b[7;1H of you have paid us nothing or at most, very little. You could steal the \x1b[8;1H game from a friend. But we both know you'll be punished by God if you do. \x1b[9;1H \x1b[33mWHY RISK ETERNAL DAMNATION? CALL 1-800-IDGAMES AND BUY NOW! \x1b[10;1H \x1b[37mRemember, we love you almost as much as He does. \x1b[11;1H \x1b[12;1H \x1b[33mProgramming: \x1b[37mJohn Carmack, Michael Abrash, John Cash \x1b[13;1H \x1b[33mDesign: \x1b[37mJohn Romero, Sandy Petersen, American McGee, Tim Willits \x1b[14;1H \x1b[33mArt: \x1b[37mAdrian Carmack, Kevin Cloud \x1b[15;1H \x1b[33mBiz: \x1b[37mJay Wilbur, Mike Wilson, Donna Jackson \x1b[16;1H \x1b[33mProjects: \x1b[37mShawn Green \x1b[33mSupport: \x1b[37mBarrett Alexander \x1b[17;1H \x1b[33mSound Effects: \x1b[37mTrent Reznor and Nine Inch Nails \x1b[18;1H For other information or details on ordering outside the US, check out the \x1b[19;1H files accompanying QUAKE or our website at http://www.idsoftware.com. \x1b[20;1H \x1b[0;41mQuake is a trademark of Id Software, inc., (c)1996 Id Software, inc. \x1b[21;1H All rights reserved. NIN logo is a registered trademark licensed to \x1b[22;1H Nothing Interactive, Inc. All rights reserved. \x1b[40m\x1b[23;1H\x1b[0m";
|
||||
static char end2[] = "\x1b[?7h\x1b[40m\x1b[2J\x1b[0;1;41m\x1b[1;1H QUAKE \x1b[33mby \x1b[44mid\x1b[41m Software \x1b[2;1H ----------------------------------------------------------------------------- \x1b[3;1H \x1b[37mWhy did you quit from the registered version of QUAKE? Did the \x1b[4;1H scary monsters frighten you? Or did Mr. Sandman tug at your \x1b[5;1H little lids? No matter! What is important is you love our \x1b[6;1H game, and gave us your money. Congratulations, you are probably \x1b[7;1H not a thief. \x1b[8;1H Thank You. \x1b[9;1H \x1b[33;44mid\x1b[41m Software is: \x1b[10;1H PROGRAMMING: \x1b[37mJohn Carmack, Michael Abrash, John Cash \x1b[11;1H \x1b[33mDESIGN: \x1b[37mJohn Romero, Sandy Petersen, American McGee, Tim Willits \x1b[12;1H \x1b[33mART: \x1b[37mAdrian Carmack, Kevin Cloud \x1b[13;1H \x1b[33mBIZ: \x1b[37mJay Wilbur, Mike Wilson \x1b[33mPROJECTS MAN: \x1b[37mShawn Green \x1b[14;1H \x1b[33mBIZ ASSIST: \x1b[37mDonna Jackson \x1b[33mSUPPORT: \x1b[37mBarrett Alexander \x1b[15;1H \x1b[33mSOUND EFFECTS AND MUSIC: \x1b[37mTrent Reznor and Nine Inch Nails \x1b[16;1H \x1b[17;1H If you need help running QUAKE refer to the text files in the \x1b[18;1H QUAKE directory, or our website at http://www.idsoftware.com. \x1b[19;1H If all else fails, call our technical support at 1-800-IDGAMES. \x1b[20;1H \x1b[0;41mQuake is a trademark of Id Software, inc., (c)1996 Id Software, inc. \x1b[21;1H All rights reserved. NIN logo is a registered trademark licensed \x1b[22;1H to Nothing Interactive, Inc. All rights reserved. \x1b[23;1H\x1b[40m\x1b[0m";
|
||||
#endif
|
||||
|
||||
void Sys_Quit (void)
|
||||
{
|
||||
Host_Shutdown();
|
||||
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
|
||||
#if 0
|
||||
if (registered.value)
|
||||
printf("%s", end2);
|
||||
else
|
||||
printf("%s", end1);
|
||||
#endif
|
||||
fflush(stdout);
|
||||
exit(0);
|
||||
}
|
||||
|
@ -383,7 +372,7 @@ int main (int c, char **v)
|
|||
nostdout = 1;
|
||||
else {
|
||||
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
|
||||
printf ("QuakeForge (Linux Quake) v%s\n", VERSION);
|
||||
printf ("QuakeForge (UQ) v%s\n", VERSION);
|
||||
}
|
||||
|
||||
oldtime = Sys_DoubleTime () - 0.1;
|
||||
|
|
Loading…
Reference in a new issue