chore: add .clang_format for consistent code formatting
This commit is contained in:
@@ -5,280 +5,284 @@
|
||||
C4JStorage StorageManager;
|
||||
XMARKETPLACE_CONTENTOFFER_INFO InternalContentOfferInfo;
|
||||
|
||||
C4JStorage::C4JStorage()
|
||||
{
|
||||
|
||||
}
|
||||
C4JStorage::C4JStorage() {}
|
||||
|
||||
void C4JStorage::Tick(void)
|
||||
{
|
||||
InternalStorageManager.Tick();
|
||||
InternalStorageManager.Tick();
|
||||
}
|
||||
|
||||
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad,
|
||||
int(*Func)(LPVOID, int, const C4JStorage::EMessageResult), LPVOID lpParam, C4JStringTable* pStringTable, WCHAR* pwchFormatString, DWORD dwFocusButton)
|
||||
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA, UINT uiOptionC, DWORD dwPad,
|
||||
int (*Func)(LPVOID, int, const C4JStorage::EMessageResult), LPVOID lpParam,
|
||||
C4JStringTable *pStringTable, WCHAR *pwchFormatString, DWORD dwFocusButton)
|
||||
{
|
||||
return EMessage_Undefined;
|
||||
return EMessage_Undefined;
|
||||
}
|
||||
|
||||
C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult()
|
||||
{
|
||||
return EMessage_Undefined;
|
||||
return EMessage_Undefined;
|
||||
}
|
||||
|
||||
bool C4JStorage::SetSaveDevice(int(*Func)(LPVOID, const bool), LPVOID lpParam, bool bForceResetOfSaveDevice)
|
||||
bool C4JStorage::SetSaveDevice(int (*Func)(LPVOID, const bool), LPVOID lpParam, bool bForceResetOfSaveDevice)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void C4JStorage::Init(unsigned int uiSaveVersion, LPCWSTR pwchDefaultSaveName, char* pszSavePackName, int iMinimumSaveSize, int(*Func)(LPVOID, const ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID)
|
||||
void C4JStorage::Init(unsigned int uiSaveVersion, LPCWSTR pwchDefaultSaveName, char *pszSavePackName, int iMinimumSaveSize,
|
||||
int (*Func)(LPVOID, const ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID)
|
||||
{
|
||||
InternalStorageManager.Init(Func, lpParam, szGroupID);
|
||||
InternalStorageManager.Init(Func, lpParam, szGroupID);
|
||||
}
|
||||
|
||||
void C4JStorage::ResetSaveData()
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.ResetSaveData();
|
||||
InternalStorageManager.m_SaveGame.ResetSaveData();
|
||||
}
|
||||
|
||||
void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveTitle(LPCWSTR pwchDefaultSaveName)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveTitle(pwchDefaultSaveName);
|
||||
InternalStorageManager.m_SaveGame.SetSaveTitle(pwchDefaultSaveName);
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveUniqueNumber(INT* piVal)
|
||||
bool C4JStorage::GetSaveUniqueNumber(INT *piVal)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveUniqueNumber(piVal);
|
||||
return InternalStorageManager.m_SaveGame.GetSaveUniqueNumber(piVal);
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveUniqueFilename(char* pszName)
|
||||
bool C4JStorage::GetSaveUniqueFilename(char *pszName)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveUniqueFilename(pszName);
|
||||
return InternalStorageManager.m_SaveGame.GetSaveUniqueFilename(pszName);
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveUniqueFilename(char* szFilename)
|
||||
void C4JStorage::SetSaveUniqueFilename(char *szFilename)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveUniqueFilename(szFilename);
|
||||
InternalStorageManager.m_SaveGame.SetSaveUniqueFilename(szFilename);
|
||||
}
|
||||
|
||||
void C4JStorage::SetState(ESaveGameControlState eControlState, int(*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
void C4JStorage::SetState(ESaveGameControlState eControlState, int (*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveDisabled(bool bDisable)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveDisabled(bDisable);
|
||||
InternalStorageManager.m_SaveGame.SetSaveDisabled(bDisable);
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveDisabled(void)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveDisabled();
|
||||
return InternalStorageManager.m_SaveGame.GetSaveDisabled();
|
||||
}
|
||||
|
||||
unsigned int C4JStorage::GetSaveSize()
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveSize();
|
||||
return InternalStorageManager.m_SaveGame.GetSaveSize();
|
||||
}
|
||||
|
||||
void C4JStorage::GetSaveData(void* pvData, unsigned int* puiBytes)
|
||||
void C4JStorage::GetSaveData(void *pvData, unsigned int *puiBytes)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.GetSaveData(pvData, puiBytes);
|
||||
InternalStorageManager.m_SaveGame.GetSaveData(pvData, puiBytes);
|
||||
}
|
||||
|
||||
PVOID C4JStorage::AllocateSaveData(unsigned int uiBytes)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.AllocateSaveData(uiBytes);
|
||||
return InternalStorageManager.m_SaveGame.AllocateSaveData(uiBytes);
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE pbImage, DWORD dwImageBytes, PBYTE pbTextData, DWORD dwTextDataBytes)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveImages(pbThumbnail, dwThumbnailBytes, pbImage, dwImageBytes, pbTextData, dwTextDataBytes);
|
||||
InternalStorageManager.m_SaveGame.SetSaveImages(pbThumbnail, dwThumbnailBytes, pbImage, dwImageBytes, pbTextData, dwTextDataBytes);
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::SaveSaveData(int(*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState C4JStorage::SaveSaveData(int (*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.SaveSaveData(Func, lpParam);
|
||||
return InternalStorageManager.m_SaveGame.SaveSaveData(Func, lpParam);
|
||||
}
|
||||
|
||||
void C4JStorage::CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail, WCHAR* wchNewName, int (*Func)(LPVOID lpParam, bool), LPVOID lpParam)
|
||||
void C4JStorage::CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail, WCHAR *wchNewName, int (*Func)(LPVOID lpParam, bool), LPVOID lpParam)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad, bool bSelected)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::DoesSaveExist(bool* pbExists)
|
||||
C4JStorage::ESaveGameState C4JStorage::DoesSaveExist(bool *pbExists)
|
||||
{
|
||||
*pbExists = true;
|
||||
return ESaveGame_Idle;
|
||||
*pbExists = true;
|
||||
return ESaveGame_Idle;
|
||||
}
|
||||
|
||||
bool C4JStorage::EnoughSpaceForAMinSaveGame()
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveMessageVPosition(float fY)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS* pSaveDetails, const bool), LPVOID lpParam, char* pszSavePackName)
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, const bool), LPVOID lpParam,
|
||||
char *pszSavePackName)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSavesInfo(iPad, Func, lpParam, pszSavePackName);
|
||||
return InternalStorageManager.m_SaveGame.GetSavesInfo(iPad, Func, lpParam, pszSavePackName);
|
||||
}
|
||||
|
||||
PSAVE_DETAILS C4JStorage::ReturnSavesInfo()
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.ReturnSavesInfo();
|
||||
return InternalStorageManager.m_SaveGame.ReturnSavesInfo();
|
||||
}
|
||||
|
||||
void C4JStorage::ClearSavesInfo()
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.ClearSavesInfo();
|
||||
InternalStorageManager.m_SaveGame.ClearSavesInfo();
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.LoadSaveDataThumbnail(pSaveInfo, Func, lpParam);
|
||||
return InternalStorageManager.m_SaveGame.LoadSaveDataThumbnail(pSaveInfo, Func, lpParam);
|
||||
}
|
||||
|
||||
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, XCONTENT_DATA& xContentData)
|
||||
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, XCONTENT_DATA &xContentData)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE* ppbImageData, DWORD* pdwImageBytes)
|
||||
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.LoadSaveData(pSaveInfo, Func, lpParam);
|
||||
return InternalStorageManager.m_SaveGame.LoadSaveData(pSaveInfo, Func, lpParam);
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, const bool), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.DeleteSaveData(pSaveInfo, Func, lpParam);
|
||||
return InternalStorageManager.m_SaveGame.DeleteSaveData(pSaveInfo, Func, lpParam);
|
||||
}
|
||||
|
||||
void C4JStorage::RegisterMarketplaceCountsCallback(int (*Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS*, int), LPVOID lpParam)
|
||||
void C4JStorage::RegisterMarketplaceCountsCallback(int (*Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::SetDLCPackageRoot(char* pszDLCRoot)
|
||||
void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot)
|
||||
{
|
||||
InternalStorageManager.m_DLC.SetPackageRoot(pszDLCRoot);
|
||||
InternalStorageManager.m_DLC.SetPackageRoot(pszDLCRoot);
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad, int(*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask)
|
||||
C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad, int (*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask)
|
||||
{
|
||||
return EDLC_Idle;
|
||||
return EDLC_Idle;
|
||||
}
|
||||
|
||||
DWORD C4JStorage::CancelGetDLCOffers()
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void C4JStorage::ClearDLCOffers()
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(DWORD dw)
|
||||
XMARKETPLACE_CONTENTOFFER_INFO &C4JStorage::GetOffer(DWORD dw)
|
||||
{
|
||||
return InternalContentOfferInfo;
|
||||
return InternalContentOfferInfo;
|
||||
}
|
||||
|
||||
int C4JStorage::GetOfferCount()
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD C4JStorage::InstallOffer(int iOfferIDC, __uint64* ullOfferIDA, int(*Func)(LPVOID, int, int), LPVOID lpParam, bool bTrial)
|
||||
DWORD C4JStorage::InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA, int (*Func)(LPVOID, int, int), LPVOID lpParam, bool bTrial)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD C4JStorage::GetAvailableDLCCount(int iPad)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetAvailableDLCCount(iPad);
|
||||
return InternalStorageManager.m_DLC.GetAvailableDLCCount(iPad);
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad, int(*Func)(LPVOID, int, int), LPVOID lpParam)
|
||||
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetInstalledDLC(iPad, Func, lpParam);
|
||||
return InternalStorageManager.m_DLC.GetInstalledDLC(iPad, Func, lpParam);
|
||||
}
|
||||
|
||||
XCONTENT_DATA& C4JStorage::GetDLC(DWORD dw)
|
||||
XCONTENT_DATA &C4JStorage::GetDLC(DWORD dw)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetDLC(dw);
|
||||
return InternalStorageManager.m_DLC.GetDLC(dw);
|
||||
}
|
||||
|
||||
DWORD C4JStorage::MountInstalledDLC(int iPad, DWORD dwDLC, int(*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||
DWORD C4JStorage::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.MountInstalledDLC(iPad, dwDLC, Func, lpParam, szMountDrive);
|
||||
return InternalStorageManager.m_DLC.MountInstalledDLC(iPad, dwDLC, Func, lpParam, szMountDrive);
|
||||
}
|
||||
|
||||
DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.UnmountInstalledDLC(szMountDrive);
|
||||
return InternalStorageManager.m_DLC.UnmountInstalledDLC(szMountDrive);
|
||||
}
|
||||
|
||||
void C4JStorage::GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList)
|
||||
void C4JStorage::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList)
|
||||
{
|
||||
InternalStorageManager.m_DLC.GetMountedDLCFileList(szMountDrive, fileList);
|
||||
InternalStorageManager.m_DLC.GetMountedDLCFileList(szMountDrive, fileList);
|
||||
}
|
||||
|
||||
std::string C4JStorage::GetMountedPath(std::string szMount)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetMountedPath(szMount);
|
||||
return InternalStorageManager.m_DLC.GetMountedPath(szMount);
|
||||
}
|
||||
|
||||
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType,
|
||||
WCHAR* pwchFilename, BYTE** ppBuffer, DWORD* pdwBufferSize, int(*Func)(LPVOID, WCHAR*, int, bool, int), LPVOID lpParam, int iAction)
|
||||
WCHAR *pwchFilename, BYTE **ppBuffer, DWORD *pdwBufferSize,
|
||||
int (*Func)(LPVOID, WCHAR *, int, bool, int), LPVOID lpParam, int iAction)
|
||||
{
|
||||
return ETMSStatus_Idle;
|
||||
return ETMSStatus_Idle;
|
||||
}
|
||||
|
||||
bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR* pwchFilename, BYTE* pBuffer, DWORD dwBufferSize)
|
||||
bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR *pwchFilename, BYTE *pBuffer, DWORD dwBufferSize)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool C4JStorage::DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR* pwchFilename)
|
||||
bool C4JStorage::DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR *pwchFilename)
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void C4JStorage::StoreTMSPathName(WCHAR* pwchName)
|
||||
void C4JStorage::StoreTMSPathName(WCHAR *pwchName)
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad, C4JStorage::eGlobalStorage eStorageFacility, C4JStorage::eTMS_FILETYPEVAL eFileTypeVal, LPCSTR szFilename, int(*Func)(LPVOID, int, int, PTMSPP_FILEDATA, LPCSTR), LPVOID lpParam, int iUserData)
|
||||
C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad, C4JStorage::eGlobalStorage eStorageFacility, C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,
|
||||
LPCSTR szFilename, int (*Func)(LPVOID, int, int, PTMSPP_FILEDATA, LPCSTR), LPVOID lpParam,
|
||||
int iUserData)
|
||||
{
|
||||
return ETMSStatus_Idle;
|
||||
return ETMSStatus_Idle;
|
||||
}
|
||||
|
||||
unsigned int C4JStorage::CRC(unsigned char* buf, int len)
|
||||
unsigned int C4JStorage::CRC(unsigned char *buf, int len)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,33 +2,33 @@
|
||||
#include "STO_DLC.h"
|
||||
#include "STO_Main.h"
|
||||
|
||||
XCONTENT_DATA& CDLC::GetDLC(DWORD dw)
|
||||
XCONTENT_DATA &CDLC::GetDLC(DWORD dw)
|
||||
{
|
||||
return m_vInstalledDLCs[dw];
|
||||
return m_vInstalledDLCs[dw];
|
||||
}
|
||||
|
||||
CDLC::CDLC(void) : m_vInstalledDLCs(), m_szMountPath(), m_vDLCDriveMappings()
|
||||
{
|
||||
m_iHasNewInstalledDLCs = false;
|
||||
dword0 = 0;
|
||||
dwordC0 = 0;
|
||||
m_iHasNewMountedDLCs = false; // @Patoke fix
|
||||
m_iHasNewInstalledDLCs = false;
|
||||
dword0 = 0;
|
||||
dwordC0 = 0;
|
||||
m_iHasNewMountedDLCs = false; // @Patoke fix
|
||||
|
||||
ZeroMemory(m_szDLCProductCode, sizeof(m_szDLCProductCode));
|
||||
ZeroMemory(m_szProductUpgradeKey, sizeof(m_szProductUpgradeKey));
|
||||
ZeroMemory(m_szDLCProductCode, sizeof(m_szDLCProductCode));
|
||||
ZeroMemory(m_szProductUpgradeKey, sizeof(m_szProductUpgradeKey));
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus CDLC::GetOffers(int iPad, int(*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask)
|
||||
C4JStorage::EDLCStatus CDLC::GetOffers(int iPad, int (*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask)
|
||||
{
|
||||
return C4JStorage::EDLC_NoOffers;
|
||||
return C4JStorage::EDLC_NoOffers;
|
||||
}
|
||||
|
||||
void CDLC::ClearOffers()
|
||||
{
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int(*Func)(LPVOID, int, int), LPVOID lpParam)
|
||||
C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam)
|
||||
{
|
||||
if (m_iHasNewInstalledDLCs)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int(*Func)(LPVOID, int, i
|
||||
|
||||
m_pInstalledDLCFunc = Func;
|
||||
m_pInstalledDLCParam = lpParam;
|
||||
m_iHasNewInstalledDLCs = true;
|
||||
m_iHasNewInstalledDLCs = true;
|
||||
|
||||
bool ret = false;
|
||||
DWORD atts = GetFileAttributesA("Windows64Media/DLC");
|
||||
@@ -54,196 +54,195 @@ C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int(*Func)(LPVOID, int, i
|
||||
return C4JStorage::EDLC_Error;
|
||||
}
|
||||
|
||||
_WIN32_FIND_DATAA hFind;
|
||||
HANDLE hFindFile;
|
||||
if (ret)
|
||||
{
|
||||
hFindFile = FindFirstFileA("Windows64/DLC/*", &hFind);
|
||||
}
|
||||
else
|
||||
{
|
||||
hFindFile = FindFirstFileA("Windows64Media/DLC/*", &hFind);
|
||||
}
|
||||
_WIN32_FIND_DATAA hFind;
|
||||
HANDLE hFindFile;
|
||||
if (ret)
|
||||
{
|
||||
hFindFile = FindFirstFileA("Windows64/DLC/*", &hFind);
|
||||
}
|
||||
else
|
||||
{
|
||||
hFindFile = FindFirstFileA("Windows64Media/DLC/*", &hFind);
|
||||
}
|
||||
|
||||
if (hFindFile != (HANDLE)-1LL)
|
||||
{
|
||||
do
|
||||
{
|
||||
atts = hFind.dwFileAttributes;
|
||||
if (hFindFile != (HANDLE)-1LL)
|
||||
{
|
||||
do
|
||||
{
|
||||
atts = hFind.dwFileAttributes;
|
||||
|
||||
bool isArt = hFind.dwFileAttributes != -1 && (hFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
if (isArt && hFind.cFileName[0] != '.')
|
||||
{
|
||||
XCONTENT_DATA data;
|
||||
bool isArt = hFind.dwFileAttributes != -1 && (hFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
if (isArt && hFind.cFileName[0] != '.')
|
||||
{
|
||||
XCONTENT_DATA data;
|
||||
|
||||
if (ret)
|
||||
{
|
||||
sprintf(data.szFileName, "Windows64/DLC/%s", hFind.cFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(data.szFileName, "Windows64Media/DLC/%s", hFind.cFileName);
|
||||
}
|
||||
if (ret)
|
||||
{
|
||||
sprintf(data.szFileName, "Windows64/DLC/%s", hFind.cFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(data.szFileName, "Windows64Media/DLC/%s", hFind.cFileName);
|
||||
}
|
||||
|
||||
swprintf(data.szDisplayName, 256, L"%s", hFind.cFileName);
|
||||
int displayNameLen = wcslen(data.szDisplayName);
|
||||
swprintf(data.szDisplayName, 256, L"%s", hFind.cFileName);
|
||||
int displayNameLen = wcslen(data.szDisplayName);
|
||||
|
||||
data.DeviceID = 0;
|
||||
data.dwContentType = 0;
|
||||
data.DeviceID = 0;
|
||||
data.dwContentType = 0;
|
||||
|
||||
AddInstalled(&data);
|
||||
}
|
||||
} while (FindNextFileA(hFindFile, &hFind));
|
||||
FindClose(hFindFile);
|
||||
}
|
||||
AddInstalled(&data);
|
||||
}
|
||||
} while (FindNextFileA(hFindFile, &hFind));
|
||||
FindClose(hFindFile);
|
||||
}
|
||||
|
||||
return C4JStorage::EDLC_Idle;
|
||||
return C4JStorage::EDLC_Idle;
|
||||
}
|
||||
|
||||
DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int(*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||
DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||
{
|
||||
this->m_pMountedDLCFunc = Func;
|
||||
this->m_pMountedDLCParam = lpParam;
|
||||
this->m_pMountedDLCFunc = Func;
|
||||
this->m_pMountedDLCParam = lpParam;
|
||||
|
||||
if (szMountDrive)
|
||||
{
|
||||
m_szMountPath = szMountDrive;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_szMountPath = this->m_szPackageRoot;
|
||||
}
|
||||
if (szMountDrive)
|
||||
{
|
||||
m_szMountPath = szMountDrive;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_szMountPath = this->m_szPackageRoot;
|
||||
}
|
||||
|
||||
this->m_uiCurrentMappedDLC = dwDLC;
|
||||
this->m_uiCurrentMappedDLC = dwDLC;
|
||||
|
||||
char* dlcdirPath = m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName;
|
||||
m_vDLCDriveMappings.push_back(DriveMapping(dlcdirPath, m_szMountPath));
|
||||
char *dlcdirPath = m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName;
|
||||
m_vDLCDriveMappings.push_back(DriveMapping(dlcdirPath, m_szMountPath));
|
||||
|
||||
m_iHasNewMountedDLCs = true;
|
||||
m_iHasNewMountedDLCs = true;
|
||||
|
||||
return 997;
|
||||
return 997;
|
||||
}
|
||||
|
||||
DWORD CDLC::UnmountInstalledDLC(LPCSTR szMountDrive)
|
||||
{
|
||||
LPCSTR szDrive = nullptr;
|
||||
LPCSTR szDrive = nullptr;
|
||||
|
||||
if (szMountDrive)
|
||||
{
|
||||
szDrive = szMountDrive;
|
||||
}
|
||||
else
|
||||
{
|
||||
szDrive = this->m_szPackageRoot;
|
||||
}
|
||||
if (szMountDrive)
|
||||
{
|
||||
szDrive = szMountDrive;
|
||||
}
|
||||
else
|
||||
{
|
||||
szDrive = this->m_szPackageRoot;
|
||||
}
|
||||
|
||||
for (int i = 0; i < this->m_vDLCDriveMappings.size(); i++)
|
||||
{
|
||||
if (m_vDLCDriveMappings[i].m_szDirectoryPath == szDrive)
|
||||
{
|
||||
m_vDLCDriveMappings.erase(m_vDLCDriveMappings.begin() + i);
|
||||
for (int i = 0; i < this->m_vDLCDriveMappings.size(); i++)
|
||||
{
|
||||
if (m_vDLCDriveMappings[i].m_szDirectoryPath == szDrive)
|
||||
{
|
||||
m_vDLCDriveMappings.erase(m_vDLCDriveMappings.begin() + i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CDLC::GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList)
|
||||
void CDLC::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList)
|
||||
{
|
||||
char* dlcdirPath = new char[256];
|
||||
sprintf(dlcdirPath, "%s/*", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName);
|
||||
char *dlcdirPath = new char[256];
|
||||
sprintf(dlcdirPath, "%s/*", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName);
|
||||
|
||||
_WIN32_FIND_DATAA atts;
|
||||
HANDLE hFind = FindFirstFileA(dlcdirPath, &atts);
|
||||
if (hFind != (HANDLE)-1LL)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (atts.dwFileAttributes == -1 || (atts.dwFileAttributes & 0x10) != 0x10)
|
||||
{
|
||||
char dir[256];
|
||||
sprintf(dir, "%s/%s", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName, atts.cFileName);
|
||||
_WIN32_FIND_DATAA atts;
|
||||
HANDLE hFind = FindFirstFileA(dlcdirPath, &atts);
|
||||
if (hFind != (HANDLE)-1LL)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (atts.dwFileAttributes == -1 || (atts.dwFileAttributes & 0x10) != 0x10)
|
||||
{
|
||||
char dir[256];
|
||||
sprintf(dir, "%s/%s", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName, atts.cFileName);
|
||||
|
||||
fileList.push_back(dir);
|
||||
}
|
||||
} while (FindNextFileA(hFind, &atts));
|
||||
FindClose(hFind);
|
||||
}
|
||||
delete[] dlcdirPath;
|
||||
fileList.push_back(dir);
|
||||
}
|
||||
} while (FindNextFileA(hFind, &atts));
|
||||
FindClose(hFind);
|
||||
}
|
||||
delete[] dlcdirPath;
|
||||
}
|
||||
|
||||
std::string CDLC::GetMountedPath(std::string szMount)
|
||||
{
|
||||
for (int ch = 0; ch < szMount.size(); ++ch)
|
||||
{
|
||||
if (szMount[ch] == '/' || szMount[ch] == '\\')
|
||||
{
|
||||
return "";
|
||||
}
|
||||
for (int ch = 0; ch < szMount.size(); ++ch)
|
||||
{
|
||||
if (szMount[ch] == '/' || szMount[ch] == '\\')
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if (szMount[ch] == ':')
|
||||
{
|
||||
std::string driveName = szMount.substr(0, ch);
|
||||
for (int i = 0; i < m_vDLCDriveMappings.size(); ++i)
|
||||
{
|
||||
if (m_vDLCDriveMappings[i].m_szDirectoryPath == driveName)
|
||||
{
|
||||
std::string newPath = m_vDLCDriveMappings[i].m_szMountPath;
|
||||
if (szMount[ch] == ':')
|
||||
{
|
||||
std::string driveName = szMount.substr(0, ch);
|
||||
for (int i = 0; i < m_vDLCDriveMappings.size(); ++i)
|
||||
{
|
||||
if (m_vDLCDriveMappings[i].m_szDirectoryPath == driveName)
|
||||
{
|
||||
std::string newPath = m_vDLCDriveMappings[i].m_szMountPath;
|
||||
|
||||
newPath.append(szMount.substr(ch + 1, -1));
|
||||
newPath.append(szMount.substr(ch + 1, -1));
|
||||
|
||||
return newPath;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return newPath;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
void CDLC::SetDLCProductCode(const char* szProductCode)
|
||||
void CDLC::SetDLCProductCode(const char *szProductCode)
|
||||
{
|
||||
strcpy(m_szDLCProductCode, szProductCode);
|
||||
strcpy(m_szDLCProductCode, szProductCode);
|
||||
}
|
||||
|
||||
void CDLC::SetProductUpgradeKey(const char* szProductCode)
|
||||
void CDLC::SetProductUpgradeKey(const char *szProductCode)
|
||||
{
|
||||
strcpy(m_szProductUpgradeKey, szProductCode);
|
||||
strcpy(m_szProductUpgradeKey, szProductCode);
|
||||
}
|
||||
|
||||
int CDLC::GetAvailableDLCCount(int iPad)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CDLC::SetPackageRoot(char* pszDLCRoot)
|
||||
void CDLC::SetPackageRoot(char *pszDLCRoot)
|
||||
{
|
||||
strcpy(this->m_szPackageRoot, pszDLCRoot);
|
||||
strcpy(this->m_szPackageRoot, pszDLCRoot);
|
||||
}
|
||||
|
||||
void CDLC::Tick(void)
|
||||
{
|
||||
if (m_iHasNewInstalledDLCs)
|
||||
{
|
||||
m_iHasNewInstalledDLCs = false;
|
||||
m_pInstalledDLCFunc(m_pInstalledDLCParam, m_vInstalledDLCs.size(), 0);
|
||||
}
|
||||
if (m_iHasNewMountedDLCs)
|
||||
{
|
||||
m_iHasNewMountedDLCs = false;
|
||||
m_pMountedDLCFunc(m_pMountedDLCParam, 0, 0, dword94);
|
||||
}
|
||||
if (m_iHasNewInstalledDLCs)
|
||||
{
|
||||
m_iHasNewInstalledDLCs = false;
|
||||
m_pInstalledDLCFunc(m_pInstalledDLCParam, m_vInstalledDLCs.size(), 0);
|
||||
}
|
||||
if (m_iHasNewMountedDLCs)
|
||||
{
|
||||
m_iHasNewMountedDLCs = false;
|
||||
m_pMountedDLCFunc(m_pMountedDLCParam, 0, 0, dword94);
|
||||
}
|
||||
}
|
||||
|
||||
void CDLC::AddInstalled(XCONTENT_DATA* data)
|
||||
void CDLC::AddInstalled(XCONTENT_DATA *data)
|
||||
{
|
||||
m_vInstalledDLCs.push_back(*data);
|
||||
m_vInstalledDLCs.push_back(*data);
|
||||
}
|
||||
|
||||
DWORD CDLC::CancelOffers(void)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4,54 +4,54 @@
|
||||
class CDLC
|
||||
{
|
||||
public:
|
||||
struct DriveMapping
|
||||
{
|
||||
DriveMapping(std::string szDirectoryPath, std::string szMountPath) : m_szDirectoryPath(szDirectoryPath), m_szMountPath(szMountPath)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
struct DriveMapping
|
||||
{
|
||||
DriveMapping(std::string szDirectoryPath, std::string szMountPath) : m_szDirectoryPath(szDirectoryPath), m_szMountPath(szMountPath)
|
||||
{
|
||||
;
|
||||
}
|
||||
std::string m_szDirectoryPath;
|
||||
std::string m_szMountPath;
|
||||
};
|
||||
|
||||
std::string m_szDirectoryPath;
|
||||
std::string m_szMountPath;
|
||||
};
|
||||
XCONTENT_DATA &GetDLC(DWORD dw);
|
||||
CDLC(void);
|
||||
|
||||
XCONTENT_DATA& GetDLC(DWORD dw);
|
||||
CDLC(void);
|
||||
C4JStorage::EDLCStatus GetOffers(int iPad, int (*Func)(LPVOID, int, DWORD, int), LPVOID lpParam,
|
||||
DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||
void ClearOffers();
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam);
|
||||
DWORD MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive = NULL);
|
||||
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
|
||||
void GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList);
|
||||
std::string GetMountedPath(std::string szMount);
|
||||
|
||||
C4JStorage::EDLCStatus GetOffers(int iPad, int(*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||
void ClearOffers();
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int(*Func)(LPVOID, int, int), LPVOID lpParam);
|
||||
DWORD MountInstalledDLC(int iPad, DWORD dwDLC, int(*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive = NULL);
|
||||
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
|
||||
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
|
||||
std::string GetMountedPath(std::string szMount);
|
||||
void SetDLCProductCode(const char *szProductCode);
|
||||
void SetProductUpgradeKey(const char *szProductCode);
|
||||
int GetAvailableDLCCount(int iPad);
|
||||
void SetPackageRoot(char *pszDLCRoot);
|
||||
|
||||
void SetDLCProductCode(const char* szProductCode);
|
||||
void SetProductUpgradeKey(const char* szProductCode);
|
||||
int GetAvailableDLCCount(int iPad);
|
||||
void SetPackageRoot(char* pszDLCRoot);
|
||||
void Tick(void);
|
||||
void AddInstalled(XCONTENT_DATA *data);
|
||||
DWORD CancelOffers(void);
|
||||
|
||||
void Tick(void);
|
||||
void AddInstalled(XCONTENT_DATA* data);
|
||||
DWORD CancelOffers(void);
|
||||
|
||||
DWORD dword0;
|
||||
int (*m_pInstalledDLCFunc)(LPVOID, int, int);
|
||||
LPVOID m_pInstalledDLCParam;
|
||||
BYTE gap18[16];
|
||||
int m_iHasNewInstalledDLCs;
|
||||
std::vector<XCONTENT_DATA> m_vInstalledDLCs;
|
||||
BYTE gap48[4];
|
||||
DWORD m_iHasNewMountedDLCs;
|
||||
int (*m_pMountedDLCFunc)(LPVOID, int, DWORD, DWORD);
|
||||
LPVOID m_pMountedDLCParam;
|
||||
std::string m_szMountPath;
|
||||
DWORD m_uiCurrentMappedDLC;
|
||||
DWORD dword94;
|
||||
char m_szPackageRoot[40];
|
||||
DWORD dwordC0;
|
||||
std::vector<DriveMapping> m_vDLCDriveMappings;
|
||||
char m_szDLCProductCode[16];
|
||||
char m_szProductUpgradeKey[60];
|
||||
DWORD dword0;
|
||||
int (*m_pInstalledDLCFunc)(LPVOID, int, int);
|
||||
LPVOID m_pInstalledDLCParam;
|
||||
BYTE gap18[16];
|
||||
int m_iHasNewInstalledDLCs;
|
||||
std::vector<XCONTENT_DATA> m_vInstalledDLCs;
|
||||
BYTE gap48[4];
|
||||
DWORD m_iHasNewMountedDLCs;
|
||||
int (*m_pMountedDLCFunc)(LPVOID, int, DWORD, DWORD);
|
||||
LPVOID m_pMountedDLCParam;
|
||||
std::string m_szMountPath;
|
||||
DWORD m_uiCurrentMappedDLC;
|
||||
DWORD dword94;
|
||||
char m_szPackageRoot[40];
|
||||
DWORD dwordC0;
|
||||
std::vector<DriveMapping> m_vDLCDriveMappings;
|
||||
char m_szDLCProductCode[16];
|
||||
char m_szProductUpgradeKey[60];
|
||||
};
|
||||
@@ -10,17 +10,14 @@ CStorage::CStorage(void)
|
||||
m_DLC = CDLC();
|
||||
}
|
||||
|
||||
void CStorage::Init(int(*Func)(LPVOID, const C4JStorage::ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID)
|
||||
{
|
||||
void CStorage::Init(int (*Func)(LPVOID, const C4JStorage::ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID) {}
|
||||
|
||||
}
|
||||
|
||||
void CStorage::Tick(void)
|
||||
void CStorage::Tick(void)
|
||||
{
|
||||
m_DLC.Tick();
|
||||
}
|
||||
|
||||
unsigned int CStorage::CRC(unsigned char* buf, int len)
|
||||
unsigned int CStorage::CRC(unsigned char *buf, int len)
|
||||
{
|
||||
return ~UpdateCRC(0xFFFFFFFF, buf, len);
|
||||
}
|
||||
@@ -46,7 +43,7 @@ void CStorage::MakeCRCTable(void)
|
||||
m_bHasCRCTable = true;
|
||||
}
|
||||
|
||||
unsigned int CStorage::UpdateCRC(unsigned int crc, unsigned __int8* buf, int len)
|
||||
unsigned int CStorage::UpdateCRC(unsigned int crc, unsigned __int8 *buf, int len)
|
||||
{
|
||||
if (!m_bHasCRCTable)
|
||||
{
|
||||
@@ -55,13 +52,13 @@ unsigned int CStorage::UpdateCRC(unsigned int crc, unsigned __int8* buf, int len
|
||||
|
||||
for (int c = 0; c < len; ++c)
|
||||
{
|
||||
crc = (crc >> 8) ^ m_CRCTable[(unsigned __int8)(buf[c] ^ crc)];
|
||||
crc = (crc >> 8) ^ m_CRCTable[(unsigned __int8)(buf[c] ^ crc)];
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void CStorage::DebugPrintf(const char* szFormat, ...)
|
||||
void CStorage::DebugPrintf(const char *szFormat, ...)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
#pragma once
|
||||
#include "STO_SaveGame.h"
|
||||
#include "STO_DLC.h"
|
||||
#include "STO_SaveGame.h"
|
||||
|
||||
class CStorage
|
||||
{
|
||||
public:
|
||||
CStorage(void);
|
||||
|
||||
CStorage(void);
|
||||
void Init(int (*Func)(LPVOID, const C4JStorage::ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID);
|
||||
void Tick(void);
|
||||
unsigned int CRC(unsigned char *buf, int len);
|
||||
void MakeCRCTable(void);
|
||||
unsigned int UpdateCRC(unsigned int crc, unsigned __int8 *buf, int len);
|
||||
void DebugPrintf(const char *szFormat, ...);
|
||||
|
||||
void Init(int(*Func)(LPVOID, const C4JStorage::ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID);
|
||||
void Tick(void);
|
||||
unsigned int CRC(unsigned char* buf, int len);
|
||||
void MakeCRCTable(void);
|
||||
unsigned int UpdateCRC(unsigned int crc, unsigned __int8* buf, int len);
|
||||
void DebugPrintf(const char* szFormat, ...);
|
||||
|
||||
BYTE gap0[8];
|
||||
CSaveGame m_SaveGame;
|
||||
CDLC m_DLC;
|
||||
BYTE gap278[0x10];
|
||||
DWORD m_CRCTable[256];
|
||||
bool m_bHasCRCTable;
|
||||
BYTE gap0[8];
|
||||
CSaveGame m_SaveGame;
|
||||
CDLC m_DLC;
|
||||
BYTE gap278[0x10];
|
||||
DWORD m_CRCTable[256];
|
||||
bool m_bHasCRCTable;
|
||||
};
|
||||
|
||||
// Singleton
|
||||
|
||||
@@ -3,43 +3,44 @@
|
||||
|
||||
CSaveGame::CSaveGame()
|
||||
{
|
||||
m_pSaveData = nullptr;
|
||||
m_uiSaveSize = 0;
|
||||
m_bIsSafeDisabled = false;
|
||||
m_pSaveData = nullptr;
|
||||
m_uiSaveSize = 0;
|
||||
m_bIsSafeDisabled = false;
|
||||
|
||||
ZeroMemory(m_szSaveUniqueName, sizeof(m_szSaveUniqueName));
|
||||
ZeroMemory(m_szSaveTitle, sizeof(m_szSaveTitle));
|
||||
ZeroMemory(m_szSaveUniqueName, sizeof(m_szSaveUniqueName));
|
||||
ZeroMemory(m_szSaveTitle, sizeof(m_szSaveTitle));
|
||||
|
||||
m_pSaveDetails = nullptr;
|
||||
m_bHasSaveDetails = false;
|
||||
m_pSaveDetails = nullptr;
|
||||
m_bHasSaveDetails = false;
|
||||
|
||||
GetCurrentDirectoryA(sizeof(m_szSaveUniqueName), m_szSaveUniqueName);
|
||||
GetCurrentDirectoryA(sizeof(m_szSaveUniqueName), m_szSaveUniqueName);
|
||||
|
||||
char dirName[256];
|
||||
char curDir[256];
|
||||
GetCurrentDirectoryA(sizeof(dirName), dirName);
|
||||
sprintf(curDir, "%s/Windows64/GameHDD/", dirName);
|
||||
CreateDirectoryA(curDir, 0);
|
||||
char dirName[256];
|
||||
char curDir[256];
|
||||
GetCurrentDirectoryA(sizeof(dirName), dirName);
|
||||
sprintf(curDir, "%s/Windows64/GameHDD/", dirName);
|
||||
CreateDirectoryA(curDir, 0);
|
||||
}
|
||||
|
||||
void CSaveGame::SetSaveDisabled(bool bDisable)
|
||||
{
|
||||
m_bIsSafeDisabled = bDisable;
|
||||
m_bIsSafeDisabled = bDisable;
|
||||
}
|
||||
|
||||
bool CSaveGame::GetSaveDisabled(void)
|
||||
{
|
||||
return m_bIsSafeDisabled;
|
||||
return m_bIsSafeDisabled;
|
||||
}
|
||||
|
||||
void CSaveGame::ResetSaveData()
|
||||
{
|
||||
free(m_pSaveData);
|
||||
m_pSaveData = nullptr;
|
||||
m_uiSaveSize = 0;
|
||||
free(m_pSaveData);
|
||||
m_pSaveData = nullptr;
|
||||
m_uiSaveSize = 0;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState CSaveGame::GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS* pSaveDetails, const bool), LPVOID lpParam, char* pszSavePackName)
|
||||
C4JStorage::ESaveGameState CSaveGame::GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, const bool), LPVOID lpParam,
|
||||
char *pszSavePackName)
|
||||
{
|
||||
WIN32_FIND_DATAA findFileData;
|
||||
WIN32_FILE_ATTRIBUTE_DATA fileInfoBuffer;
|
||||
@@ -90,16 +91,15 @@ C4JStorage::ESaveGameState CSaveGame::GetSavesInfo(int iPad, int (*Func)(LPVOID
|
||||
{
|
||||
do
|
||||
{
|
||||
if ((findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0
|
||||
&& strcmp(findFileData.cFileName, ".")
|
||||
&& strcmp(findFileData.cFileName, ".."))
|
||||
if ((findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 && strcmp(findFileData.cFileName, ".") &&
|
||||
strcmp(findFileData.cFileName, ".."))
|
||||
{
|
||||
strcpy_s(m_pSaveDetails->SaveInfoA[i].UTF8SaveFilename, findFileData.cFileName);
|
||||
strcpy_s(m_pSaveDetails->SaveInfoA[i].UTF8SaveTitle, findFileData.cFileName);
|
||||
|
||||
char fileName[280];
|
||||
|
||||
char fileName[280];
|
||||
sprintf(fileName, "%s\\Windows64\\GameHDD\\%s\\saveData.ms", dirName, findFileData.cFileName);
|
||||
|
||||
|
||||
GetFileAttributesExA(fileName, GetFileExInfoStandard, &fileInfoBuffer);
|
||||
m_pSaveDetails->SaveInfoA[i++].metaData.dataSize = fileInfoBuffer.nFileSizeLow;
|
||||
m_pSaveDetails->iSaveC++;
|
||||
@@ -142,24 +142,25 @@ void CSaveGame::ClearSavesInfo()
|
||||
}
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState CSaveGame::LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState CSaveGame::LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes), LPVOID lpParam)
|
||||
{
|
||||
Func(lpParam, pSaveInfo->thumbnailData, pSaveInfo->metaData.thumbnailSize);
|
||||
Func(lpParam, pSaveInfo->thumbnailData, pSaveInfo->metaData.thumbnailSize);
|
||||
return C4JStorage::ESaveGame_GetSaveThumbnail;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState CSaveGame::LoadSaveData(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState CSaveGame::LoadSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam)
|
||||
{
|
||||
SetSaveUniqueFilename(pSaveInfo->UTF8SaveFilename);
|
||||
|
||||
|
||||
if (m_pSaveData)
|
||||
{
|
||||
free(m_pSaveData);
|
||||
}
|
||||
|
||||
|
||||
m_pSaveData = malloc(pSaveInfo->metaData.dataSize);
|
||||
m_uiSaveSize = pSaveInfo->metaData.dataSize;
|
||||
|
||||
|
||||
char dirName[256];
|
||||
char curDir[256];
|
||||
char fileName[280];
|
||||
@@ -167,7 +168,7 @@ C4JStorage::ESaveGameState CSaveGame::LoadSaveData(PSAVE_INFO pSaveInfo, int(*Fu
|
||||
sprintf(dirName, "%s/Windows64/GameHDD/%s", curDir, m_szSaveUniqueName);
|
||||
CreateDirectoryA(dirName, 0);
|
||||
sprintf(fileName, "%s/saveData.ms", dirName);
|
||||
|
||||
|
||||
HANDLE h = CreateFileA(fileName, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
|
||||
bool success = false;
|
||||
@@ -193,7 +194,7 @@ unsigned int CSaveGame::GetSaveSize()
|
||||
return m_uiSaveSize;
|
||||
}
|
||||
|
||||
void CSaveGame::GetSaveData(void* pvData, unsigned int* puiBytes)
|
||||
void CSaveGame::GetSaveData(void *pvData, unsigned int *puiBytes)
|
||||
{
|
||||
if (pvData)
|
||||
{
|
||||
@@ -206,12 +207,12 @@ void CSaveGame::GetSaveData(void* pvData, unsigned int* puiBytes)
|
||||
}
|
||||
}
|
||||
|
||||
bool CSaveGame::GetSaveUniqueNumber(INT* piVal)
|
||||
bool CSaveGame::GetSaveUniqueNumber(INT *piVal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CSaveGame::GetSaveUniqueFilename(char* pszName)
|
||||
bool CSaveGame::GetSaveUniqueFilename(char *pszName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -225,7 +226,7 @@ void CSaveGame::SetSaveTitle(LPCWSTR pwchDefaultSaveName)
|
||||
PVOID CSaveGame::AllocateSaveData(unsigned int uiBytes)
|
||||
{
|
||||
free(m_pSaveData);
|
||||
|
||||
|
||||
m_pSaveData = malloc(uiBytes);
|
||||
if (m_pSaveData)
|
||||
{
|
||||
@@ -240,7 +241,7 @@ void CSaveGame::SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE p
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState CSaveGame::SaveSaveData(int(*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState CSaveGame::SaveSaveData(int (*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
{
|
||||
char dirName[256];
|
||||
char curDir[256];
|
||||
@@ -255,7 +256,7 @@ C4JStorage::ESaveGameState CSaveGame::SaveSaveData(int(*Func)(LPVOID, const bool
|
||||
DWORD bytesWritten = 0;
|
||||
BOOL res = WriteFile(h, m_pSaveData, m_uiSaveSize, &bytesWritten, 0);
|
||||
_ASSERT(res && bytesWritten == m_uiSaveSize);
|
||||
|
||||
|
||||
CloseHandle(h);
|
||||
|
||||
Func(lpParam, true);
|
||||
@@ -263,28 +264,21 @@ C4JStorage::ESaveGameState CSaveGame::SaveSaveData(int(*Func)(LPVOID, const bool
|
||||
return C4JStorage::ESaveGame_Idle;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState CSaveGame::DeleteSaveData(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, const bool), LPVOID lpParam)
|
||||
C4JStorage::ESaveGameState CSaveGame::DeleteSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam)
|
||||
{
|
||||
return C4JStorage::ESaveGame_Idle;
|
||||
}
|
||||
|
||||
void CSaveGame::SetSaveUniqueFilename(char* szFilename)
|
||||
void CSaveGame::SetSaveUniqueFilename(char *szFilename)
|
||||
{
|
||||
strcpy_s(m_szSaveUniqueName, szFilename);
|
||||
}
|
||||
|
||||
|
||||
void CSaveGame::CreateSaveUniqueName(void)
|
||||
{
|
||||
_SYSTEMTIME UTCSysTime;
|
||||
GetSystemTime(&UTCSysTime);
|
||||
|
||||
sprintf_s(m_szSaveUniqueName, sizeof(m_szSaveUniqueName),
|
||||
"%4d%02d%02d%02d%02d%02d",
|
||||
UTCSysTime.wYear,
|
||||
UTCSysTime.wMonth,
|
||||
UTCSysTime.wDay,
|
||||
UTCSysTime.wHour,
|
||||
UTCSysTime.wMinute,
|
||||
UTCSysTime.wSecond);
|
||||
sprintf_s(m_szSaveUniqueName, sizeof(m_szSaveUniqueName), "%4d%02d%02d%02d%02d%02d", UTCSysTime.wYear, UTCSysTime.wMonth, UTCSysTime.wDay,
|
||||
UTCSysTime.wHour, UTCSysTime.wMinute, UTCSysTime.wSecond);
|
||||
}
|
||||
|
||||
@@ -4,35 +4,36 @@
|
||||
class CSaveGame
|
||||
{
|
||||
public:
|
||||
CSaveGame();
|
||||
void SetSaveDisabled(bool bDisable);
|
||||
bool GetSaveDisabled(void);
|
||||
|
||||
CSaveGame();
|
||||
void SetSaveDisabled(bool bDisable);
|
||||
bool GetSaveDisabled(void);
|
||||
void ResetSaveData();
|
||||
C4JStorage::ESaveGameState GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, const bool), LPVOID lpParam,
|
||||
char *pszSavePackName);
|
||||
PSAVE_DETAILS ReturnSavesInfo();
|
||||
void ClearSavesInfo();
|
||||
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes),
|
||||
LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam);
|
||||
unsigned int GetSaveSize();
|
||||
void GetSaveData(void *pvData, unsigned int *puiBytes);
|
||||
bool GetSaveUniqueNumber(INT *piVal);
|
||||
bool GetSaveUniqueFilename(char *pszName);
|
||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
||||
void SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE pbImage, DWORD dwImageBytes, PBYTE pbTextData, DWORD dwTextDataBytes);
|
||||
C4JStorage::ESaveGameState SaveSaveData(int (*Func)(LPVOID, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam);
|
||||
void SetSaveUniqueFilename(char *szFilename);
|
||||
|
||||
void ResetSaveData();
|
||||
C4JStorage::ESaveGameState GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS* pSaveDetails, const bool), LPVOID lpParam, char* pszSavePackName);
|
||||
PSAVE_DETAILS ReturnSavesInfo();
|
||||
void ClearSavesInfo();
|
||||
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam);
|
||||
unsigned int GetSaveSize();
|
||||
void GetSaveData(void* pvData, unsigned int* puiBytes);
|
||||
bool GetSaveUniqueNumber(INT* piVal);
|
||||
bool GetSaveUniqueFilename(char* pszName);
|
||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
||||
void SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE pbImage, DWORD dwImageBytes, PBYTE pbTextData, DWORD dwTextDataBytes);
|
||||
C4JStorage::ESaveGameState SaveSaveData(int(*Func)(LPVOID, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo, int(*Func)(LPVOID lpParam, const bool), LPVOID lpParam);
|
||||
void SetSaveUniqueFilename(char* szFilename);
|
||||
void CreateSaveUniqueName(void);
|
||||
|
||||
void CreateSaveUniqueName(void);
|
||||
|
||||
void* m_pSaveData;
|
||||
unsigned int m_uiSaveSize;
|
||||
char m_szSaveUniqueName[32];
|
||||
char m_szSaveTitle[256];
|
||||
bool m_bIsSafeDisabled;
|
||||
bool m_bHasSaveDetails;
|
||||
SAVE_DETAILS* m_pSaveDetails;
|
||||
void *m_pSaveData;
|
||||
unsigned int m_uiSaveSize;
|
||||
char m_szSaveUniqueName[32];
|
||||
char m_szSaveTitle[256];
|
||||
bool m_bIsSafeDisabled;
|
||||
bool m_bHasSaveDetails;
|
||||
SAVE_DETAILS *m_pSaveDetails;
|
||||
};
|
||||
Reference in New Issue
Block a user