iw4x-client/src/Components/Modules/FastFiles.hpp

74 lines
1.9 KiB
C++
Raw Normal View History

2017-01-20 08:36:52 -05:00
#pragma once
2017-01-19 16:23:59 -05:00
namespace Components
{
class FastFiles : public Component
{
public:
FastFiles();
~FastFiles();
2018-12-17 08:29:18 -05:00
static void AddZonePath(const std::string& path);
2017-01-19 16:23:59 -05:00
static std::string Current();
static bool Ready();
2018-12-17 08:29:18 -05:00
static bool Exists(const std::string& file);
2017-01-19 16:23:59 -05:00
static void LoadLocalizeZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
static float GetFullLoadedFraction();
static unsigned char ZoneKey[1191];
private:
union Key
{
struct
{
unsigned char key[24];
unsigned char iv[16];
};
unsigned char data[1];
};
static unsigned int CurrentZone;
static unsigned int MaxZones;
static bool IsIW4xZone;
static bool StreamRead;
static char LastByteRead;
2017-01-19 16:23:59 -05:00
static Key CurrentKey;
static symmetric_CTR CurrentCTR;
static std::vector<std::string> ZonePaths;
static const char* GetZoneLocation(const char* file);
static void LoadInitialZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
static void LoadDLCUIZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
static void LoadGfxZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync);
static void ReadHeaderStub(unsigned int* header, int size);
static void ReadVersionStub(unsigned int* version, int size);
static void ReadXFileHeader(void* buffer, int size);
static void AuthLoadInitCrypto();
static int AuthLoadInflateCompare(unsigned char* buffer, int length, unsigned char* ivValue);
static void AuthLoadInflateDecryptBase();
static void AuthLoadInflateDecryptBaseFunc(unsigned char* buffer);
static int InflateInitDecrypt(z_streamp strm, const char *version, int stream_size);
static void LoadZonesStub(Game::XZoneInfo *zoneInfo, unsigned int zoneCount);
static void ReadXFile(void* buffer, int size);
static void ReadXFileStub(char* buffer, int size);
#ifdef DEBUG
2017-01-19 16:23:59 -05:00
static void LogStreamRead(int len);
#endif
static void Load_XSurfaceArray(int atStreamStart, int count);
2017-01-19 16:23:59 -05:00
};
}