| Line 6... |
Line 6... |
| 6 |
#include "XspFile.h"
|
6 |
#include "XspFile.h"
|
| 7 |
#include "archive/unzip.h"
|
7 |
#include "archive/unzip.h"
|
| 8 |
|
8 |
|
| 9 |
#include "MultiSpkFile.h"
|
9 |
#include "MultiSpkFile.h"
|
| 10 |
#include "VirtualFileSystem.h"
|
10 |
#include "VirtualFileSystem.h"
|
| - |
|
11 |
#include "Utils/StringList.h"
|
| 11 |
|
12 |
|
| 12 |
enum {INSTALLERR_NONE, INSTALLERR_VERSION, INSTALLERR_INVALID, INSTALLERR_NOMULTI, INSTALLERR_NOSHIP, INSTALLERR_UNKNOWN, INSTALLERR_NOEXIST, INSTALLERR_OLD};
|
13 |
enum {INSTALLERR_NONE, INSTALLERR_VERSION, INSTALLERR_INVALID, INSTALLERR_NOMULTI, INSTALLERR_NOSHIP, INSTALLERR_UNKNOWN, INSTALLERR_NOEXIST, INSTALLERR_OLD};
|
| 13 |
enum {INSTALLCHECK_OK, INSTALLCHECK_OLDVERSION, INSTALLCHECK_NOOTHERMOD, INSTALLCHECK_ALREADYQUEUED, INSTALLCHECK_WRONGGAME, INSTALLCHECK_WRONGVERSION, INSTALLCHECK_MODIFIED, INSTALLCHECK_NOSHIP};
|
14 |
enum {INSTALLCHECK_OK, INSTALLCHECK_OLDVERSION, INSTALLCHECK_NOOTHERMOD, INSTALLCHECK_ALREADYQUEUED, INSTALLCHECK_WRONGGAME, INSTALLCHECK_WRONGVERSION, INSTALLCHECK_MODIFIED, INSTALLCHECK_NOSHIP};
|
| 14 |
enum {PROGRESS_ENABLEFILE, PROGRESS_SHUFFLEFAKE, PROGRESS_DISABLEFILE};
|
15 |
enum {PROGRESS_ENABLEFILE, PROGRESS_SHUFFLEFAKE, PROGRESS_DISABLEFILE};
|
| 15 |
enum {PKERR_NONE, PKERR_NOPARENT, PKERR_MODIFIED, PKERR_MISSINGDEP, PKERR_NOOUTPUT, PKERR_DONTEXIST, PKERR_UNABLETOOPEN};
|
16 |
enum {PKERR_NONE, PKERR_NOPARENT, PKERR_MODIFIED, PKERR_MISSINGDEP, PKERR_NOOUTPUT, PKERR_DONTEXIST, PKERR_UNABLETOOPEN};
|
| Line 67... |
Line 68... |
| 67 |
int iRec;
|
68 |
int iRec;
|
| 68 |
CyString sFilename;
|
69 |
CyString sFilename;
|
| 69 |
int iScriptType;
|
70 |
int iScriptType;
|
| 70 |
bool bSigned;
|
71 |
bool bSigned;
|
| 71 |
} SAvailablePackage;
|
72 |
} SAvailablePackage;
|
| - |
|
73 |
|
| - |
|
74 |
tstruct SWarePriceOverride {
|
| - |
|
75 |
enum WareTypes type;
|
| - |
|
76 |
int pos;
|
| - |
|
77 |
Utils::String id;
|
| - |
|
78 |
int relval;
|
| - |
|
79 |
int notority;
|
| - |
|
80 |
bool bNotority;
|
| - |
|
81 |
} SWarePriceOverride;
|
| 72 |
|
82 |
|
| 73 |
class SPKEXPORT CPackages
|
83 |
class SPKEXPORT CPackages
|
| 74 |
{
|
84 |
{
|
| 75 |
public:
|
85 |
public:
|
| 76 |
static CyString ConvertLanguage(int lang);
|
86 |
static CyString ConvertLanguage(int lang);
|
| Line 239... |
Line 249... |
| 239 |
void ApplyFakePatchOrder(CyStringList *list);
|
249 |
void ApplyFakePatchOrder(CyStringList *list);
|
| 240 |
CBaseFile *CreateFromArchive(CyString filename, bool toInstall = false );
|
250 |
CBaseFile *CreateFromArchive(CyString filename, bool toInstall = false );
|
| 241 |
void ReadArchiveData(const char *buf, size_t len, CBaseFile *archive);
|
251 |
void ReadArchiveData(const char *buf, size_t len, CBaseFile *archive);
|
| 242 |
void ReadArchiveData(CyString filename, CBaseFile *archive);
|
252 |
void ReadArchiveData(CyString filename, CBaseFile *archive);
|
| 243 |
int VerifyInstalledFiles(CyStringList *missingFiles = NULL, bool getPackages = true);
|
253 |
int VerifyInstalledFiles(CyStringList *missingFiles = NULL, bool getPackages = true);
|
| - |
|
254 |
Utils::String empWaresForGame(int *maxsize = NULL);
|
| - |
|
255 |
void addEMPPriceOverride(int empId, int price);
|
| - |
|
256 |
void addEMPNotoOverride(int empId, int noto);
|
| - |
|
257 |
void addBuiltInWarePriceOverride(int empId, int price);
|
| - |
|
258 |
void addBuiltInWareNotoOverride(int empId, int noto);
|
| - |
|
259 |
void addCustomWarePriceOverride(const Utils::String &id, int price);
|
| - |
|
260 |
void addCustomWareNotoOverride(const Utils::String &id, int noto);
|
| 244 |
|
261 |
|
| 245 |
int GetCurrentGameFlags() { return m_iGameFlags; }
|
262 |
int GetCurrentGameFlags() { return m_iGameFlags; }
|
| 246 |
|
263 |
|
| 247 |
void SetCurrentDir(CyString dir) { m_sCurrentDir = dir; }
|
264 |
void SetCurrentDir(CyString dir) { m_sCurrentDir = dir; }
|
| 248 |
|
265 |
|
| Line 289... |
Line 306... |
| 289 |
void CreateAnimations();
|
306 |
void CreateAnimations();
|
| 290 |
void CreateTShips();
|
307 |
void CreateTShips();
|
| 291 |
CyStringList *CreateCockpits();
|
308 |
CyStringList *CreateCockpits();
|
| 292 |
void CreateCustomStarts();
|
309 |
void CreateCustomStarts();
|
| 293 |
void AddCreatedFile(CyString file);
|
310 |
void AddCreatedFile(CyString file);
|
| - |
|
311 |
|
| 294 |
bool ReadGlobals(CyStringList &globals);
|
312 |
bool ReadGlobals(CyStringList &globals);
|
| - |
|
313 |
bool readWares(Utils::CStringList &list);
|
| - |
|
314 |
int empOveridePrice(int id);
|
| - |
|
315 |
bool empOverideNoto(int id, int *noto);
|
| - |
|
316 |
int builtInWareOveridePrice(int id);
|
| - |
|
317 |
bool builtInWareOverideNoto(int id, int *noto);
|
| - |
|
318 |
int customWareOveridePrice(const Utils::String &id);
|
| - |
|
319 |
bool customWareOverideNoto(const Utils::String &id, int *noto);
|
| - |
|
320 |
void removeEmpOverride(int pos);
|
| - |
|
321 |
void removeBuiltinWareOverride(int pos);
|
| - |
|
322 |
void removeCustomWareOverride(const Utils::String &id);
|
| 295 |
|
323 |
|
| 296 |
// install text
|
324 |
// install text
|
| 297 |
CyString GetInstallBeforeText(CBaseFile *package);
|
325 |
CyString GetInstallBeforeText(CBaseFile *package);
|
| 298 |
CyString GetInstallAfterText(CBaseFile *package);
|
326 |
CyString GetInstallAfterText(CBaseFile *package);
|
| 299 |
CyString GetUninstallBeforeText(CBaseFile *package);
|
327 |
CyString GetUninstallBeforeText(CBaseFile *package);
|
| Line 351... |
Line 379... |
| 351 |
bool _checkForDisable(CBaseFile *package, bool disabled, CBaseFile *oldPackage);
|
379 |
bool _checkForDisable(CBaseFile *package, bool disabled, CBaseFile *oldPackage);
|
| 352 |
CBaseFile *_archive_fromRar(CyString filename, bool toInstall);
|
380 |
CBaseFile *_archive_fromRar(CyString filename, bool toInstall);
|
| 353 |
CBaseFile *_archive_fromZip(CyString filename, bool toInstall);
|
381 |
CBaseFile *_archive_fromZip(CyString filename, bool toInstall);
|
| 354 |
void _addToFakePatch(CBaseFile *pPackage);
|
382 |
void _addToFakePatch(CBaseFile *pPackage);
|
| 355 |
int _gameTextNumber() const;
|
383 |
int _gameTextNumber() const;
|
| - |
|
384 |
void _addWareOverride(enum WareTypes type, int pos, const Utils::String &id, int value, bool noto);
|
| - |
|
385 |
int _warePriceOverride(enum WareTypes type, int pos, const Utils::String &id);
|
| - |
|
386 |
bool _wareNotoOverride(enum WareTypes type, int pos, const Utils::String &id, int *noto);
|
| - |
|
387 |
void _removeWareOverride(enum WareTypes type, int pos, const Utils::String &id);
|
| 356 |
|
388 |
|
| 357 |
private:
|
389 |
private:
|
| 358 |
CyString m_sCurrentDir;
|
390 |
CyString m_sCurrentDir;
|
| 359 |
static CyString m_sTempDir;
|
391 |
static CyString m_sTempDir;
|
| 360 |
CyString m_sMyDoc;
|
392 |
CyString m_sMyDoc;
|
| Line 366... |
Line 398... |
| 366 |
CLinkList<CBaseFile> m_lPackages;
|
398 |
CLinkList<CBaseFile> m_lPackages;
|
| 367 |
CLinkList<C_File> m_lUninstallFiles;
|
399 |
CLinkList<C_File> m_lUninstallFiles;
|
| 368 |
CLinkList<C_File> m_lOriginalFiles;
|
400 |
CLinkList<C_File> m_lOriginalFiles;
|
| 369 |
CLinkList<SGameWare> m_lGameWares[WAREBUFFERS];
|
401 |
CLinkList<SGameWare> m_lGameWares[WAREBUFFERS];
|
| 370 |
CLinkList<SGameShip> m_lGameShips;
|
402 |
CLinkList<SGameShip> m_lGameShips;
|
| - |
|
403 |
CLinkList<SWarePriceOverride> m_lWarePrices;
|
| 371 |
|
404 |
|
| 372 |
// prepared lists
|
405 |
// prepared lists
|
| 373 |
CLinkList<CBaseFile> m_lInstallList; // install/uninstalling packages
|
406 |
CLinkList<CBaseFile> m_lInstallList; // install/uninstalling packages
|
| 374 |
CLinkList<CBaseFile> m_lEnableList; // enable packages
|
407 |
CLinkList<CBaseFile> m_lEnableList; // enable packages
|
| 375 |
CLinkList<CBaseFile> m_lDisableList; // disable packages
|
408 |
CLinkList<CBaseFile> m_lDisableList; // disable packages
|