TrinityCore
TCascStorage Struct Reference

#include <CascCommon.h>

Public Member Functions

 TCascStorage ()
 
 ~TCascStorage ()
 
TCascStorageAddRef ()
 
TCascStorageRelease ()
 

Static Public Member Functions

static TCascStorageIsValid (HANDLE hStorage)
 

Public Attributes

ULONGLONG ClassName
 
PCASC_OPEN_STORAGE_ARGS pArgs
 
CASC_LOCK StorageLock
 
LPCTSTR szIndexFormat
 
LPTSTR szCodeName
 
LPTSTR szRootPath
 
LPTSTR szDataPath
 
LPTSTR szIndexPath
 
LPTSTR szBuildFile
 
LPTSTR szCdnServers
 
LPTSTR szCdnPath
 
LPSTR szRegion
 
LPSTR szBuildKey
 
DWORD dwDefaultLocale
 
DWORD dwBuildNumber
 
DWORD dwRefCount
 
DWORD dwFeatures
 
CBLD_TYPE BuildFileType
 
QUERY_KEY CdnConfigKey
 
QUERY_KEY CdnBuildKey
 
QUERY_KEY ArchiveGroup
 
QUERY_KEY ArchivesKey
 
QUERY_KEY PatchArchivesKey
 
QUERY_KEY PatchArchivesGroup
 
QUERY_KEY BuildFiles
 
TFileStreamDataFiles [CASC_MAX_DATA_FILES]
 
CASC_INDEX IndexFiles [CASC_INDEX_COUNT]
 
CASC_MAP IndexEKeyMap
 
CASC_CKEY_ENTRY EncodingCKey
 
CASC_CKEY_ENTRY DownloadCKey
 
CASC_CKEY_ENTRY InstallCKey
 
CASC_CKEY_ENTRY PatchFile
 
CASC_CKEY_ENTRY RootFile
 
CASC_CKEY_ENTRY SizeFile
 
CASC_CKEY_ENTRY VfsRoot
 
CASC_ARRAY VfsRootList
 
TRootHandlerpRootHandler
 
CASC_ARRAY IndexArray
 
CASC_ARRAY CKeyArray
 
CASC_ARRAY TagsArray
 
CASC_MAP IndexMap
 
CASC_MAP CKeyMap
 
CASC_MAP EKeyMap
 
size_t LocalFiles
 
size_t TotalFiles
 
size_t EKeyEntries
 
size_t EKeyLength
 
DWORD FileOffsetBits
 
CASC_KEY_MAP KeyMap
 
ULONGLONG LastFailKeyName
 

Constructor & Destructor Documentation

◆ TCascStorage()

TCascStorage::TCascStorage ( )
58 {
59  // Prepare the base storage parameters
61  pRootHandler = NULL;
62  dwRefCount = 1;
63 
65  szIndexFormat = NULL;
66  szRegion = NULL;
67  szBuildKey = NULL;
68 
69  memset(DataFiles, 0, sizeof(DataFiles));
70  memset(IndexFiles, 0, sizeof(IndexFiles));
72  dwDefaultLocale = 0;
73  dwBuildNumber = 0;
74  dwFeatures = 0;
76 
77  LastFailKeyName = 0;
79  pArgs = NULL;
80 }
DWORD FileOffsetBits
Definition: CascCommon.h:331
size_t EKeyEntries
Definition: CascCommon.h:329
#define CASC_MAGIC_STORAGE
Definition: CascCommon.h:58
CASC_INDEX IndexFiles[CASC_INDEX_COUNT]
Definition: CascCommon.h:308
DWORD dwRefCount
Definition: CascCommon.h:293
LPTSTR szCdnPath
Definition: CascCommon.h:288
DWORD dwDefaultLocale
Definition: CascCommon.h:291
LPTSTR szCdnServers
Definition: CascCommon.h:287
LPSTR szRegion
Definition: CascCommon.h:289
LPTSTR szIndexPath
Definition: CascCommon.h:285
CBLD_TYPE BuildFileType
Definition: CascCommon.h:296
ULONGLONG LastFailKeyName
Definition: CascCommon.h:334
LPCTSTR szIndexFormat
Definition: CascCommon.h:281
LPSTR szBuildKey
Definition: CascCommon.h:290
TRootHandler * pRootHandler
Definition: CascCommon.h:320
ULONGLONG ClassName
Definition: CascCommon.h:275
PCASC_OPEN_STORAGE_ARGS pArgs
Definition: CascCommon.h:278
DWORD dwBuildNumber
Definition: CascCommon.h:292
DWORD dwFeatures
Definition: CascCommon.h:294
LPTSTR szCodeName
Definition: CascCommon.h:282
Definition: CascCommon.h:70
CASC_LOCK StorageLock
Definition: CascCommon.h:279
LPTSTR szDataPath
Definition: CascCommon.h:284
LPTSTR szBuildFile
Definition: CascCommon.h:286
size_t TotalFiles
Definition: CascCommon.h:328
size_t LocalFiles
Definition: CascCommon.h:327
LPTSTR szRootPath
Definition: CascCommon.h:283
#define CascInitLock(Lock)
Definition: CascPort.h:357
TFileStream * DataFiles[CASC_MAX_DATA_FILES]
Definition: CascCommon.h:307
size_t EKeyLength
Definition: CascCommon.h:330
+ Here is the caller graph for this function:

◆ ~TCascStorage()

TCascStorage::~TCascStorage ( )
83 {
84  // Free the root handler
85  if(pRootHandler != NULL)
86  delete pRootHandler;
87  pRootHandler = NULL;
88 
89  // Close all data files
90  for(size_t i = 0; i < CASC_MAX_DATA_FILES; i++)
91  {
93  DataFiles[i] = NULL;
94  }
95 
96  // Cleanup space occupied by index files
97  FreeIndexFiles(this);
98 
99  // Cleanup the lock
101 
102  // Free the file paths
112 
113  // Free the blobs
116 
122  ClassName = 0;
123 }
LPTSTR szCdnPath
Definition: CascCommon.h:288
QUERY_KEY CdnBuildKey
Definition: CascCommon.h:299
LPTSTR szCdnServers
Definition: CascCommon.h:287
QUERY_KEY BuildFiles
Definition: CascCommon.h:305
LPSTR szRegion
Definition: CascCommon.h:289
LPTSTR szIndexPath
Definition: CascCommon.h:285
QUERY_KEY PatchArchivesKey
Definition: CascCommon.h:303
QUERY_KEY ArchivesKey
Definition: CascCommon.h:302
LPSTR szBuildKey
Definition: CascCommon.h:290
TRootHandler * pRootHandler
Definition: CascCommon.h:320
ULONGLONG ClassName
Definition: CascCommon.h:275
QUERY_KEY PatchArchivesGroup
Definition: CascCommon.h:304
void FreeIndexFiles(TCascStorage *hs)
Definition: CascIndexFiles.cpp:878
void FreeCascBlob(PQUERY_KEY pBlob)
Definition: CascCommon.h:437
QUERY_KEY CdnConfigKey
Definition: CascCommon.h:298
void FileStream_Close(TFileStream *pStream)
Definition: FileStream.cpp:2725
LPTSTR szCodeName
Definition: CascCommon.h:282
CASC_LOCK StorageLock
Definition: CascCommon.h:279
LPTSTR szDataPath
Definition: CascCommon.h:284
LPTSTR szBuildFile
Definition: CascCommon.h:286
QUERY_KEY ArchiveGroup
Definition: CascCommon.h:301
#define CascFreeLock(Lock)
Definition: CascPort.h:358
LPTSTR szRootPath
Definition: CascCommon.h:283
TFileStream * DataFiles[CASC_MAX_DATA_FILES]
Definition: CascCommon.h:307
void CASC_FREE(T *&ptr)
Definition: Common.h:162
#define CASC_MAX_DATA_FILES
Definition: CascStructs.h:20
+ Here is the call graph for this function:

Member Function Documentation

◆ AddRef()

TCascStorage * TCascStorage::AddRef ( )
126 {
127  // Need this to be atomic to make multi-threaded file opens work
129  return this;
130 }
DWORD dwRefCount
Definition: CascCommon.h:293
DWORD CascInterlockedIncrement(DWORD *PtrValue)
Definition: CascPort.h:320
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsValid()

static TCascStorage* TCascStorage::IsValid ( HANDLE  hStorage)
inlinestatic
266  {
267  TCascStorage * hs = (TCascStorage *)hStorage;
268 
269  return (hs != INVALID_HANDLE_VALUE &&
270  hs != NULL &&
271  hs->ClassName == CASC_MAGIC_STORAGE) ? hs : NULL;
272  }
#define CASC_MAGIC_STORAGE
Definition: CascCommon.h:58
Definition: CascCommon.h:257
ULONGLONG ClassName
Definition: CascCommon.h:275
#define INVALID_HANDLE_VALUE
Definition: CascPort.h:194
+ Here is the caller graph for this function:

◆ Release()

TCascStorage * TCascStorage::Release ( )
133 {
134  // If the reference count reached zero, we close the archive
135  // Need this to be atomic to make multi-threaded file opens work
137  {
138  // Release all references in the socket cache
140  sockets_set_caching(false);
141 
142  // Delete the object and return NULL
143  delete this;
144  return NULL;
145  }
146 
147  return this;
148 }
DWORD dwRefCount
Definition: CascCommon.h:293
DWORD CascInterlockedDecrement(DWORD *PtrValue)
Definition: CascPort.h:332
#define CASC_FEATURE_ONLINE
Definition: CascLib.h:142
void sockets_set_caching(bool caching)
Definition: Sockets.cpp:438
DWORD dwFeatures
Definition: CascCommon.h:294
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ ArchiveGroup

QUERY_KEY TCascStorage::ArchiveGroup

◆ ArchivesKey

QUERY_KEY TCascStorage::ArchivesKey

◆ BuildFiles

QUERY_KEY TCascStorage::BuildFiles

◆ BuildFileType

CBLD_TYPE TCascStorage::BuildFileType

◆ CdnBuildKey

QUERY_KEY TCascStorage::CdnBuildKey

◆ CdnConfigKey

QUERY_KEY TCascStorage::CdnConfigKey

◆ CKeyArray

CASC_ARRAY TCascStorage::CKeyArray

◆ CKeyMap

CASC_MAP TCascStorage::CKeyMap

◆ ClassName

ULONGLONG TCascStorage::ClassName

◆ DataFiles

TFileStream* TCascStorage::DataFiles[CASC_MAX_DATA_FILES]

◆ DownloadCKey

CASC_CKEY_ENTRY TCascStorage::DownloadCKey

◆ dwBuildNumber

DWORD TCascStorage::dwBuildNumber

◆ dwDefaultLocale

DWORD TCascStorage::dwDefaultLocale

◆ dwFeatures

DWORD TCascStorage::dwFeatures

◆ dwRefCount

DWORD TCascStorage::dwRefCount

◆ EKeyEntries

size_t TCascStorage::EKeyEntries

◆ EKeyLength

size_t TCascStorage::EKeyLength

◆ EKeyMap

CASC_MAP TCascStorage::EKeyMap

◆ EncodingCKey

CASC_CKEY_ENTRY TCascStorage::EncodingCKey

◆ FileOffsetBits

DWORD TCascStorage::FileOffsetBits

◆ IndexArray

CASC_ARRAY TCascStorage::IndexArray

◆ IndexEKeyMap

CASC_MAP TCascStorage::IndexEKeyMap

◆ IndexFiles

CASC_INDEX TCascStorage::IndexFiles[CASC_INDEX_COUNT]

◆ IndexMap

CASC_MAP TCascStorage::IndexMap

◆ InstallCKey

CASC_CKEY_ENTRY TCascStorage::InstallCKey

◆ KeyMap

CASC_KEY_MAP TCascStorage::KeyMap

◆ LastFailKeyName

ULONGLONG TCascStorage::LastFailKeyName

◆ LocalFiles

size_t TCascStorage::LocalFiles

◆ pArgs

PCASC_OPEN_STORAGE_ARGS TCascStorage::pArgs

◆ PatchArchivesGroup

QUERY_KEY TCascStorage::PatchArchivesGroup

◆ PatchArchivesKey

QUERY_KEY TCascStorage::PatchArchivesKey

◆ PatchFile

CASC_CKEY_ENTRY TCascStorage::PatchFile

◆ pRootHandler

TRootHandler* TCascStorage::pRootHandler

◆ RootFile

CASC_CKEY_ENTRY TCascStorage::RootFile

◆ SizeFile

CASC_CKEY_ENTRY TCascStorage::SizeFile

◆ StorageLock

CASC_LOCK TCascStorage::StorageLock

◆ szBuildFile

LPTSTR TCascStorage::szBuildFile

◆ szBuildKey

LPSTR TCascStorage::szBuildKey

◆ szCdnPath

LPTSTR TCascStorage::szCdnPath

◆ szCdnServers

LPTSTR TCascStorage::szCdnServers

◆ szCodeName

LPTSTR TCascStorage::szCodeName

◆ szDataPath

LPTSTR TCascStorage::szDataPath

◆ szIndexFormat

LPCTSTR TCascStorage::szIndexFormat

◆ szIndexPath

LPTSTR TCascStorage::szIndexPath

◆ szRegion

LPSTR TCascStorage::szRegion

◆ szRootPath

LPTSTR TCascStorage::szRootPath

◆ TagsArray

CASC_ARRAY TCascStorage::TagsArray

◆ TotalFiles

size_t TCascStorage::TotalFiles

◆ VfsRoot

CASC_CKEY_ENTRY TCascStorage::VfsRoot

◆ VfsRootList

CASC_ARRAY TCascStorage::VfsRootList

The documentation for this struct was generated from the following files: