Rename FS_SV_* to FS_BaseDir_*
This commit is contained in:
parent
cadc8ab017
commit
3b90b76d7f
|
|
@ -1342,7 +1342,7 @@ static void CL_UpdateGUID( const char *prefix, int prefix_len )
|
|||
fileHandle_t f;
|
||||
int len;
|
||||
|
||||
len = FS_SV_FOpenFileRead( QKEY_FILE, &f );
|
||||
len = FS_BaseDir_FOpenFileRead( QKEY_FILE, &f );
|
||||
FS_FCloseFile( f );
|
||||
|
||||
if( len != QKEY_SIZE )
|
||||
|
|
@ -2197,7 +2197,7 @@ static void CL_BeginHttpDownload( const char *remoteURL ) {
|
|||
CL_HTTP_BeginDownload(remoteURL);
|
||||
Q_strncpyz(clc.downloadURL, remoteURL, sizeof(clc.downloadURL));
|
||||
|
||||
clc.download = FS_SV_FOpenFileWrite(clc.downloadTempName);
|
||||
clc.download = FS_BaseDir_FOpenFileWrite(clc.downloadTempName);
|
||||
if(!clc.download) {
|
||||
Com_Error(ERR_DROP, "CL_BeginHTTPDownload: failed to open "
|
||||
"%s for writing", clc.downloadTempName);
|
||||
|
|
@ -2977,7 +2977,7 @@ void CL_Frame ( int msec ) {
|
|||
clc.download = 0;
|
||||
}
|
||||
|
||||
FS_SV_Rename(clc.downloadTempName, clc.downloadName, qfalse);
|
||||
FS_BaseDir_Rename(clc.downloadTempName, clc.downloadName, qfalse);
|
||||
clc.downloadRestart = qtrue;
|
||||
CL_NextDownload();
|
||||
}
|
||||
|
|
@ -3456,7 +3456,7 @@ static void CL_GenerateQKey(void)
|
|||
unsigned char buff[ QKEY_SIZE ];
|
||||
fileHandle_t f;
|
||||
|
||||
len = FS_SV_FOpenFileRead( QKEY_FILE, &f );
|
||||
len = FS_BaseDir_FOpenFileRead( QKEY_FILE, &f );
|
||||
FS_FCloseFile( f );
|
||||
if( len == QKEY_SIZE ) {
|
||||
Com_Printf( "QKEY found.\n" );
|
||||
|
|
@ -3471,7 +3471,7 @@ static void CL_GenerateQKey(void)
|
|||
Com_Printf( "QKEY building random string\n" );
|
||||
Com_RandomBytes( buff, sizeof(buff) );
|
||||
|
||||
f = FS_SV_FOpenFileWrite( QKEY_FILE );
|
||||
f = FS_BaseDir_FOpenFileWrite( QKEY_FILE );
|
||||
if( !f ) {
|
||||
Com_Printf( "QKEY could not open %s for write\n",
|
||||
QKEY_FILE );
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
|||
// open the file if not opened yet
|
||||
if (!clc.download)
|
||||
{
|
||||
clc.download = FS_SV_FOpenFileWrite( clc.downloadTempName );
|
||||
clc.download = FS_BaseDir_FOpenFileWrite( clc.downloadTempName );
|
||||
|
||||
if (!clc.download) {
|
||||
Com_Printf( "Could not create %s\n", clc.downloadTempName );
|
||||
|
|
@ -635,7 +635,7 @@ void CL_ParseDownload ( msg_t *msg ) {
|
|||
clc.download = 0;
|
||||
|
||||
// rename the file
|
||||
FS_SV_Rename ( clc.downloadTempName, clc.downloadName, qfalse );
|
||||
FS_BaseDir_Rename ( clc.downloadTempName, clc.downloadName, qfalse );
|
||||
}
|
||||
|
||||
// send intentions now
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ void LAN_LoadCachedServers( void ) {
|
|||
fileHandle_t fileIn;
|
||||
cls.numglobalservers = cls.numfavoriteservers = 0;
|
||||
cls.numGlobalServerAddresses = 0;
|
||||
if (FS_SV_FOpenFileRead("servercache.dat", &fileIn)) {
|
||||
if (FS_BaseDir_FOpenFileRead("servercache.dat", &fileIn)) {
|
||||
FS_Read(&cls.numglobalservers, sizeof(int), fileIn);
|
||||
FS_Read(&cls.numfavoriteservers, sizeof(int), fileIn);
|
||||
FS_Read(&size, sizeof(int), fileIn);
|
||||
|
|
@ -74,7 +74,7 @@ LAN_SaveServersToCache
|
|||
*/
|
||||
void LAN_SaveServersToCache( void ) {
|
||||
int size;
|
||||
fileHandle_t fileOut = FS_SV_FOpenFileWrite("servercache.dat");
|
||||
fileHandle_t fileOut = FS_BaseDir_FOpenFileWrite("servercache.dat");
|
||||
FS_Write(&cls.numglobalservers, sizeof(int), fileOut);
|
||||
FS_Write(&cls.numfavoriteservers, sizeof(int), fileOut);
|
||||
size = sizeof(cls.globalServers) + sizeof(cls.favoriteServers);
|
||||
|
|
|
|||
|
|
@ -2468,7 +2468,7 @@ void Com_ReadCDKey( const char *filename ) {
|
|||
|
||||
Com_sprintf(fbuffer, sizeof(fbuffer), "%s/q3key", filename);
|
||||
|
||||
FS_SV_FOpenFileRead( fbuffer, &f );
|
||||
FS_BaseDir_FOpenFileRead( fbuffer, &f );
|
||||
if ( !f ) {
|
||||
Com_Memset( cl_cdkey, '\0', 17 );
|
||||
return;
|
||||
|
|
@ -2498,7 +2498,7 @@ void Com_AppendCDKey( const char *filename ) {
|
|||
|
||||
Com_sprintf(fbuffer, sizeof(fbuffer), "%s/q3key", filename);
|
||||
|
||||
FS_SV_FOpenFileRead( fbuffer, &f );
|
||||
FS_BaseDir_FOpenFileRead( fbuffer, &f );
|
||||
if (!f) {
|
||||
Com_Memset( &cl_cdkey[16], '\0', 17 );
|
||||
return;
|
||||
|
|
@ -2543,7 +2543,7 @@ static void Com_WriteCDKey( const char *filename, const char *ikey ) {
|
|||
#ifndef _WIN32
|
||||
savedumask = umask(0077);
|
||||
#endif
|
||||
f = FS_SV_FOpenFileWrite( fbuffer );
|
||||
f = FS_BaseDir_FOpenFileWrite( fbuffer );
|
||||
if ( !f ) {
|
||||
Com_Printf ("Couldn't write CD key to %s.\n", fbuffer );
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -662,12 +662,12 @@ qboolean FS_FileExists(const char *file)
|
|||
|
||||
/*
|
||||
================
|
||||
FS_SV_FileExists
|
||||
FS_BaseDir_FileExists
|
||||
|
||||
Tests if the file exists
|
||||
================
|
||||
*/
|
||||
qboolean FS_SV_FileExists( const char *file )
|
||||
qboolean FS_BaseDir_FileExists( const char *file )
|
||||
{
|
||||
return FS_FileInPathExists(FS_BaseDir_BuildOSPath(fs_homepath->string, file));
|
||||
}
|
||||
|
|
@ -675,11 +675,11 @@ qboolean FS_SV_FileExists( const char *file )
|
|||
|
||||
/*
|
||||
===========
|
||||
FS_SV_FOpenFileWrite
|
||||
FS_BaseDir_FOpenFileWrite
|
||||
|
||||
===========
|
||||
*/
|
||||
fileHandle_t FS_SV_FOpenFileWrite( const char *filename ) {
|
||||
fileHandle_t FS_BaseDir_FOpenFileWrite( const char *filename ) {
|
||||
char *ospath;
|
||||
fileHandle_t f;
|
||||
|
||||
|
|
@ -693,7 +693,7 @@ fileHandle_t FS_SV_FOpenFileWrite( const char *filename ) {
|
|||
fsh[f].zipFile = qfalse;
|
||||
|
||||
if ( fs_debug->integer ) {
|
||||
Com_Printf( "FS_SV_FOpenFileWrite: %s\n", ospath );
|
||||
Com_Printf( "FS_BaseDir_FOpenFileWrite: %s\n", ospath );
|
||||
}
|
||||
|
||||
FS_CheckFilenameIsMutable( ospath, __func__ );
|
||||
|
|
@ -716,13 +716,13 @@ fileHandle_t FS_SV_FOpenFileWrite( const char *filename ) {
|
|||
|
||||
/*
|
||||
===========
|
||||
FS_SV_FOpenFileRead
|
||||
FS_BaseDir_FOpenFileRead
|
||||
|
||||
Search for a file somewhere below the home path then base path
|
||||
in that order
|
||||
===========
|
||||
*/
|
||||
long FS_SV_FOpenFileRead(const char *filename, fileHandle_t *fp)
|
||||
long FS_BaseDir_FOpenFileRead(const char *filename, fileHandle_t *fp)
|
||||
{
|
||||
char *ospath;
|
||||
fileHandle_t f = 0;
|
||||
|
|
@ -756,7 +756,7 @@ long FS_SV_FOpenFileRead(const char *filename, fileHandle_t *fp)
|
|||
|
||||
if ( fs_debug->integer )
|
||||
{
|
||||
Com_Printf( "FS_SV_FOpenFileRead (%s): %s\n", pathVar->name, ospath );
|
||||
Com_Printf( "FS_BaseDir_FOpenFileRead (%s): %s\n", pathVar->name, ospath );
|
||||
}
|
||||
|
||||
fsh[f].handleFiles.file.o = Sys_FOpen( ospath, "rb" );
|
||||
|
|
@ -779,11 +779,11 @@ long FS_SV_FOpenFileRead(const char *filename, fileHandle_t *fp)
|
|||
|
||||
/*
|
||||
===========
|
||||
FS_SV_Rename
|
||||
FS_BaseDir_Rename
|
||||
|
||||
===========
|
||||
*/
|
||||
void FS_SV_Rename( const char *from, const char *to, qboolean safe ) {
|
||||
void FS_BaseDir_Rename( const char *from, const char *to, qboolean safe ) {
|
||||
char *from_ospath, *to_ospath;
|
||||
|
||||
if ( !fs_searchpaths ) {
|
||||
|
|
@ -797,7 +797,7 @@ void FS_SV_Rename( const char *from, const char *to, qboolean safe ) {
|
|||
to_ospath = FS_BaseDir_BuildOSPath( fs_homepath->string, to );
|
||||
|
||||
if ( fs_debug->integer ) {
|
||||
Com_Printf( "FS_SV_Rename: %s --> %s\n", from_ospath, to_ospath );
|
||||
Com_Printf( "FS_BaseDir_Rename: %s --> %s\n", from_ospath, to_ospath );
|
||||
}
|
||||
|
||||
if ( safe ) {
|
||||
|
|
@ -2480,7 +2480,7 @@ void FS_GetModDescription( const char *modDir, char *description, int descriptio
|
|||
FILE *file;
|
||||
|
||||
Com_sprintf( descPath, sizeof ( descPath ), "%s%cdescription.txt", modDir, PATH_SEP );
|
||||
nDescLen = FS_SV_FOpenFileRead( descPath, &descHandle );
|
||||
nDescLen = FS_BaseDir_FOpenFileRead( descPath, &descHandle );
|
||||
|
||||
if ( nDescLen > 0 ) {
|
||||
file = FS_FileForHandle(descHandle);
|
||||
|
|
@ -3189,7 +3189,7 @@ qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) {
|
|||
// Local name
|
||||
Q_strcat( neededpaks, len, "@");
|
||||
// Do we have one with the same name?
|
||||
if ( FS_SV_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
|
||||
if ( FS_BaseDir_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
|
||||
{
|
||||
char st[MAX_ZPATH];
|
||||
// We already have one called this, we need to download it to another name
|
||||
|
|
@ -3216,7 +3216,7 @@ qboolean FS_ComparePaks( char *neededpaks, int len, qboolean dlstring ) {
|
|||
Q_strcat( neededpaks, len, fs_serverReferencedPakNames[i] );
|
||||
Q_strcat( neededpaks, len, ".pk3" );
|
||||
// Do we have one with the same name?
|
||||
if ( FS_SV_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
|
||||
if ( FS_BaseDir_FileExists( va( "%s.pk3", fs_serverReferencedPakNames[i] ) ) )
|
||||
{
|
||||
Q_strcat( neededpaks, len, " (local file exists with wrong checksum)");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ char *Com_MD5File( const char *fn, int length, const char *prefix, int prefix_le
|
|||
|
||||
Q_strncpyz( final, "", sizeof( final ) );
|
||||
|
||||
filelen = FS_SV_FOpenFileRead( fn, &f );
|
||||
filelen = FS_BaseDir_FOpenFileRead( fn, &f );
|
||||
|
||||
if( !f ) {
|
||||
return final;
|
||||
|
|
|
|||
|
|
@ -645,9 +645,9 @@ fileHandle_t FS_FOpenFileAppend( const char *filename );
|
|||
fileHandle_t FS_FCreateOpenPipeFile( const char *filename );
|
||||
// will properly create any needed paths and deal with seperater character issues
|
||||
|
||||
fileHandle_t FS_SV_FOpenFileWrite( const char *filename );
|
||||
long FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp );
|
||||
void FS_SV_Rename( const char *from, const char *to, qboolean safe );
|
||||
fileHandle_t FS_BaseDir_FOpenFileWrite( const char *filename );
|
||||
long FS_BaseDir_FOpenFileRead( const char *filename, fileHandle_t *fp );
|
||||
void FS_BaseDir_Rename( const char *from, const char *to, qboolean safe );
|
||||
long FS_FOpenFileRead( const char *qpath, fileHandle_t *file, qboolean uniqueFILE );
|
||||
// if uniqueFILE is true, then a new FILE will be fopened even if the file
|
||||
// is found in an already open pak file. If uniqueFILE is false, you must call
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ static void SV_RehashBans_f(void)
|
|||
|
||||
Com_sprintf(filepath, sizeof(filepath), "%s/%s", FS_GetCurrentGameDir(), sv_banFile->string);
|
||||
|
||||
if((filelen = FS_SV_FOpenFileRead(filepath, &readfrom)) >= 0)
|
||||
if((filelen = FS_BaseDir_FOpenFileRead(filepath, &readfrom)) >= 0)
|
||||
{
|
||||
if(filelen < 2)
|
||||
{
|
||||
|
|
@ -730,7 +730,7 @@ static void SV_WriteBans(void)
|
|||
|
||||
Com_sprintf(filepath, sizeof(filepath), "%s/%s", FS_GetCurrentGameDir(), sv_banFile->string);
|
||||
|
||||
if((writeto = FS_SV_FOpenFileWrite(filepath)))
|
||||
if((writeto = FS_BaseDir_FOpenFileWrite(filepath)))
|
||||
{
|
||||
char writebuf[128];
|
||||
serverBan_t *curban;
|
||||
|
|
|
|||
|
|
@ -998,7 +998,7 @@ int SV_WriteDownloadToClient(client_t *cl, msg_t *msg)
|
|||
if ( !(sv_allowDownload->integer & DLF_ENABLE) ||
|
||||
(sv_allowDownload->integer & DLF_NO_UDP) ||
|
||||
idPack || unreferenced ||
|
||||
( cl->downloadSize = FS_SV_FOpenFileRead( cl->downloadName, &cl->download ) ) < 0 ) {
|
||||
( cl->downloadSize = FS_BaseDir_FOpenFileRead( cl->downloadName, &cl->download ) ) < 0 ) {
|
||||
// cannot auto-download file
|
||||
if(unreferenced)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user