Files
Client/Tools/PatchCommon/PatchInfoListV1.cpp
LGram16 e067522598 Initial commit: ROW Client source code
Game client codebase including:
- CharacterActionControl: Character and creature management
- GlobalScript: Network, items, skills, quests, utilities
- RYLClient: Main client application with GUI and event handlers
- Engine: 3D rendering engine (RYLGL)
- MemoryManager: Custom memory allocation
- Library: Third-party dependencies (DirectX, boost, etc.)
- Tools: Development utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 16:24:34 +09:00

90 lines
1.5 KiB
C++

#include "PatchInfoListV1.h"
const char* CPatchInfoListV1::ms_cszHeaderString = "PAT1";
//////////////////////////////////////////////////////////////////////////
//
bool CPatchInfoListV1::Load( const char* szFileName )
{
FILE* fp = fopen(szFileName, "rb");
if( NULL == fp )
{
return false;
}
// check header
char acTmp[4] = { 0, };
fread( acTmp, 4, sizeof(char), fp );
if( acTmp[0] != ms_cszHeaderString[0] ||
acTmp[1] != ms_cszHeaderString[1] ||
acTmp[2] != ms_cszHeaderString[2] ||
acTmp[3] != ms_cszHeaderString[3]
)
{
fclose(fp);
return false;
}
// read version
fread( &m_dwVersion, sizeof(DWORD), 1, fp );
// read count
long lCount;
fread( &lCount, sizeof(long), 1, fp );
// read data
m_vecPatchInfo.resize( lCount );
if( lCount !=
(long)fread( &(m_vecPatchInfo[0]), sizeof(FilePatchInfoRecordV1),
lCount, fp ) )
{
fclose(fp);
return false;
}
fclose(fp);
return true;
}
bool CPatchInfoListV1::Save( const char* szFileName )
{
FILE* fp = fopen(szFileName, "wb");
if( NULL == fp )
{
return false;
}
// write header
fwrite( ms_cszHeaderString, 4, sizeof(char), fp );
// write version
fwrite( &m_dwVersion, sizeof(DWORD), 1, fp );
// write count
long lCount = m_vecPatchInfo.size();
fwrite( &lCount, sizeof(long), 1, fp );
// write data
fwrite( &(m_vecPatchInfo[0]), sizeof(FilePatchInfoRecordV1),
lCount, fp );
fclose(fp);
return true;
}
void CPatchInfoListV1::Reset()
{
m_dwVersion = 0;
m_vecPatchInfo.clear();
}