Subversion Repositories spk

Rev

Rev 88 | Rev 93 | 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
 
13
enum {INSTALLERR_NONE, INSTALLERR_VERSION, INSTALLERR_INVALID, INSTALLERR_NOMULTI, INSTALLERR_NOSHIP, INSTALLERR_UNKNOWN, INSTALLERR_NOEXIST, INSTALLERR_OLD};
14
enum {INSTALLCHECK_OK, INSTALLCHECK_OLDVERSION, INSTALLCHECK_NOOTHERMOD, INSTALLCHECK_ALREADYQUEUED, INSTALLCHECK_WRONGGAME, INSTALLCHECK_WRONGVERSION, INSTALLCHECK_MODIFIED, INSTALLCHECK_NOSHIP};
15
enum {PROGRESS_ENABLEFILE, PROGRESS_SHUFFLEFAKE, PROGRESS_DISABLEFILE};
16
enum {PKERR_NONE, PKERR_NOPARENT, PKERR_MODIFIED, PKERR_MISSINGDEP, PKERR_NOOUTPUT, PKERR_DONTEXIST, PKERR_UNABLETOOPEN};
17
enum {WARETYPE_NONE, WARETYPE_DELETED, WARETYPE_ADDED, WARETYPE_DISABLED};
18
enum {WARES_BIO, WARES_ENERGY, WARES_FOOD, WARES_MINERAL, WARES_TECH, WARES_NATURAL, WAREBUFFERS};
19
 
20
#define IC_WRONGGAME		1
21
#define IC_WRONGVERSION		2
22
#define IC_OLDVERSION		4
23
#define IC_MODIFIED			8
24
#define IC_ALL				15
25
 
26
#define PMTEXTFILE 901
27
 
28
#define SHIPSTARTTEXT		500000
29
#define WARETEXTSTART		400000
30
 
31
class CFileIO;
32
 
33
tstruct SGameWare {
34
	char cType;
35
	int iType;
36
	int iText;
37
	CyString sWareName;
38
	int iPos;
39
	SWares *pWare;
40
} SGameWare;
41
 
42
tstruct SGameShip {
43
	int		  iType;
44
	int		  iText;
45
	int		  iPos;
46
	CyString  sShipID;
47
	CyString  sShipClass;
48
	CXspFile *pPackage;
49
} SGameShip;
50
 
51
tstruct SBodies {
52
	CyString	 sNumbers;
53
	CyString	 sSection;
54
	CyStringList lEntries;
55
} SBodes;
56
 
57
tstruct SAvailablePackage {
58
	CLinkList<SGameCompat> lGames;
59
	int			iType;
60
	int			iPluginType;
61
	CyString	sName;
62
	CyString	sAuthor;
63
	CyString	sVersion;
64
	CyString	sDesc;
65
	CyString	sUpdated;
66
	int			iEase;
67
	int			iChanging;
68
	int			iRec;
69
	CyString	sFilename;
70
	int			iScriptType;
71
	bool		bSigned;
72
} SAvailablePackage;
73
 
88 cycrow 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;
82
 
1 cycrow 83
class SPKEXPORT CPackages
84
{
85
public:
86
	static CyString ConvertLanguage(int lang);
87
	static SAvailablePackage *CreateAvailablePackageData(CBaseFile *package);
88
	static CyString FormatAvailablePackageData(CBaseFile *package);
89
	static CyString FormatAvailablePackageData(SAvailablePackage *package);
90
	static CyString CreateFromPackagerScript(CyString filename);
91
	static int GeneratePackageUpdateData(CyString dir, bool includeSingle = true);
92
 
93
	CPackages ();
94
	~CPackages ();
95
 
83 cycrow 96
	bool isOldDir(const Utils::String &dir);
1 cycrow 97
	bool Read ( CyString dir, CProgressInfo *progress = NULL );
98
	void Startup(CyString dir, CyString tempDir, CyString myDoc, CyString mod = NullString);
99
 
100
	CBaseFile *LoadPackagerScript(CyString filename, int compression, CyString (*askFunc)(CyString), CyStringList *malformedLines = NULL, CyStringList *unknownCommands = NULL, CyStringList *variables = NULL);
101
	CyStringList *GetGlobals() { return &m_lGlobals; }
102
	CyStringList *GetFakePatchOrder() { return &m_lFakePatchOrder; }
103
	CyString GetCurrentDirectory() { return m_sCurrentDir; }
79 cycrow 104
	static CyString GetTempDirectory() { return m_sTempDir; }
105
	static Utils::String tempDirectory() { return m_sTempDir.ToString(); }
1 cycrow 106
	CyString GetMyDocuments() { return m_sMyDoc; }
107
	CGameExe *GetGameExe() { return &m_gameExe; }
108
	CLinkList<CBaseFile> *GetInstallPackageList() { return &m_lInstallList; }
109
 
110
	// installing/uninstalling
111
	bool		InstallPackage ( CBaseFile *package, CyStringList *errors, CProgressInfo *progress = NULL, bool disabled = false );
112
	CBaseFile		*OpenPackage ( CyString file, int *error, CProgressInfo *progress = NULL, int readtype = SPKREAD_ALL, int flags = READFLAG_NONE );
113
	CMultiSpkFile	*OpenMultiPackage(CyString file, int *error, CProgressInfo *progress = NULL);
114
	bool		OpenMultiPackage ( CyString file, CLinkList<CBaseFile> *packageList, int *error, CProgressInfo *progress = NULL );
115
	int			CheckInstallPackage(CBaseFile *package, int check = IC_ALL);
116
	bool		RemoveFile(C_File *file, CyStringList *errors = NULL);
117
	void		PrepareUninstallPackage(CBaseFile *package);
118
	bool		UninstallPreparedPackages(CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *uninstalledPackages = NULL, CLinkList<CBaseFile> *disabledPackages = NULL);
119
	void		ConvertOldPackage(CBaseFile *p);
120
	void		PurgeUninstallScripts(CBaseFile *package, CyStringList *errors);
121
	int 		PrepareInstallPackage(CBaseFile *package, bool disabled = false, bool force = false, int check = IC_ALL);
122
	int			InstallPreparedPackages(CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *errored, CLinkList<CBaseFile> *installedList = NULL);
123
	void		RemovePreparedInstall(CBaseFile *package);
124
	int			GetNumPackagesInQueue() { return m_lInstallList.size(); }
125
	int			CheckOpenPackage(CyString file, int *error);
126
	int			GetMissingDependacies(CBaseFile *p, CyStringList *list, bool onlyEnabled = false, bool includePrepared = false);
127
	bool		CheckInstalledDependacy(CyString name, CyString author, CyString version, bool onlyEnabled = false, bool includePerpered = false);
128
	bool		CheckEnabledDependacy(CBaseFile *p);
129
	int			GetDependacyList(CBaseFile *package, CLinkList<CBaseFile> *list);
130
	int			PrepareMultiPackage ( CyString file, CLinkList<CBaseFile> *errorPackageList, int *error, CProgressInfo *progress = 0);
131
 
132
	bool		IsOldPluginManager() { return m_bOldPlugin; }
133
 
134
	// enable/disable
135
	bool EnablePackage ( CBaseFile *package, CyStringList *errors, CProgressInfo *progress = NULL );
136
	bool DisablePackage ( CBaseFile *package, CyStringList *errors, CProgressInfo *progress = NULL );
137
	bool DisablePreparedPackages ( CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *disabledPackages = NULL );
138
	bool PrepareEnablePackage(CBaseFile *package);
139
	bool PrepareDisablePackage(CBaseFile *package);
140
	bool EnablePreparedPackages ( CyStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *enabledPackages = NULL );
141
	int  GetNumPackagesInEnabledQueue() { return m_lEnableList.size(); }
142
	int  GetNumPackagesInDisabledQueue() { return m_lDisableList.size(); }
143
	bool PrepareDisableForVanilla();
144
	bool PrepareEnableLibrarys();
145
	bool PrepareEnableFromVanilla();
146
 
147
	void WriteData();
148
	bool CloseDir ( CyStringList *errors = 0, CProgressInfo *progress = NULL, bool removedir = false );
149
	bool RestoreFakePatch();
150
	bool ReadyFakePatch();
151
	bool CheckValidPluginManagerFile(CyString filename);
152
	bool CheckIfPluginManagerFile(CyString filename);
153
 
154
	// package control
155
	void UpdateUsedFiles(CLinkList<CBaseFile> *ignoreList = NULL, bool = true);
156
	void UpdateSigned();
157
	bool UpdatePackages(int doStatus = -1, bool individual = false);
158
	CBaseFile *FindXspPackage(CyString id);
159
	CBaseFile *FindSpkPackage(CyString name, CyString author);
160
	CArchiveFile *FindArchivePackage(CyString name);
161
	CBaseFile *FindPackage(CyString name, CyString author);
162
	CBaseFile *FindFirstPackageWithFile(C_File *f);
163
	CBaseFile *FindNextPackageWithFile(CBaseFile *p, C_File *f);
164
	CBaseFile *FindPackage(CBaseFile *package);
165
	C_File *FindFile(int filetype, CyString filename, CyString dir = NullString);
166
	CBaseFile *FirstPackage() { return m_lPackages.First(); }
167
	CBaseFile *NextPackage() { return m_lPackages.Next(); }
168
	CBaseFile *GetFirstPackage() { if ( m_lPackages.Front() ) return m_lPackages.Front()->Data(); return NULL; }
169
	CBaseFile *GetNextPackage(CBaseFile *from) 
170
	{ 
171
		bool found = false;
172
		for ( CListNode<CBaseFile> *node = m_lPackages.Front(); node; node = node->next() )
173
		{
174
			if ( !node->Data() ) continue;
175
			if ( node->Data() == from )
176
				found = true;
177
			else if ( found )
178
				return node->Data();
179
		}
180
		return NULL; 
181
	}
182
	void Reset();
183
	CBaseFile *GetPackageAt(int i) { return m_lPackages[i]; }
184
	CyString GetSelectedModName();
185
	CyString GetModKey();
186
	void SetupWares();
187
	void SetupShips();
188
	void PurgeGameObjects();
189
	void PurgeWares();
190
	void PurgeShips();
191
	void StartPackage() { m_pPackageNode = m_lPackages.Front(); }
192
	void UpdatePackage(CBaseFile *p);
193
	CBaseFile *GetCurrentPackage() { return (m_pPackageNode) ? m_pPackageNode->Data() : NULL; }
194
	bool RemoveCurrentDirectory();
195
	void RemoveCreatedFiles();
196
	bool AnyUnusedShared();
197
 
198
	// util functions
199
	void RemoveUnusedDirectories(CyStringList &dirs, CyStringList *errors = NULL);
200
	int  RemoveUninstallScripts(CyStringList *errors = 0, CProgressInfo *progress = NULL);
201
	bool RemoveUninstallFile(C_File *file, CyStringList *errors = 0);
202
	int  RemoveUnusedSharedFiles(CyStringList *errors = 0, CProgressInfo *progress = NULL);
203
	bool RemoveSharedFile(C_File *file, CyStringList *errors = NULL);
204
	void ShufflePatchTo(C_File *file, int to, CyStringList *errors);
205
	void ShuffleFakePatches(CyStringList *errors);
206
	void ShuffleTextFiles(CyStringList *errors);
207
	int  FindNextFakePatch(int start = 0, CyString dir = NullString);
208
	int  FindNextTextFile(int start = 2, CyString dir = NullString);
209
	int  FindLastFakePatch(int start = 99, CyString dir = NullString);
210
	int  FindLastTextFile(int start = 9999, CyString dir = NullString);
211
	int  FindLowestFakePatchInstalled();
212
	void ReadGameLanguage(bool force = true);
213
	int	 RemoveAllPackages(CyStringList *errors = NULL, CProgressInfo *progress = NULL);
214
	void AssignPackageNumbers();
215
	int  GetChildPackages(CBaseFile *package, CLinkList<CBaseFile> *children, bool recursive = false);
216
	int  GetAllPackageFiles(CBaseFile *package, CLinkList<C_File> *fileList, bool includeChild);
217
	int	 GetAllPackageFiles(CLinkList<CBaseFile> *list, CLinkList<C_File> *fileList, bool includeChild);
218
	void AddLogEntry(int type, CyString args, CyStringList *errors);
219
	CyString FindDataDir(CyString dir, CyString file);
220
	int  CountPackages(int type, bool onlyEnabled);
221
	int  CountBuiltInPackages(bool onlyEnabled);
222
	bool IsCurrentDir(CyString dir);
223
	bool CheckOtherPackage(CBaseFile *package);
224
	int CheckPreparedInstallRequired(CLinkList<CBaseFile> *list);
225
	static int ConvertWareType(char w);
226
	static char ConvertWareTypeBack(int w);
227
	CyString GetLogDirectory();
228
	CyString GetLogDirectory(CyString gameExe);
229
	CyString GetSaveDirectory();
230
	void BackupSaves() { BackupSaves(m_bVanilla); }
231
	void BackupSaves(bool vanilla);
232
	void RestoreSaves() { RestoreSaves(m_bVanilla); }
233
	void RestoreSaves(bool vanilla);
234
	bool UnPackFile(CyString filename, bool checkxml = true);
235
	bool PackFile(CyString filename);
236
	bool PackFile(CFileIO *File, CyString filename);
84 cycrow 237
	Utils::String ConvertTextString(const Utils::String &text);
1 cycrow 238
	void LoadVirtualFileSystem();
239
	bool CheckAccessRights(CyString dir);
240
	bool LoadShipData(CyString file, CyStringList *list);
35 cycrow 241
	bool LoadShipData(CVirtualFileSystem *pVfs, CyStringList *list);
1 cycrow 242
	bool ReadTextPage(CyString file, CyStringList *list, bool search, int page);
243
	CyStringList *LoadShipData(CyString file);
244
	CyStringList *ReadTextPage(CyString file, bool search, int page);
245
	int AdjustFileType(CyString name, int filetype);
35 cycrow 246
	CXspFile *extractShip(const Utils::String &sCatFile, const Utils::String &sId, CProgressInfo *progress = NULL);
1 cycrow 247
	CyString ReadShipData(CyString file, CyString entry);
248
	bool IsSamePackage(CBaseFile *p1, CBaseFile *p2);
249
	void ApplyFakePatchOrder(CyStringList *list);
250
	CBaseFile *CreateFromArchive(CyString filename, bool toInstall = false );
251
	void ReadArchiveData(const char *buf, size_t len, CBaseFile *archive);
252
	void ReadArchiveData(CyString filename, CBaseFile *archive);
253
	int VerifyInstalledFiles(CyStringList *missingFiles = NULL, bool getPackages = true);
88 cycrow 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);
1 cycrow 261
 
262
	int GetCurrentGameFlags() { return m_iGameFlags; }
263
 
264
	void SetCurrentDir(CyString dir) { m_sCurrentDir = dir; }
265
 
266
	// merge mods
267
	CyStringList *GetMergedFiles(CCatFile *cat1, CCatFile *cat2);
58 cycrow 268
	bool CanWeMerge(const Utils::String &file) const;
1 cycrow 269
	bool MergeMods(CCatFile *mod1, CCatFile *mod2, CyString outFile, CyStringList *cantMerge);
270
	bool NeedToMerge(CyString file);
271
	CyStringList MergeTextFiles(CyStringList *files, CCatFile *mod1, CCatFile *mod2);
272
	bool GetModCompatabilityList(C_File *file, CyStringList *list = NULL);
273
	bool CheckCompatabilityBetweenModFiles(C_File *from, C_File *to, CyStringList *list = NULL);
274
	bool CheckCompatabilityBetweenMods(CBaseFile *from, CBaseFile *to, CyStringList *list = NULL);
275
	int CheckCompatabilityAgainstPackages(CBaseFile *newFile, CyStringList *list = NULL, CLinkList<CBaseFile> *packages = NULL);
276
 
277
	CyString GetLanguageName();
278
 
279
	int	GetGameLanguage(CyString dir = NullString);
280
	int      GetGameAddons(CyStringList &exes, CyString dir = NullString);
281
	CyString GetGameName(CyString dir = NullString);
282
	CyString GetGameVersionFromType(int game, int version, CyString sVersion);
283
	CyString GetGameNameFromType(int game);
284
	CyString GetGameTypesString(CBaseFile *package, bool includeVersion);
285
	CyString GetGameVersionString(CBaseFile *package);
286
	CyString GetGameRunExe(CyString dir = NullString);
287
	CyString GetProperDir(CyString dir = NullString);
288
	CyString GetAddonDir(CyString dir = NullString);
289
 
290
	// text files
291
	void CreateLanguageTextFiles(CyStringList *errors = 0);
292
	bool RenameTextFile(CyString textid, int languageid, CyStringList *errors);
293
	void AddTextFileToScripts(C_File *file, CyString textid);
294
	void CreatePluginManagerText();
87 cycrow 295
	void createPluginManagerOpenText();
1 cycrow 296
 
297
	// game control
65 cycrow 298
	void CreateEMPFile(CyString progDir = NullString);
1 cycrow 299
	void CreateWareFiles();
300
	int ExtractGameFile(CyString aFilename, CyString aTo, CyString dir = NullString, CyString addon = NullString);
301
	void CreateDummies();
302
	void CreateComponants();
303
	void CreateCutData();
304
	void CreateBodies();
305
	void CreateGlobals();
306
	void CreateAnimations();
307
	void CreateTShips();
308
	CyStringList *CreateCockpits();
309
	void CreateCustomStarts();
310
	void AddCreatedFile(CyString file);
88 cycrow 311
 
1 cycrow 312
	bool ReadGlobals(CyStringList &globals);
89 cycrow 313
	bool readWares(int iLang, CLinkList<SWareEntry> &list);
314
	bool readCommands(int iLang, CLinkList<SCommandSlot> &list);
315
	bool readWingCommands(int iLang, CLinkList<SCommandSlot> &list);
88 cycrow 316
	int  empOveridePrice(int id);
317
	bool empOverideNoto(int id, int *noto);
318
	int  builtInWareOveridePrice(int id);
319
	bool builtInWareOverideNoto(int id, int *noto);
320
	int  customWareOveridePrice(const Utils::String &id);
321
	bool customWareOverideNoto(const Utils::String &id, int *noto);
322
	void removeEmpOverride(int pos);
323
	void removeBuiltinWareOverride(int pos);
324
	void removeCustomWareOverride(const Utils::String &id);
1 cycrow 325
 
326
	// install text
327
	CyString GetInstallBeforeText(CBaseFile *package);
328
	CyString GetInstallAfterText(CBaseFile *package);
329
	CyString GetUninstallBeforeText(CBaseFile *package);
330
	CyString GetUninstallAfterText(CBaseFile *package);
331
 
332
	// original files
333
	void StoreOriginalFiles(int filetype, CyString searchPath);
334
	void AddOriginalFile(int filetype, CyString filename, CyString searchPath);
335
	C_File *GetOriginalFile(C_File *file);
336
	bool IsOriginalFile(C_File *file);
337
	bool BackupOriginalFile(C_File *f, CyStringList *errors);
338
 
339
	//setting functions
340
	void SetRenameText(bool b) { m_bRenameText = b; }
341
	void SetLanguage(int i) { m_iLanguage = i; }
342
	void SetAutoEnable(bool b) { m_bAutoEnableChild = b; }
343
	void SetForceModInstall(bool b) { m_bForceModInstall = b; }
344
	void SetTempDirectory(CyString s) { m_sTempDir = s; }
345
	void SetMyDocuments(CyString s) { m_sMyDoc = s; }
346
	void SetForceEMP(bool b) { m_bForceEMP = b; }
347
	void SetSurpressProtectedWarning(bool b) { m_bSurpressProtectedWarning = b; }
348
	void SurpressProtectedWarning() { m_bSurpressProtectedWarning = true; }
349
	bool IsSupressProtectedWarning() { return m_bSurpressProtectedWarning; }
350
 
351
	int GetLanguage() { return m_iLanguage; }
352
	int GetGame() { return m_iGame; }
353
	bool IsLoaded() { return m_bLoaded; }
354
	bool IsVanilla() { return m_bVanilla; }
355
	void SetVanilla(bool b);
356
 
357
	CyString GetSetMod() { return m_sSetMod; }
358
	void SetMod(CyString mod) { 
359
		if ( mod != "PluginManager" )
360
			m_sSetMod = mod; 
361
	}
362
 
363
	CBaseFile *GetEnabledMod() { return m_pEnabledMod; }
364
 
365
	//errors
366
	void ClearError() { m_iError = PKERR_NONE; }
367
	int  GetError() { return m_iError; }
368
 
369
	CLinkList<CBaseFile> *PackageList() { return &m_lPackages; }
370
	CLinkList<SAvailablePackage> *GetAvailablePackageList() { return &m_lAvailablePackages; }
371
	bool AnyAvailablePackages(int type = -1);
372
	bool AddAvailablePackage(SAvailablePackage *package);
373
	void ParseAvailablePackage(CyString str, CyString webaddress = NullString);
374
	SAvailablePackage *FindAvailablePackage(CyString &filename);
375
	int FindAllServers(CyStringList *list);
376
 
377
	CBaseFile *FindScriptByAuthor(CyString author, CBaseFile *prev = NULL);
378
	void RemoveFailedFiles();
379
 
380
private:
85 cycrow 381
	bool _checkForDisable(CBaseFile *package, bool disabled, CBaseFile *oldPackage);
43 cycrow 382
	CBaseFile *_archive_fromRar(CyString filename, bool toInstall);
383
	CBaseFile *_archive_fromZip(CyString filename, bool toInstall);
50 cycrow 384
	void _addToFakePatch(CBaseFile *pPackage);
56 cycrow 385
	int _gameTextNumber() const;
88 cycrow 386
	void _addWareOverride(enum WareTypes type, int pos, const Utils::String &id, int value, bool noto);
387
	int _warePriceOverride(enum WareTypes type, int pos, const Utils::String &id);
388
	bool _wareNotoOverride(enum WareTypes type, int pos, const Utils::String &id, int *noto);
389
	void _removeWareOverride(enum WareTypes type, int pos, const Utils::String &id);
43 cycrow 390
 
391
private:
1 cycrow 392
	CyString	m_sCurrentDir;
79 cycrow 393
	static CyString	m_sTempDir;
1 cycrow 394
	CyString	m_sMyDoc;
395
	CyString	m_sSetMod;
396
	CyString	m_sActiveDir;
397
 
398
	// global files list
399
	CLinkList<C_File>		m_lFiles;
400
	CLinkList<CBaseFile>	m_lPackages;
401
	CLinkList<C_File>		m_lUninstallFiles;
402
	CLinkList<C_File>		m_lOriginalFiles;
403
	CLinkList<SGameWare>	m_lGameWares[WAREBUFFERS];
404
	CLinkList<SGameShip>	m_lGameShips;
88 cycrow 405
	CLinkList<SWarePriceOverride>	m_lWarePrices;
1 cycrow 406
 
407
	// prepared lists
408
	CLinkList<CBaseFile>	m_lInstallList; // install/uninstalling packages
409
	CLinkList<CBaseFile>	m_lEnableList;  // enable packages
410
	CLinkList<CBaseFile>	m_lDisableList; // disable packages
411
 
412
	CyStringList			m_lCreatedFiles; // list of files we've created
413
	CyStringList			m_lNonRemovedFiles; // list of fiels that couldn't be removed for some reason
414
	CyStringList			m_lGlobals; // global settigns that we want changed
415
	CyStringList			m_lFakePatchOrder; // ordered fake patches
416
	CLinkList<SAvailablePackage> m_lAvailablePackages; // list of available packages online
417
 
418
	CVirtualFileSystem		m_pGameVFS; // Games Virtual File System
419
 
420
	CGameExe				m_gameExe;
56 cycrow 421
	SGameExe				*m_pCurrentGameExe;
1 cycrow 422
	CBaseFile			   *m_pEnabledMod;
423
 
424
	// settings
425
	bool		m_bRenameText;  // rename text files
426
	bool		m_bAutoEnableChild;	// auto enable all children
427
	bool		m_bForceModInstall; // allowsm ultiple mods to be installed
428
	bool		m_bOldPlugin;		// if its loading data from the old plugin manager
429
	bool		m_bLoadVFS;			// if we should load the virtual filesystem
430
	int			m_iLanguage;	// Language id to use
431
	int			m_iSaveGameManager; // Save game manager
432
	bool		m_bSurpressProtectedWarning; // prevent checking for protected directory
433
 
434
	int			m_iGame;		// the game the directory is
435
	int			m_iGameVersion; // the version of the game (version position)
436
	CyString	m_sGameVersion; // the version of the game (full version)
437
	int			m_iGameFlags;	// the flags for the game from SGameExe
438
	int			m_iMaxPatch;	// the maximum patch for the game
439
 
440
	int			m_iSaveGame;
441
	int			m_iError;
442
	int			m_iLastUpdated;
443
	int			m_iFakePatch;		// The current fake patch
444
 
445
	bool		m_bVanilla;		// currently in vanilla mode, dont allow unsigned packages to be installed
446
 
447
	bool		m_bLoaded;
448
	bool		m_bRedo;
449
	bool		m_bUsedWare;	// if we have used the ware files in the directory, not in a patch
450
	bool		m_bRemoveDir;	// shall we remove direcotires;
451
 
452
	int			m_iWareBuffer[WAREBUFFERS];	//Ware Buffers
453
	int			m_iShipBuffer; //Ship Buffers
454
 
455
	bool		m_bDisableVanilla;
456
	bool		m_bForceEMP;
457
 
458
	CListNode<CBaseFile>	*m_pPackageNode;
459
};
460
 
461
#endif // __PACKAGES_H__