Subversion Repositories spk

Rev

Rev 179 | Rev 183 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#ifndef __PACKAGES_H__
2
#define __PACKAGES_H__
3
 
4
#include "SpkFile.h"
5
#include "GameExe.h"
6
#include "XspFile.h"
7
#include "archive/unzip.h"
8
 
9
#include "MultiSpkFile.h"
10
#include "VirtualFileSystem.h"
88 cycrow 11
#include "Utils/StringList.h"
1 cycrow 12
 
93 cycrow 13
#include "spkdefines.h"
1 cycrow 14
 
15
class CFileIO;
16
 
93 cycrow 17
namespace SPK {
18
	class COriginalFiles;
19
}
1 cycrow 20
 
93 cycrow 21
using namespace SPK;
1 cycrow 22
 
23
class SPKEXPORT CPackages
24
{
25
public:
121 cycrow 26
	static Utils::String ConvertLanguage(int lang);
1 cycrow 27
	static SAvailablePackage *CreateAvailablePackageData(CBaseFile *package);
126 cycrow 28
	static Utils::String FormatAvailablePackageData(CBaseFile *package);
29
	static Utils::String FormatAvailablePackageData(SAvailablePackage *package);
131 cycrow 30
	static Utils::String CreateFromPackagerScript(CPackages *packages, const Utils::String &filename);
160 cycrow 31
	static int GeneratePackageUpdateData(const Utils::String &dir, bool includeSingle = true);
1 cycrow 32
 
33
	CPackages ();
34
	~CPackages ();
35
 
83 cycrow 36
	bool isOldDir(const Utils::String &dir);
121 cycrow 37
	bool read(const Utils::String &dir, CProgressInfo *progress = NULL);
127 cycrow 38
	void startup(const Utils::String &dir, const Utils::String &tempDir, const Utils::String &myDoc);
39
	void startup(const Utils::String &dir, const Utils::String &tempDir, const Utils::String &myDoc, const Utils::String &mod);
1 cycrow 40
 
129 cycrow 41
	bool extractAll(CBaseFile *baseFile, const Utils::String &dir, int game, bool includedir = true, CProgressInfo *progress = NULL) const;
127 cycrow 42
	bool generatePackagerScript(CBaseFile *baseFile, bool wildcard, Utils::CStringList *list, int game, bool datafile = false) const;
134 cycrow 43
	CBaseFile *LoadPackagerScript(const Utils::String &filename, int compression, Utils::String (*askFunc)(const Utils::String &), Utils::CStringList *malformedLines = NULL, Utils::CStringList *unknownCommands = NULL, Utils::CStringList *variables = NULL, CProgressInfo *progress = NULL);
160 cycrow 44
	Utils::CStringList &GetGlobals() { return m_lGlobals; }
45
	Utils::CStringList &GetFakePatchOrder() { return m_lFakePatchOrder; }
125 cycrow 46
	Utils::String getCurrentDirectory() const;
127 cycrow 47
	static const Utils::String &tempDirectory() { return m_sTempDir; }
48
	const Utils::String &myDocuments() { return m_sMyDoc; }
1 cycrow 49
	CGameExe *GetGameExe() { return &m_gameExe; }
50
	CLinkList<CBaseFile> *GetInstallPackageList() { return &m_lInstallList; }
51
 
52
	// installing/uninstalling
53
	bool		InstallPackage ( CBaseFile *package, CyStringList *errors, CProgressInfo *progress = NULL, bool disabled = false );
182 cycrow 54
	CBaseFile		*openPackage(const Utils::String &file, int *error, CProgressInfo *progress = NULL, int readtype = SPKREAD_ALL, int flags = READFLAG_NONE);
55
	CMultiSpkFile	*openMultiPackage(const Utils::String &file, int *error, CProgressInfo *progress = NULL);
56
	bool			 openMultiPackage(const Utils::String &file, CLinkList<CBaseFile> *packageList, int *error, CProgressInfo *progress = NULL );
1 cycrow 57
	int			CheckInstallPackage(CBaseFile *package, int check = IC_ALL);
58
	bool		RemoveFile(C_File *file, CyStringList *errors = NULL);
59
	void		PrepareUninstallPackage(CBaseFile *package);
60
	bool		UninstallPreparedPackages(CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *uninstalledPackages = NULL, CLinkList<CBaseFile> *disabledPackages = NULL);
61
	void		ConvertOldPackage(CBaseFile *p);
62
	void		PurgeUninstallScripts(CBaseFile *package, CyStringList *errors);
63
	int 		PrepareInstallPackage(CBaseFile *package, bool disabled = false, bool force = false, int check = IC_ALL);
64
	int			InstallPreparedPackages(CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *errored, CLinkList<CBaseFile> *installedList = NULL);
65
	void		RemovePreparedInstall(CBaseFile *package);
66
	int			GetNumPackagesInQueue() { return m_lInstallList.size(); }
182 cycrow 67
	int			checkOpenPackage(const Utils::String &file, int* error);
133 cycrow 68
	bool		findAllNeededDependacies(CBaseFile *p, const CLinkList<CBaseFile> &packages, CLinkList<CBaseFile> *foundPackages, bool onlyEnabled = false, bool includePrepared = false) const;
69
	int			GetMissingDependacies(CBaseFile *p, Utils::CStringList *list, bool onlyEnabled = false, bool includePrepared = false);
170 cycrow 70
	size_t		getDownloadableDependacies(CBaseFile* p, std::vector<const SAvailablePackage*>& list, bool onlyEnabled = false, bool includePrepared = false) const;
133 cycrow 71
	bool		checkInstalledDependacy(const Utils::String &name, const Utils::String &author, const Utils::String &version, bool onlyEnabled = false, bool includePerpered = false) const;
1 cycrow 72
	bool		CheckEnabledDependacy(CBaseFile *p);
73
	int			GetDependacyList(CBaseFile *package, CLinkList<CBaseFile> *list);
182 cycrow 74
	int			prepareMultiPackage(const Utils::String &file, CLinkList<CBaseFile> *errorPackageList, int *error, CProgressInfo *progress = 0);
1 cycrow 75
 
76
	bool		IsOldPluginManager() { return m_bOldPlugin; }
133 cycrow 77
	int			findPackageFiles(CLinkList<CBaseFile> &packages, const Utils::String &dir);
78
	int			findPackageDirectories(CLinkList<CBaseFile> &packages, const Utils::String &dir);
79
	int			findAllPackages(CLinkList<CBaseFile> &packages, const Utils::String &dir);
164 cycrow 80
	size_t		updateFoundPackages(const Utils::String& dir);
81
	size_t		addFoundPackages(const Utils::String& dir);
1 cycrow 82
 
83
	// enable/disable
84
	bool EnablePackage ( CBaseFile *package, CyStringList *errors, CProgressInfo *progress = NULL );
85
	bool DisablePackage ( CBaseFile *package, CyStringList *errors, CProgressInfo *progress = NULL );
86
	bool DisablePreparedPackages ( CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *disabledPackages = NULL );
87
	bool PrepareEnablePackage(CBaseFile *package);
88
	bool PrepareDisablePackage(CBaseFile *package);
89
	bool EnablePreparedPackages ( CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *enabledPackages = NULL );
90
	int  GetNumPackagesInEnabledQueue() { return m_lEnableList.size(); }
91
	int  GetNumPackagesInDisabledQueue() { return m_lDisableList.size(); }
92
	bool PrepareDisableForVanilla();
93
	bool PrepareEnableLibrarys();
94
	bool PrepareEnableFromVanilla();
95
 
96
	void WriteData();
97
	bool CloseDir ( CyStringList *errors = 0, CProgressInfo *progress = NULL, bool removedir = false );
98
	bool RestoreFakePatch();
99
	bool ReadyFakePatch();
182 cycrow 100
	bool checkValidPluginManagerFile(const Utils::String &filename) const;
101
	bool checkIfPluginManagerFile(const Utils::String &filename) const;
1 cycrow 102
 
103
	// package control
104
	void UpdateUsedFiles(CLinkList<CBaseFile> *ignoreList = NULL, bool = true);
105
	void UpdateSigned();
106
	bool UpdatePackages(int doStatus = -1, bool individual = false);
182 cycrow 107
	CBaseFile *findXspPackage(const Utils::String &id) const;
133 cycrow 108
	CBaseFile *findSpkPackage(const Utils::String &name, const Utils::String &author) const;
182 cycrow 109
	CArchiveFile *findArchivePackage(const Utils::String &name) const;
160 cycrow 110
	CBaseFile* findPackage(const Utils::String &name, const Utils::String &author) const;
182 cycrow 111
	CBaseFile *findFirstPackageWithFile(C_File *f) const;
112
	CBaseFile *findNextPackageWithFile(CBaseFile *p, C_File *f) const;
113
	CBaseFile *findPackage(CBaseFile *package) const;
114
	C_File *findFile(FileType filetype, const Utils::String &filename, const Utils::String &dir = Utils::String::Null()) const;
1 cycrow 115
	CBaseFile *FirstPackage() { return m_lPackages.First(); }
116
	CBaseFile *NextPackage() { return m_lPackages.Next(); }
117
	CBaseFile *GetFirstPackage() { if ( m_lPackages.Front() ) return m_lPackages.Front()->Data(); return NULL; }
118
	CBaseFile *GetNextPackage(CBaseFile *from) 
119
	{ 
120
		bool found = false;
121
		for ( CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next() )
122
		{
123
			if ( !node->Data() ) continue;
124
			if ( node->Data() == from )
125
				found = true;
126
			else if ( found )
127
				return node->Data();
128
		}
129
		return NULL; 
130
	}
131
	void Reset();
132
	CBaseFile *GetPackageAt(int i) { return m_lPackages[i]; }
160 cycrow 133
	Utils::String selectedModName() const;
182 cycrow 134
	Utils::String getModKey() const;
1 cycrow 135
	void SetupWares();
136
	void SetupShips();
137
	void PurgeGameObjects();
138
	void PurgeWares();
139
	void PurgeShips();
140
	void StartPackage() { m_pPackageNode = m_lPackages.Front(); }
141
	void UpdatePackage(CBaseFile *p);
142
	CBaseFile *GetCurrentPackage() { return (m_pPackageNode) ? m_pPackageNode->Data() : NULL; }
143
	bool RemoveCurrentDirectory();
144
	void RemoveCreatedFiles();
145
	bool AnyUnusedShared();
146
 
147
	// util functions
160 cycrow 148
	void RemoveUnusedDirectories(CyStringList& dirs, CyStringList* errors = NULL);
149
	void removeUnusedDirectories(const Utils::CStringList &dirs, Utils::CStringList* errors = NULL);
1 cycrow 150
	int  RemoveUninstallScripts(CyStringList *errors = 0, CProgressInfo *progress = NULL);
151
	bool RemoveUninstallFile(C_File *file, CyStringList *errors = 0);
152
	int  RemoveUnusedSharedFiles(CyStringList *errors = 0, CProgressInfo *progress = NULL);
153
	bool RemoveSharedFile(C_File *file, CyStringList *errors = NULL);
154
	void ShufflePatchTo(C_File *file, int to, CyStringList *errors);
155
	void ShuffleFakePatches(CyStringList *errors);
156
	void ShuffleTextFiles(CyStringList *errors);
182 cycrow 157
	int  findNextFakePatch(int start = 0, const Utils::String &dir = Utils::String::Null()) const;
130 cycrow 158
	unsigned int  findNextTextFile(unsigned int start = 4) const;
159
	unsigned int  findNextTextFile(const Utils::String &dir, unsigned int start = 4) const;
182 cycrow 160
	int  findLastFakePatch(int start = 99, const Utils::String &dir = Utils::String::Null()) const;
161
	int  findLastTextFile(int start = 9999, const Utils::String &dir = Utils::String::Null()) const;
1 cycrow 162
	int  FindLowestFakePatchInstalled();
163
	void ReadGameLanguage(bool force = true);
164
	int	 RemoveAllPackages(CyStringList *errors = NULL, CProgressInfo *progress = NULL);
165
	void AssignPackageNumbers();
166
	int  GetChildPackages(CBaseFile *package, CLinkList<CBaseFile> *children, bool recursive = false);
167
	int  GetAllPackageFiles(CBaseFile *package, CLinkList<C_File> *fileList, bool includeChild);
168
	int	 GetAllPackageFiles(CLinkList<CBaseFile> *list, CLinkList<C_File> *fileList, bool includeChild);
160 cycrow 169
	void AddLogEntry(int type, CyString args, CyStringList* errors);
170
	void addLogEntry(int type, const Utils::String &args, Utils::CStringList* errors);
127 cycrow 171
	Utils::String findDataDir(const Utils::String &dir, const Utils::String &file);
179 cycrow 172
	int  countPackages(int type, bool onlyEnabled) const;
1 cycrow 173
	int  CountBuiltInPackages(bool onlyEnabled);
121 cycrow 174
	bool isCurrentDir(const Utils::String &dir) const;
1 cycrow 175
	bool CheckOtherPackage(CBaseFile *package);
176
	int CheckPreparedInstallRequired(CLinkList<CBaseFile> *list);
177
	static int ConvertWareType(char w);
178
	static char ConvertWareTypeBack(int w);
102 cycrow 179
	Utils::String logDirectory();
180
	Utils::String logDirectory(const Utils::String &gameExe);
181
	Utils::String saveDirectory();
126 cycrow 182
	void backupSaves() { backupSaves(m_bVanilla); }
183
	void backupSaves(bool vanilla);
184
	void restoreSaves() { restoreSaves(m_bVanilla); }
185
	void restoreSaves(bool vanilla);
182 cycrow 186
	bool unPackFile(const Utils::String &filename, bool checkxml = true) const;
187
	bool packFile(const Utils::String &filename) const;
188
	bool packFile(CFileIO* File, const Utils::String &filename) const;
84 cycrow 189
	Utils::String ConvertTextString(const Utils::String &text);
1 cycrow 190
	void LoadVirtualFileSystem();
182 cycrow 191
	bool checkAccessRights(const Utils::String &dir) const;
192
	bool readTextPage(const Utils::String &file, Utils::CStringList &list, bool search, int page) const;
193
	size_t loadShipData(const Utils::String& file, Utils::CStringList& list) const;
170 cycrow 194
	FileType adjustFileType(const Utils::String &name, FileType filetype) const;
35 cycrow 195
	CXspFile *extractShip(const Utils::String &sCatFile, const Utils::String &sId, CProgressInfo *progress = NULL);
182 cycrow 196
	Utils::String readShipData(const Utils::String &file, const Utils::String &entry) const;
197
	bool isSamePackage(CBaseFile *p1, CBaseFile *p2) const;
160 cycrow 198
	void ApplyFakePatchOrder(Utils::CStringList *list);
182 cycrow 199
	CBaseFile *createFromArchive(const Utils::String &filename, bool toInstall = false) const;
200
	void readArchiveData(const char *buf, size_t len, CBaseFile *archive) const;
201
	void readArchiveData(const Utils::String &filename, CBaseFile *archive) const;
202
	size_t verifyInstalledFiles(Utils::CStringList *missingFiles = nullptr, bool getPackages = true) const;
160 cycrow 203
	Utils::String empWaresForGame(size_t *maxsize = NULL);
88 cycrow 204
	void addEMPPriceOverride(int empId, int price);
205
	void addEMPNotoOverride(int empId, int noto);
206
	void addBuiltInWarePriceOverride(int empId, int price);
207
	void addBuiltInWareNotoOverride(int empId, int noto);
208
	void addCustomWarePriceOverride(const Utils::String &id, int price);
209
	void addCustomWareNotoOverride(const Utils::String &id, int noto);
1 cycrow 210
 
211
	int GetCurrentGameFlags() { return m_iGameFlags; }
212
 
158 cycrow 213
	void setCurrentDir(const Utils::String &dir);
1 cycrow 214
 
215
	// merge mods
182 cycrow 216
	void getMergedFiles(Utils::CStringList &list, CCatFile *cat1, CCatFile *cat2) const;
217
	bool canWeMerge(const Utils::String &file) const;
218
	bool mergeMods(CCatFile *mod1, CCatFile *mod2, const Utils::String &outFile, Utils::CStringList *cantMerge) const;
219
	bool needToMerge(const Utils::String &file) const;
220
	bool getModCompatabilityList(C_File *file, Utils::CStringList *list = NULL) const;
221
	bool checkCompatabilityBetweenModFiles(C_File *from, C_File *to, Utils::CStringList *list = NULL) const;
222
	bool checkCompatabilityBetweenMods(CBaseFile *from, CBaseFile *to, Utils::CStringList *list = NULL) const;
223
	int checkCompatabilityAgainstPackages(CBaseFile *newFile, Utils::CStringList *list = NULL, CLinkList<CBaseFile> *packages = NULL) const;
1 cycrow 224
 
182 cycrow 225
	Utils::String getLanguageName() const;
226
	int			  getGameLanguage() const;
227
	int			  getGameLanguage(const Utils::String &dir) const;
228
	int			  getGameAddons(Utils::CStringList &exes) const;
229
	int			  getGameAddons(Utils::CStringList &exes, const Utils::String &dir) const;
121 cycrow 230
	Utils::String getGameName() const;
231
	Utils::String getGameName(const Utils::String &dir) const;
182 cycrow 232
	Utils::String getGameVersionFromType(int game, int version, const Utils::String &sVersion) const;
233
	Utils::String getGameNameFromType(int game) const;
234
	Utils::String getGameTypesString(CBaseFile *package, bool includeVersion) const;
235
	Utils::String getGameVersionString(CBaseFile *package) const;
236
	Utils::String getGameRunExe(const Utils::String &dir) const;
237
	Utils::String getGameRunExe() const;
121 cycrow 238
	Utils::String getProperDir() const;
239
	Utils::String getProperDir(const Utils::String &dir) const;
240
	Utils::String getAddonDir() const;
241
	Utils::String getAddonDir(const Utils::String &dir) const;
1 cycrow 242
 
243
	// text files
160 cycrow 244
	void CreateLanguageTextFiles(Utils::CStringList *errors = 0);
245
	bool RenameTextFile(const Utils::String &textid, int languageid, Utils::CStringList *errors);
182 cycrow 246
	void addTextFileToScripts(C_File *file, const Utils::String &textid);
1 cycrow 247
	void CreatePluginManagerText();
87 cycrow 248
	void createPluginManagerOpenText();
1 cycrow 249
 
250
	// game control
182 cycrow 251
	void createEMPFile(const Utils::String &progDir = Utils::String::Null());
1 cycrow 252
	void CreateWareFiles();
182 cycrow 253
	int  extractGameFile(const Utils::String &aFilename, const Utils::String &aTo, const Utils::String &dir = Utils::String::Null(), const Utils::String &addon = Utils::String::Null()) const;
1 cycrow 254
	void CreateDummies();
255
	void CreateComponants();
256
	void CreateCutData();
257
	void CreateBodies();
258
	void CreateGlobals();
259
	void CreateAnimations();
260
	void CreateTShips();
261
	void CreateCustomStarts();
182 cycrow 262
	void addCreatedFile(const Utils::String &file);
88 cycrow 263
 
173 cycrow 264
	bool readGlobals(Utils::CStringList &globals) const;
89 cycrow 265
	bool readWares(int iLang, CLinkList<SWareEntry> &list);
266
	bool readCommands(int iLang, CLinkList<SCommandSlot> &list);
267
	bool readWingCommands(int iLang, CLinkList<SCommandSlot> &list);
88 cycrow 268
	int  empOveridePrice(int id);
269
	bool empOverideNoto(int id, int *noto);
270
	int  builtInWareOveridePrice(int id);
271
	bool builtInWareOverideNoto(int id, int *noto);
272
	int  customWareOveridePrice(const Utils::String &id);
273
	bool customWareOverideNoto(const Utils::String &id, int *noto);
274
	void removeEmpOverride(int pos);
275
	void removeBuiltinWareOverride(int pos);
276
	void removeCustomWareOverride(const Utils::String &id);
1 cycrow 277
 
278
	// install text
182 cycrow 279
	Utils::String getInstallBeforeText(CBaseFile *package) const;
280
	Utils::String getInstallAfterText(CBaseFile *package) const;
281
	Utils::String getUninstallBeforeText(CBaseFile *package) const;
282
	Utils::String getUninstallAfterText(CBaseFile *package) const;
1 cycrow 283
 
284
	//setting functions
285
	void SetRenameText(bool b) { m_bRenameText = b; }
286
	void SetLanguage(int i) { m_iLanguage = i; }
287
	void SetAutoEnable(bool b) { m_bAutoEnableChild = b; }
288
	void SetForceModInstall(bool b) { m_bForceModInstall = b; }
118 cycrow 289
	void setTempDirectory(const Utils::String &s) { m_sTempDir = s; }
127 cycrow 290
	void setMyDocuments(const Utils::String &s) { m_sMyDoc = s; }
1 cycrow 291
	void SetForceEMP(bool b) { m_bForceEMP = b; }
292
	void SetSurpressProtectedWarning(bool b) { m_bSurpressProtectedWarning = b; }
293
	void SurpressProtectedWarning() { m_bSurpressProtectedWarning = true; }
294
	bool IsSupressProtectedWarning() { return m_bSurpressProtectedWarning; }
295
 
296
	int GetLanguage() { return m_iLanguage; }
297
	int GetGame() { return m_iGame; }
298
	bool IsLoaded() { return m_bLoaded; }
299
	bool IsVanilla() { return m_bVanilla; }
300
	void SetVanilla(bool b);
301
 
160 cycrow 302
	const Utils::String &getMod() const { return m_sSetMod; }
303
	void setMod(const Utils::String& mod);
126 cycrow 304
	void setSaveGameManager(bool managed);
1 cycrow 305
 
306
	CBaseFile *GetEnabledMod() { return m_pEnabledMod; }
307
 
308
	//errors
309
	void ClearError() { m_iError = PKERR_NONE; }
310
	int  GetError() { return m_iError; }
311
 
164 cycrow 312
	CLinkList<CBaseFile>* PackageList() { return &m_lPackages; }
161 cycrow 313
	CLinkList<SAvailablePackage> *getAvailablePackageList() { return &m_lAvailablePackages; }
164 cycrow 314
	CLinkList<CBaseFile>* getFoundPackageList() { return &m_lFoundPackages; }
1 cycrow 315
	bool AnyAvailablePackages(int type = -1);
161 cycrow 316
	bool addAvailablePackage(SAvailablePackage *package);
166 cycrow 317
	void saveAvailablePackages();
318
	void readAvailablePackages();
161 cycrow 319
	void parseAvailablePackage(const Utils::String &str, const Utils::String &webaddress = Utils::String::Null());
320
	const SAvailablePackage* findAvailablePackage(const Utils::String& filename) const;
321
	const SAvailablePackage* findAvailablePackage(const Utils::String& name, const Utils::String& author) const;
164 cycrow 322
	CBaseFile* findFoundPackage(const Utils::String& name, const Utils::String& author) const;
162 cycrow 323
	int findAllServers(Utils::CStringList *list) const;
1 cycrow 324
 
182 cycrow 325
	CBaseFile *findScriptByAuthor(const Utils::String &author, CBaseFile *prev = NULL);
1 cycrow 326
	void RemoveFailedFiles();
327
 
328
private:
179 cycrow 329
	size_t _createCockpits(Utils::CStringList &list);
330
 
85 cycrow 331
	bool _checkForDisable(CBaseFile *package, bool disabled, CBaseFile *oldPackage);
182 cycrow 332
	CBaseFile *_archive_fromRar(const Utils::String &filename, bool toInstall) const;
333
	CBaseFile *_archive_fromZip(const Utils::String &filename, bool toInstall) const;
50 cycrow 334
	void _addToFakePatch(CBaseFile *pPackage);
56 cycrow 335
	int _gameTextNumber() const;
88 cycrow 336
	void _addWareOverride(enum WareTypes type, int pos, const Utils::String &id, int value, bool noto);
337
	int _warePriceOverride(enum WareTypes type, int pos, const Utils::String &id);
338
	bool _wareNotoOverride(enum WareTypes type, int pos, const Utils::String &id, int *noto);
339
	void _removeWareOverride(enum WareTypes type, int pos, const Utils::String &id);
43 cycrow 340
 
341
private:
158 cycrow 342
	Utils::String	m_sCurrentDir;
118 cycrow 343
	static Utils::String	m_sTempDir;
127 cycrow 344
	Utils::String			m_sMyDoc;
160 cycrow 345
	Utils::String			m_sSetMod;
346
	Utils::String			_sSaveDir;
125 cycrow 347
	GameDirectory *_pCurrentDir;
1 cycrow 348
 
349
	// global files list
350
	CLinkList<C_File>		m_lFiles;
351
	CLinkList<CBaseFile>	m_lPackages;
352
	CLinkList<C_File>		m_lUninstallFiles;
353
	CLinkList<SGameWare>	m_lGameWares[WAREBUFFERS];
354
	CLinkList<SGameShip>	m_lGameShips;
88 cycrow 355
	CLinkList<SWarePriceOverride>	m_lWarePrices;
164 cycrow 356
	CLinkList<CBaseFile>	m_lFoundPackages;
93 cycrow 357
	COriginalFiles		   *_pOriginalFiles;
1 cycrow 358
 
359
	// prepared lists
360
	CLinkList<CBaseFile>	m_lInstallList; // install/uninstalling packages
361
	CLinkList<CBaseFile>	m_lEnableList;  // enable packages
362
	CLinkList<CBaseFile>	m_lDisableList; // disable packages
363
 
160 cycrow 364
	Utils::CStringList		m_lCreatedFiles; // list of files we've created
365
	Utils::CStringList		m_lNonRemovedFiles; // list of fiels that couldn't be removed for some reason
366
	Utils::CStringList		m_lGlobals; // global settigns that we want changed
367
	Utils::CStringList		m_lFakePatchOrder; // ordered fake patches
1 cycrow 368
	CLinkList<SAvailablePackage> m_lAvailablePackages; // list of available packages online
369
 
370
	CVirtualFileSystem		m_pGameVFS; // Games Virtual File System
371
 
372
	CGameExe				m_gameExe;
56 cycrow 373
	SGameExe				*m_pCurrentGameExe;
1 cycrow 374
	CBaseFile			   *m_pEnabledMod;
375
 
376
	// settings
377
	bool		m_bRenameText;  // rename text files
378
	bool		m_bAutoEnableChild;	// auto enable all children
379
	bool		m_bForceModInstall; // allowsm ultiple mods to be installed
380
	bool		m_bOldPlugin;		// if its loading data from the old plugin manager
381
	bool		m_bLoadVFS;			// if we should load the virtual filesystem
382
	int			m_iLanguage;	// Language id to use
383
	int			m_iSaveGameManager; // Save game manager
384
	bool		m_bSurpressProtectedWarning; // prevent checking for protected directory
385
 
386
	int			m_iGame;		// the game the directory is
387
	int			m_iGameVersion; // the version of the game (version position)
160 cycrow 388
	Utils::String	m_sGameVersion; // the version of the game (full version)
1 cycrow 389
	int			m_iGameFlags;	// the flags for the game from SGameExe
390
	int			m_iMaxPatch;	// the maximum patch for the game
391
 
392
	int			m_iSaveGame;
393
	int			m_iError;
394
	int			m_iLastUpdated;
395
	int			m_iFakePatch;		// The current fake patch
396
 
397
	bool		m_bVanilla;		// currently in vanilla mode, dont allow unsigned packages to be installed
398
 
399
	bool		m_bLoaded;
400
	bool		m_bRedo;
401
	bool		m_bUsedWare;	// if we have used the ware files in the directory, not in a patch
402
	bool		m_bRemoveDir;	// shall we remove direcotires;
403
 
404
	int			m_iWareBuffer[WAREBUFFERS];	//Ware Buffers
405
	int			m_iShipBuffer; //Ship Buffers
406
 
407
	bool		m_bDisableVanilla;
408
	bool		m_bForceEMP;
409
 
410
	CListNode<CBaseFile>	*m_pPackageNode;
411
};
412
 
413
#endif // __PACKAGES_H__