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