Line 23... |
Line 23... |
23 |
class SPKEXPORT CPackages
|
23 |
class SPKEXPORT CPackages
|
24 |
{
|
24 |
{
|
25 |
public:
|
25 |
public:
|
26 |
static Utils::String ConvertLanguage(int lang);
|
26 |
static Utils::String ConvertLanguage(int lang);
|
27 |
static SAvailablePackage *CreateAvailablePackageData(CBaseFile *package);
|
27 |
static SAvailablePackage *CreateAvailablePackageData(CBaseFile *package);
|
28 |
static Utils::String FormatAvailablePackageData(CBaseFile *package);
|
28 |
static Utils::WString FormatAvailablePackageData(CBaseFile *package);
|
29 |
static Utils::String FormatAvailablePackageData(SAvailablePackage *package);
|
29 |
static Utils::WString FormatAvailablePackageData(SAvailablePackage *package);
|
30 |
static Utils::String CreateFromPackagerScript(CPackages *packages, const Utils::String &filename);
|
30 |
static Utils::WString CreateFromPackagerScript(CPackages *packages, const Utils::WString &filename);
|
31 |
static int GeneratePackageUpdateData(const Utils::String &dir, bool includeSingle = true);
|
31 |
static int GeneratePackageUpdateData(const Utils::WString &dir, bool includeSingle = true);
|
32 |
|
32 |
|
33 |
CPackages ();
|
33 |
CPackages ();
|
34 |
~CPackages ();
|
34 |
~CPackages ();
|
35 |
|
35 |
|
36 |
bool isOldDir(const Utils::String &dir);
|
36 |
bool isOldDir(const Utils::String &dir);
|
37 |
bool read(const Utils::String &dir, CProgressInfo *progress = NULL);
|
37 |
bool read(const Utils::WString &dir, CProgressInfo *progress = NULL);
|
38 |
void startup(const Utils::String &dir, const Utils::String &tempDir, const Utils::String &myDoc);
|
38 |
void startup(const Utils::WString &dir, const Utils::WString &tempDir, const Utils::WString &myDoc);
|
39 |
void startup(const Utils::String &dir, const Utils::String &tempDir, const Utils::String &myDoc, const Utils::String &mod);
|
39 |
void startup(const Utils::WString &dir, const Utils::WString &tempDir, const Utils::WString &myDoc, const Utils::WString &mod);
|
40 |
|
40 |
|
41 |
bool extractAll(CBaseFile *baseFile, const Utils::String &dir, int game, bool includedir = true, CProgressInfo *progress = NULL) const;
|
41 |
bool extractAll(CBaseFile *baseFile, const Utils::String &dir, int game, bool includedir = true, CProgressInfo *progress = NULL) const;
|
42 |
bool generatePackagerScript(CBaseFile *baseFile, bool wildcard, Utils::CStringList *list, int game, bool datafile = false) const;
|
42 |
bool generatePackagerScript(CBaseFile *baseFile, bool wildcard, Utils::CStringList *list, int game, bool datafile = false) const;
|
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);
|
43 |
CBaseFile *loadPackagerScript(const Utils::WString &filename, int compression, Utils::WString (*askFunc)(const Utils::WString &), Utils::WStringList *malformedLines = NULL, Utils::WStringList *unknownCommands = NULL, Utils::WStringList *variables = NULL, CProgressInfo *progress = NULL);
|
44 |
Utils::CStringList &GetGlobals() { return m_lGlobals; }
|
44 |
Utils::WStringList &getGlobals() { return _lGlobals; }
|
45 |
Utils::CStringList &GetFakePatchOrder() { return m_lFakePatchOrder; }
|
45 |
Utils::WStringList &getFakePatchOrder() { return _lFakePatchOrder; }
|
46 |
Utils::String getCurrentDirectory() const;
|
46 |
Utils::WString getCurrentDirectory() const;
|
47 |
static const Utils::String &tempDirectory() { return m_sTempDir; }
|
47 |
static const Utils::WString &tempDirectory() { return m_sTempDir; }
|
48 |
const Utils::String &myDocuments() { return m_sMyDoc; }
|
48 |
const Utils::WString &myDocuments() { return m_sMyDoc; }
|
49 |
CGameExe *GetGameExe() { return &m_gameExe; }
|
49 |
CGameExe *GetGameExe() { return &m_gameExe; }
|
50 |
CLinkList<CBaseFile> *GetInstallPackageList() { return &m_lInstallList; }
|
50 |
CLinkList<CBaseFile> *GetInstallPackageList() { return &m_lInstallList; }
|
51 |
|
51 |
|
52 |
// installing/uninstalling
|
52 |
// installing/uninstalling
|
53 |
bool installPackage(CBaseFile *package, Utils::CStringList *errors, CProgressInfo *progress = NULL, bool disabled = false);
|
53 |
bool installPackage(CBaseFile *package, Utils::WStringList *errors, CProgressInfo *progress = NULL, bool disabled = false);
|
54 |
CBaseFile *openPackage(const Utils::String &file, int *error, CProgressInfo *progress = NULL, int readtype = SPKREAD_ALL, int flags = READFLAG_NONE);
|
54 |
CBaseFile *openPackage(const Utils::WString &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);
|
55 |
CMultiSpkFile *openMultiPackage(const Utils::WString &file, int *error, CProgressInfo *progress = NULL);
|
56 |
bool openMultiPackage(const Utils::String &file, CLinkList<CBaseFile> *packageList, int *error, CProgressInfo *progress = NULL );
|
56 |
bool openMultiPackage(const Utils::WString &file, CLinkList<CBaseFile> *packageList, int *error, CProgressInfo *progress = NULL );
|
57 |
int CheckInstallPackage(CBaseFile *package, int check = IC_ALL);
|
57 |
int CheckInstallPackage(CBaseFile *package, int check = IC_ALL);
|
58 |
bool removeFile(C_File *file, Utils::CStringList *errors = NULL);
|
58 |
bool removeFile(C_File *file, Utils::WStringList *errors = NULL);
|
59 |
void PrepareUninstallPackage(CBaseFile *package);
|
59 |
void PrepareUninstallPackage(CBaseFile *package);
|
60 |
bool uninstallPreparedPackages(Utils::CStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *uninstalledPackages = NULL, CLinkList<CBaseFile> *disabledPackages = NULL);
|
60 |
bool uninstallPreparedPackages(Utils::WStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *uninstalledPackages = NULL, CLinkList<CBaseFile> *disabledPackages = NULL);
|
61 |
void ConvertOldPackage(CBaseFile *p);
|
61 |
void ConvertOldPackage(CBaseFile *p);
|
62 |
void purgeUninstallScripts(CBaseFile *package, Utils::CStringList *errors);
|
62 |
void purgeUninstallScripts(CBaseFile *package, Utils::WStringList *errors);
|
63 |
int PrepareInstallPackage(CBaseFile *package, bool disabled = false, bool force = false, int check = IC_ALL);
|
63 |
int PrepareInstallPackage(CBaseFile *package, bool disabled = false, bool force = false, int check = IC_ALL);
|
64 |
int installPreparedPackages(Utils::CStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *errored, CLinkList<CBaseFile> *installedList = NULL);
|
64 |
int installPreparedPackages(Utils::WStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *errored, CLinkList<CBaseFile> *installedList = NULL);
|
65 |
void RemovePreparedInstall(CBaseFile *package);
|
65 |
void RemovePreparedInstall(CBaseFile *package);
|
66 |
int GetNumPackagesInQueue() { return m_lInstallList.size(); }
|
66 |
int GetNumPackagesInQueue() { return m_lInstallList.size(); }
|
67 |
int checkOpenPackage(const Utils::String &file, int* error);
|
67 |
int checkOpenPackage(const Utils::WString &file, int* error);
|
68 |
bool findAllNeededDependacies(CBaseFile *p, const CLinkList<CBaseFile> &packages, CLinkList<CBaseFile> *foundPackages, bool onlyEnabled = false, bool includePrepared = false) const;
|
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);
|
69 |
int GetMissingDependacies(CBaseFile *p, Utils::CStringList *list, bool onlyEnabled = false, bool includePrepared = false);
|
70 |
size_t getDownloadableDependacies(CBaseFile* p, std::vector<const SAvailablePackage*>& list, bool onlyEnabled = false, bool includePrepared = false) const;
|
70 |
size_t getDownloadableDependacies(CBaseFile* p, std::vector<const SAvailablePackage*>& list, bool onlyEnabled = false, bool includePrepared = false) const;
|
71 |
bool checkInstalledDependacy(const Utils::String &name, const Utils::String &author, const Utils::String &version, bool onlyEnabled = false, bool includePerpered = false) const;
|
71 |
bool checkInstalledDependacy(const Utils::String &name, const Utils::String &author, const Utils::String &version, bool onlyEnabled = false, bool includePerpered = false) const;
|
72 |
bool CheckEnabledDependacy(CBaseFile *p);
|
72 |
bool CheckEnabledDependacy(CBaseFile *p);
|
73 |
int GetDependacyList(CBaseFile *package, CLinkList<CBaseFile> *list);
|
73 |
int GetDependacyList(CBaseFile *package, CLinkList<CBaseFile> *list);
|
74 |
int prepareMultiPackage(const Utils::String &file, CLinkList<CBaseFile> *errorPackageList, int *error, CProgressInfo *progress = 0);
|
74 |
int prepareMultiPackage(const Utils::String &file, CLinkList<CBaseFile> *errorPackageList, int *error, CProgressInfo *progress = 0);
|
75 |
|
75 |
|
76 |
bool IsOldPluginManager() { return m_bOldPlugin; }
|
76 |
bool IsOldPluginManager() { return m_bOldPlugin; }
|
77 |
int findPackageFiles(CLinkList<CBaseFile> &packages, const Utils::String &dir);
|
77 |
int findPackageFiles(CLinkList<CBaseFile> &packages, const Utils::WString &dir);
|
78 |
int findPackageDirectories(CLinkList<CBaseFile> &packages, const Utils::String &dir);
|
78 |
int findPackageDirectories(CLinkList<CBaseFile> &packages, const Utils::WString &dir);
|
79 |
int findAllPackages(CLinkList<CBaseFile> &packages, const Utils::String &dir);
|
79 |
int findAllPackages(CLinkList<CBaseFile> &packages, const Utils::WString &dir);
|
80 |
size_t updateFoundPackages(const Utils::String& dir);
|
80 |
size_t updateFoundPackages(const Utils::WString& dir);
|
81 |
size_t addFoundPackages(const Utils::String& dir);
|
81 |
size_t addFoundPackages(const Utils::WString& dir);
|
82 |
|
82 |
|
83 |
// enable/disable
|
83 |
// enable/disable
|
84 |
bool enablePackage(CBaseFile *package, Utils::CStringList *errors, CProgressInfo *progress = NULL );
|
84 |
bool enablePackage(CBaseFile *package, Utils::WStringList *errors, CProgressInfo *progress = NULL );
|
85 |
bool disablePackage(CBaseFile *package, Utils::CStringList *errors, CProgressInfo *progress = NULL );
|
85 |
bool disablePackage(CBaseFile *package, Utils::WStringList *errors, CProgressInfo *progress = NULL );
|
86 |
bool disablePreparedPackages(Utils::CStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *disabledPackages = NULL );
|
86 |
bool disablePreparedPackages(Utils::WStringList *errors, CProgressInfo *progress, CLinkList<CBaseFile> *disabledPackages = NULL );
|
87 |
bool enablePreparedPackages(Utils::CStringList* errors, CProgressInfo* progress, CLinkList<CBaseFile>* enabledPackages = NULL);
|
87 |
bool enablePreparedPackages(Utils::WStringList* errors, CProgressInfo* progress, CLinkList<CBaseFile>* enabledPackages = NULL);
|
88 |
bool PrepareEnablePackage(CBaseFile *package);
|
88 |
bool PrepareEnablePackage(CBaseFile *package);
|
89 |
bool PrepareDisablePackage(CBaseFile *package);
|
89 |
bool PrepareDisablePackage(CBaseFile *package);
|
90 |
int GetNumPackagesInEnabledQueue() { return m_lEnableList.size(); }
|
90 |
int GetNumPackagesInEnabledQueue() { return m_lEnableList.size(); }
|
91 |
int GetNumPackagesInDisabledQueue() { return m_lDisableList.size(); }
|
91 |
int GetNumPackagesInDisabledQueue() { return m_lDisableList.size(); }
|
92 |
bool PrepareDisableForVanilla();
|
92 |
bool PrepareDisableForVanilla();
|
93 |
bool PrepareEnableLibrarys();
|
93 |
bool PrepareEnableLibrarys();
|
94 |
bool PrepareEnableFromVanilla();
|
94 |
bool PrepareEnableFromVanilla();
|
95 |
|
95 |
|
96 |
void WriteData();
|
96 |
void WriteData();
|
97 |
bool closeDir(Utils::CStringList *errors = 0, CProgressInfo *progress = NULL, bool removedir = false);
|
97 |
bool closeDir(Utils::WStringList *errors = 0, CProgressInfo *progress = NULL, bool removedir = false);
|
98 |
bool RestoreFakePatch();
|
98 |
bool RestoreFakePatch();
|
99 |
bool ReadyFakePatch();
|
99 |
bool ReadyFakePatch();
|
100 |
bool checkValidPluginManagerFile(const Utils::String &filename) const;
|
100 |
bool checkValidPluginManagerFile(const Utils::WString &filename) const;
|
101 |
bool checkIfPluginManagerFile(const Utils::String &filename) const;
|
101 |
bool checkIfPluginManagerFile(const Utils::WString &filename) const;
|
102 |
|
102 |
|
103 |
// package control
|
103 |
// package control
|
104 |
void UpdateUsedFiles(CLinkList<CBaseFile> *ignoreList = NULL, bool = true);
|
104 |
void UpdateUsedFiles(CLinkList<CBaseFile> *ignoreList = NULL, bool = true);
|
105 |
void UpdateSigned();
|
105 |
void UpdateSigned();
|
106 |
bool UpdatePackages(int doStatus = -1, bool individual = false);
|
106 |
bool UpdatePackages(int doStatus = -1, bool individual = false);
|
107 |
CBaseFile *findXspPackage(const Utils::String &id) const;
|
107 |
CBaseFile *findXspPackage(const Utils::String &id) const;
|
108 |
CBaseFile *findSpkPackage(const Utils::String &name, const Utils::String &author) const;
|
108 |
CBaseFile *findSpkPackage(const Utils::String &name, const Utils::String &author) const;
|
109 |
CArchiveFile *findArchivePackage(const Utils::String &name) const;
|
109 |
CArchiveFile *findArchivePackage(const Utils::String &name) const;
|
110 |
CBaseFile* findPackage(const Utils::String &name, const Utils::String &author) const;
|
110 |
CBaseFile* findPackage(const Utils::WString &name, const Utils::WString &author) const;
|
111 |
CBaseFile *findFirstPackageWithFile(C_File *f) const;
|
111 |
CBaseFile *findFirstPackageWithFile(C_File *f) const;
|
112 |
CBaseFile *findNextPackageWithFile(CBaseFile *p, C_File *f) const;
|
112 |
CBaseFile *findNextPackageWithFile(CBaseFile *p, C_File *f) const;
|
113 |
CBaseFile *findPackage(CBaseFile *package) 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;
|
114 |
C_File *findFile(FileType filetype, const Utils::WString &filename, const Utils::WString &dir = Utils::WString::Null()) const;
|
115 |
CBaseFile *FirstPackage() { return m_lPackages.First(); }
|
115 |
CBaseFile *FirstPackage() { return m_lPackages.First(); }
|
116 |
CBaseFile *NextPackage() { return m_lPackages.Next(); }
|
116 |
CBaseFile *NextPackage() { return m_lPackages.Next(); }
|
117 |
CBaseFile *GetFirstPackage() { if ( m_lPackages.Front() ) return m_lPackages.Front()->Data(); return NULL; }
|
117 |
CBaseFile *GetFirstPackage() { if ( m_lPackages.Front() ) return m_lPackages.Front()->Data(); return NULL; }
|
118 |
CBaseFile *GetNextPackage(CBaseFile *from)
|
118 |
CBaseFile *GetNextPackage(CBaseFile *from)
|
119 |
{
|
119 |
{
|
Line 128... |
Line 128... |
128 |
}
|
128 |
}
|
129 |
return NULL;
|
129 |
return NULL;
|
130 |
}
|
130 |
}
|
131 |
void Reset();
|
131 |
void Reset();
|
132 |
CBaseFile *GetPackageAt(int i) { return m_lPackages[i]; }
|
132 |
CBaseFile *GetPackageAt(int i) { return m_lPackages[i]; }
|
133 |
Utils::String selectedModName() const;
|
133 |
Utils::WString selectedModName() const;
|
134 |
Utils::String getModKey() const;
|
134 |
Utils::WString getModKey() const;
|
135 |
void SetupWares();
|
135 |
void SetupWares();
|
136 |
void SetupShips();
|
136 |
void SetupShips();
|
137 |
void PurgeGameObjects();
|
137 |
void PurgeGameObjects();
|
138 |
void PurgeWares();
|
138 |
void PurgeWares();
|
139 |
void PurgeShips();
|
139 |
void PurgeShips();
|
Line 143... |
Line 143... |
143 |
bool RemoveCurrentDirectory();
|
143 |
bool RemoveCurrentDirectory();
|
144 |
void RemoveCreatedFiles();
|
144 |
void RemoveCreatedFiles();
|
145 |
bool AnyUnusedShared();
|
145 |
bool AnyUnusedShared();
|
146 |
|
146 |
|
147 |
// util functions
|
147 |
// util functions
|
148 |
void removeUnusedDirectories(const Utils::CStringList &dirs, Utils::CStringList* errors = NULL);
|
148 |
void removeUnusedDirectories(const Utils::WStringList &dirs, Utils::WStringList* errors = NULL);
|
149 |
int removeUninstallScripts(Utils::CStringList *errors = 0, CProgressInfo *progress = NULL);
|
149 |
int removeUninstallScripts(Utils::WStringList *errors = 0, CProgressInfo *progress = NULL);
|
150 |
bool removeUninstallFile(C_File *file, Utils::CStringList *errors = 0);
|
150 |
bool removeUninstallFile(C_File *file, Utils::WStringList *errors = 0);
|
151 |
int removeUnusedSharedFiles(Utils::CStringList *errors = 0, CProgressInfo *progress = NULL);
|
151 |
int removeUnusedSharedFiles(Utils::WStringList *errors = 0, CProgressInfo *progress = NULL);
|
152 |
bool removeSharedFile(C_File *file, Utils::CStringList *errors = NULL);
|
152 |
bool removeSharedFile(C_File *file, Utils::WStringList *errors = NULL);
|
153 |
void shufflePatchTo(C_File *file, int to, Utils::CStringList *errors);
|
153 |
void shufflePatchTo(C_File *file, int to, Utils::WStringList *errors);
|
154 |
void shuffleFakePatches(Utils::CStringList *errors);
|
154 |
void shuffleFakePatches(Utils::WStringList *errors);
|
155 |
void shuffleTextFiles(Utils::CStringList *errors);
|
155 |
void shuffleTextFiles(Utils::WStringList *errors);
|
156 |
int findNextFakePatch(int start = 0, const Utils::String &dir = Utils::String::Null()) const;
|
156 |
int findNextFakePatch(int start = 0, const Utils::WString &dir = Utils::WString::Null()) const;
|
157 |
unsigned int findNextTextFile(unsigned int start = 4) const;
|
157 |
unsigned int findNextTextFile(unsigned int start = 4) const;
|
158 |
unsigned int findNextTextFile(const Utils::String &dir, unsigned int start = 4) const;
|
158 |
unsigned int findNextTextFile(const Utils::WString &dir, unsigned int start = 4) const;
|
159 |
int findLastFakePatch(int start = 99, const Utils::String &dir = Utils::String::Null()) const;
|
159 |
int findLastFakePatch(int start = 99, const Utils::WString &dir = Utils::WString::Null()) const;
|
160 |
int findLastTextFile(int start = 9999, const Utils::String &dir = Utils::String::Null()) const;
|
160 |
int findLastTextFile(int start = 9999, const Utils::WString &dir = Utils::WString::Null()) const;
|
161 |
int FindLowestFakePatchInstalled();
|
161 |
int FindLowestFakePatchInstalled();
|
162 |
void ReadGameLanguage(bool force = true);
|
162 |
void ReadGameLanguage(bool force = true);
|
163 |
int removeAllPackages(Utils::CStringList *errors = NULL, CProgressInfo *progress = NULL);
|
163 |
int removeAllPackages(Utils::WStringList *errors = NULL, CProgressInfo *progress = NULL);
|
164 |
void AssignPackageNumbers();
|
164 |
void AssignPackageNumbers();
|
165 |
int GetChildPackages(CBaseFile *package, CLinkList<CBaseFile> *children, bool recursive = false);
|
165 |
int GetChildPackages(CBaseFile *package, CLinkList<CBaseFile> *children, bool recursive = false);
|
166 |
int GetAllPackageFiles(CBaseFile *package, CLinkList<C_File> *fileList, bool includeChild);
|
166 |
int GetAllPackageFiles(CBaseFile *package, CLinkList<C_File> *fileList, bool includeChild);
|
167 |
int GetAllPackageFiles(CLinkList<CBaseFile> *list, CLinkList<C_File> *fileList, bool includeChild);
|
167 |
int GetAllPackageFiles(CLinkList<CBaseFile> *list, CLinkList<C_File> *fileList, bool includeChild);
|
168 |
void addLogEntry(int type, const Utils::String &args, Utils::CStringList* errors);
|
168 |
void addLogEntry(int type, const Utils::WString &args, Utils::WStringList* errors);
|
169 |
Utils::WString findDataDir(const Utils::WString &dir, const Utils::WString &file);
|
169 |
Utils::WString findDataDir(const Utils::WString &dir, const Utils::WString &file);
|
170 |
int countPackages(int type, bool onlyEnabled) const;
|
170 |
int countPackages(int type, bool onlyEnabled) const;
|
171 |
int CountBuiltInPackages(bool onlyEnabled);
|
171 |
int CountBuiltInPackages(bool onlyEnabled);
|
172 |
bool isCurrentDir(const Utils::String &dir) const;
|
172 |
bool isCurrentDir(const Utils::WString &dir) const;
|
173 |
bool CheckOtherPackage(CBaseFile *package);
|
173 |
bool CheckOtherPackage(CBaseFile *package);
|
174 |
int CheckPreparedInstallRequired(CLinkList<CBaseFile> *list);
|
174 |
int CheckPreparedInstallRequired(CLinkList<CBaseFile> *list);
|
175 |
static int ConvertWareType(char w);
|
175 |
static int ConvertWareType(wchar_t w);
|
176 |
static char ConvertWareTypeBack(int w);
|
176 |
static wchar_t ConvertWareTypeBack(int w);
|
177 |
Utils::String logDirectory();
|
177 |
Utils::WString logDirectory();
|
178 |
Utils::String logDirectory(const Utils::String &gameExe);
|
178 |
Utils::WString logDirectory(const Utils::WString &gameExe);
|
179 |
Utils::String saveDirectory();
|
179 |
Utils::WString saveDirectory();
|
180 |
void backupSaves() { backupSaves(m_bVanilla); }
|
180 |
void backupSaves() { backupSaves(m_bVanilla); }
|
181 |
void backupSaves(bool vanilla);
|
181 |
void backupSaves(bool vanilla);
|
182 |
void restoreSaves() { restoreSaves(m_bVanilla); }
|
182 |
void restoreSaves() { restoreSaves(m_bVanilla); }
|
183 |
void restoreSaves(bool vanilla);
|
183 |
void restoreSaves(bool vanilla);
|
184 |
bool unPackFile(const Utils::String &filename, bool checkxml = true) const;
|
184 |
bool unPackFile(const Utils::WString &filename, bool checkxml = true) const;
|
185 |
bool packFile(const Utils::String &filename) const;
|
185 |
bool packFile(const Utils::WString &filename) const;
|
186 |
bool packFile(CFileIO* File, const Utils::String &filename) const;
|
186 |
bool packFile(CFileIO* File, const Utils::WString &filename) const;
|
187 |
Utils::String ConvertTextString(const Utils::String &text);
|
187 |
Utils::WString convertTextString(const Utils::WString &text);
|
188 |
void LoadVirtualFileSystem();
|
188 |
void LoadVirtualFileSystem();
|
189 |
bool checkAccessRights(const Utils::String &dir) const;
|
189 |
bool checkAccessRights(const Utils::WString &dir) const;
|
190 |
bool readTextPage(const Utils::String &file, Utils::CStringList &list, bool search, int page) const;
|
190 |
bool readTextPage(const Utils::WString &file, Utils::WStringList &list, bool search, int page) const;
|
191 |
size_t loadShipData(const Utils::String& file, Utils::CStringList& list) const;
|
191 |
size_t loadShipData(const Utils::String& file, Utils::CStringList& list) const;
|
192 |
FileType adjustFileType(const Utils::String &name, FileType filetype) const;
|
192 |
FileType adjustFileType(const Utils::WString &name, FileType filetype) const;
|
193 |
CXspFile *extractShip(const Utils::String &sCatFile, const Utils::String &sId, CProgressInfo *progress = NULL);
|
193 |
CXspFile *extractShip(const Utils::String &sCatFile, const Utils::String &sId, CProgressInfo *progress = NULL);
|
194 |
Utils::String readShipData(const Utils::String &file, const Utils::String &entry) const;
|
194 |
Utils::String readShipData(const Utils::String &file, const Utils::String &entry) const;
|
195 |
bool isSamePackage(CBaseFile *p1, CBaseFile *p2) const;
|
195 |
bool isSamePackage(CBaseFile *p1, CBaseFile *p2) const;
|
196 |
void ApplyFakePatchOrder(Utils::CStringList *list);
|
196 |
void ApplyFakePatchOrder(Utils::CStringList *list);
|
197 |
CBaseFile *createFromArchive(const Utils::String &filename, bool toInstall = false) const;
|
197 |
CBaseFile *createFromArchive(const Utils::String &filename, bool toInstall = false) const;
|
198 |
void readArchiveData(const char *buf, size_t len, CBaseFile *archive) const;
|
198 |
void readArchiveData(const char *buf, size_t len, CBaseFile *archive) const;
|
199 |
void readArchiveData(const Utils::String &filename, CBaseFile *archive) const;
|
199 |
void readArchiveData(const Utils::String &filename, CBaseFile *archive) const;
|
200 |
size_t verifyInstalledFiles(Utils::CStringList *missingFiles = nullptr, bool getPackages = true) const;
|
200 |
size_t verifyInstalledFiles(Utils::WStringList *missingFiles = nullptr, bool getPackages = true) const;
|
201 |
Utils::String empWaresForGame(size_t *maxsize = NULL);
|
201 |
Utils::WString empWaresForGame(size_t *maxsize = NULL);
|
202 |
void addEMPPriceOverride(int empId, int price);
|
202 |
void addEMPPriceOverride(int empId, int price);
|
203 |
void addEMPNotoOverride(int empId, int noto);
|
203 |
void addEMPNotoOverride(int empId, int noto);
|
204 |
void addBuiltInWarePriceOverride(int empId, int price);
|
204 |
void addBuiltInWarePriceOverride(int empId, int price);
|
205 |
void addBuiltInWareNotoOverride(int empId, int noto);
|
205 |
void addBuiltInWareNotoOverride(int empId, int noto);
|
206 |
void addCustomWarePriceOverride(const Utils::String &id, int price);
|
206 |
void addCustomWarePriceOverride(const Utils::WString &id, int price);
|
207 |
void addCustomWareNotoOverride(const Utils::String &id, int noto);
|
207 |
void addCustomWareNotoOverride(const Utils::WString &id, int noto);
|
208 |
|
208 |
|
209 |
int GetCurrentGameFlags() { return m_iGameFlags; }
|
209 |
int GetCurrentGameFlags() { return m_iGameFlags; }
|
210 |
|
210 |
|
211 |
void setCurrentDir(const Utils::String &dir);
|
211 |
void setCurrentDir(const Utils::WString &dir);
|
212 |
|
212 |
|
213 |
// merge mods
|
213 |
// merge mods
|
214 |
void getMergedFiles(Utils::CStringList &list, CCatFile *cat1, CCatFile *cat2) const;
|
214 |
void getMergedFiles(Utils::WStringList &list, CCatFile *cat1, CCatFile *cat2) const;
|
215 |
bool canWeMerge(const Utils::String &file) const;
|
215 |
bool canWeMerge(const Utils::WString &file) const;
|
216 |
bool mergeMods(CCatFile *mod1, CCatFile *mod2, const Utils::String &outFile, Utils::CStringList *cantMerge) const;
|
216 |
bool mergeMods(CCatFile *mod1, CCatFile *mod2, const Utils::WString &outFile, Utils::WStringList *cantMerge) const;
|
217 |
bool needToMerge(const Utils::String &file) const;
|
217 |
bool needToMerge(const Utils::WString &file) const;
|
218 |
bool getModCompatabilityList(C_File *file, Utils::CStringList *list = NULL) const;
|
218 |
bool getModCompatabilityList(C_File *file, Utils::WStringList *list = NULL) const;
|
219 |
bool checkCompatabilityBetweenModFiles(C_File *from, C_File *to, Utils::CStringList *list = NULL) const;
|
219 |
bool checkCompatabilityBetweenModFiles(C_File *from, C_File *to, Utils::WStringList *list = NULL) const;
|
220 |
bool checkCompatabilityBetweenMods(CBaseFile *from, CBaseFile *to, Utils::CStringList *list = NULL) const;
|
220 |
bool checkCompatabilityBetweenMods(CBaseFile *from, CBaseFile *to, Utils::WStringList *list = NULL) const;
|
221 |
int checkCompatabilityAgainstPackages(CBaseFile *newFile, Utils::CStringList *list = NULL, CLinkList<CBaseFile> *packages = NULL) const;
|
221 |
int checkCompatabilityAgainstPackages(CBaseFile *newFile, Utils::WStringList *list = NULL, CLinkList<CBaseFile> *packages = NULL) const;
|
222 |
|
222 |
|
223 |
Utils::String getLanguageName() const;
|
223 |
Utils::String getLanguageName() const;
|
224 |
int getGameLanguage() const;
|
224 |
int getGameLanguage() const;
|
225 |
int getGameLanguage(const Utils::String &dir) const;
|
225 |
int getGameLanguage(const Utils::WString &dir) const;
|
226 |
int getGameAddons(Utils::CStringList &exes) const;
|
226 |
int getGameAddons(Utils::WStringList &exes) const;
|
227 |
int getGameAddons(Utils::CStringList &exes, const Utils::String &dir) const;
|
227 |
int getGameAddons(Utils::WStringList &exes, const Utils::WString &dir) const;
|
228 |
Utils::String getGameName() const;
|
228 |
Utils::WString getGameName() const;
|
229 |
Utils::String getGameName(const Utils::String &dir) const;
|
229 |
Utils::WString getGameName(const Utils::WString &dir) const;
|
230 |
Utils::String getGameVersionFromType(int game, int version, const Utils::String &sVersion) const;
|
230 |
Utils::WString getGameVersionFromType(int game, int version, const Utils::WString &sVersion) const;
|
231 |
Utils::String getGameNameFromType(int game) const;
|
231 |
Utils::WString getGameNameFromType(int game) const;
|
232 |
Utils::String getGameTypesString(CBaseFile *package, bool includeVersion) const;
|
232 |
Utils::WString getGameTypesString(CBaseFile *package, bool includeVersion) const;
|
233 |
Utils::String getGameVersionString(CBaseFile *package) const;
|
233 |
Utils::WString getGameVersionString(CBaseFile *package) const;
|
234 |
Utils::String getGameRunExe(const Utils::String &dir) const;
|
234 |
Utils::WString getGameRunExe(const Utils::WString &dir) const;
|
235 |
Utils::String getGameRunExe() const;
|
235 |
Utils::WString getGameRunExe() const;
|
236 |
Utils::String getProperDir() const;
|
236 |
Utils::WString getProperDir() const;
|
237 |
Utils::String getProperDir(const Utils::String &dir) const;
|
237 |
Utils::WString getProperDir(const Utils::WString &dir) const;
|
238 |
Utils::String getAddonDir() const;
|
238 |
Utils::WString getAddonDir() const;
|
239 |
Utils::String getAddonDir(const Utils::String &dir) const;
|
239 |
Utils::WString getAddonDir(const Utils::WString &dir) const;
|
240 |
|
240 |
|
241 |
// text files
|
241 |
// text files
|
242 |
void CreateLanguageTextFiles(Utils::CStringList *errors = 0);
|
242 |
void CreateLanguageTextFiles(Utils::WStringList *errors = 0);
|
243 |
bool RenameTextFile(const Utils::String &textid, int languageid, Utils::CStringList *errors);
|
243 |
bool renameTextFile(const Utils::WString &textid, int languageid, Utils::WStringList *errors);
|
244 |
void addTextFileToScripts(C_File *file, const Utils::String &textid);
|
244 |
void addTextFileToScripts(C_File *file, const Utils::WString &textid);
|
245 |
void CreatePluginManagerText();
|
245 |
void CreatePluginManagerText();
|
246 |
void createPluginManagerOpenText();
|
246 |
void createPluginManagerOpenText();
|
247 |
|
247 |
|
248 |
// game control
|
248 |
// game control
|
249 |
void createEMPFile(const Utils::String &progDir = Utils::String::Null());
|
249 |
void createEMPFile(const Utils::String &progDir = Utils::String::Null());
|
250 |
void CreateWareFiles();
|
250 |
void CreateWareFiles();
|
251 |
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;
|
251 |
int extractGameFile(const Utils::WString &aFilename, const Utils::WString &aTo, const Utils::WString &dir = Utils::WString::Null(), const Utils::WString &addon = Utils::WString::Null()) const;
|
252 |
void CreateDummies();
|
252 |
void CreateDummies();
|
253 |
void CreateComponants();
|
253 |
void CreateComponants();
|
254 |
void CreateCutData();
|
254 |
void CreateCutData();
|
255 |
void CreateBodies();
|
255 |
void CreateBodies();
|
256 |
void CreateGlobals();
|
256 |
void CreateGlobals();
|
257 |
void CreateAnimations();
|
257 |
void CreateAnimations();
|
258 |
void CreateTShips();
|
258 |
void CreateTShips();
|
259 |
void CreateCustomStarts();
|
259 |
void CreateCustomStarts();
|
260 |
void addCreatedFile(const Utils::String &file);
|
260 |
void addCreatedFile(const Utils::WString &file);
|
261 |
|
261 |
|
262 |
bool readGlobals(Utils::CStringList &globals) const;
|
262 |
bool readGlobals(Utils::WStringList &globals) const;
|
263 |
bool readWares(int iLang, CLinkList<SWareEntry> &list);
|
263 |
bool readWares(int iLang, CLinkList<SWareEntry> &list);
|
264 |
bool readCommands(int iLang, CLinkList<SCommandSlot> &list);
|
264 |
bool readCommands(int iLang, CLinkList<SCommandSlot> &list);
|
265 |
bool readWingCommands(int iLang, CLinkList<SCommandSlot> &list);
|
265 |
bool readWingCommands(int iLang, CLinkList<SCommandSlot> &list);
|
266 |
int empOveridePrice(int id);
|
266 |
int empOveridePrice(int id);
|
267 |
bool empOverideNoto(int id, int *noto);
|
267 |
bool empOverideNoto(int id, int *noto);
|
268 |
int builtInWareOveridePrice(int id);
|
268 |
int builtInWareOveridePrice(int id);
|
269 |
bool builtInWareOverideNoto(int id, int *noto);
|
269 |
bool builtInWareOverideNoto(int id, int *noto);
|
270 |
int customWareOveridePrice(const Utils::String &id);
|
270 |
int customWareOveridePrice(const Utils::WString &id);
|
271 |
bool customWareOverideNoto(const Utils::String &id, int *noto);
|
271 |
bool customWareOverideNoto(const Utils::WString &id, int *noto);
|
272 |
void removeEmpOverride(int pos);
|
272 |
void removeEmpOverride(int pos);
|
273 |
void removeBuiltinWareOverride(int pos);
|
273 |
void removeBuiltinWareOverride(int pos);
|
274 |
void removeCustomWareOverride(const Utils::String &id);
|
274 |
void removeCustomWareOverride(const Utils::WString &id);
|
275 |
|
275 |
|
276 |
// install text
|
276 |
// install text
|
277 |
Utils::String getInstallBeforeText(CBaseFile *package) const;
|
277 |
Utils::String getInstallBeforeText(CBaseFile *package) const;
|
278 |
Utils::String getInstallAfterText(CBaseFile *package) const;
|
278 |
Utils::String getInstallAfterText(CBaseFile *package) const;
|
279 |
Utils::String getUninstallBeforeText(CBaseFile *package) const;
|
279 |
Utils::String getUninstallBeforeText(CBaseFile *package) const;
|
Line 282... |
Line 282... |
282 |
//setting functions
|
282 |
//setting functions
|
283 |
void SetRenameText(bool b) { m_bRenameText = b; }
|
283 |
void SetRenameText(bool b) { m_bRenameText = b; }
|
284 |
void SetLanguage(int i) { m_iLanguage = i; }
|
284 |
void SetLanguage(int i) { m_iLanguage = i; }
|
285 |
void SetAutoEnable(bool b) { m_bAutoEnableChild = b; }
|
285 |
void SetAutoEnable(bool b) { m_bAutoEnableChild = b; }
|
286 |
void SetForceModInstall(bool b) { m_bForceModInstall = b; }
|
286 |
void SetForceModInstall(bool b) { m_bForceModInstall = b; }
|
287 |
void setTempDirectory(const Utils::String &s) { m_sTempDir = s; }
|
287 |
void setTempDirectory(const Utils::WString &s) { m_sTempDir = s; }
|
288 |
void setMyDocuments(const Utils::String &s) { m_sMyDoc = s; }
|
288 |
void setMyDocuments(const Utils::WString &s) { m_sMyDoc = s; }
|
289 |
void SetForceEMP(bool b) { m_bForceEMP = b; }
|
289 |
void SetForceEMP(bool b) { m_bForceEMP = b; }
|
290 |
void SetSurpressProtectedWarning(bool b) { m_bSurpressProtectedWarning = b; }
|
290 |
void SetSurpressProtectedWarning(bool b) { m_bSurpressProtectedWarning = b; }
|
291 |
void SurpressProtectedWarning() { m_bSurpressProtectedWarning = true; }
|
291 |
void SurpressProtectedWarning() { m_bSurpressProtectedWarning = true; }
|
292 |
bool IsSupressProtectedWarning() { return m_bSurpressProtectedWarning; }
|
292 |
bool IsSupressProtectedWarning() { return m_bSurpressProtectedWarning; }
|
293 |
|
293 |
|
Line 295... |
Line 295... |
295 |
int GetGame() { return m_iGame; }
|
295 |
int GetGame() { return m_iGame; }
|
296 |
bool IsLoaded() { return m_bLoaded; }
|
296 |
bool IsLoaded() { return m_bLoaded; }
|
297 |
bool IsVanilla() { return m_bVanilla; }
|
297 |
bool IsVanilla() { return m_bVanilla; }
|
298 |
void SetVanilla(bool b);
|
298 |
void SetVanilla(bool b);
|
299 |
|
299 |
|
300 |
const Utils::String &getMod() const { return m_sSetMod; }
|
300 |
const Utils::WString &getMod() const { return m_sSetMod; }
|
301 |
void setMod(const Utils::String& mod);
|
301 |
void setMod(const Utils::WString& mod);
|
302 |
void setSaveGameManager(bool managed);
|
302 |
void setSaveGameManager(bool managed);
|
303 |
|
303 |
|
304 |
CBaseFile *GetEnabledMod() { return m_pEnabledMod; }
|
304 |
CBaseFile *GetEnabledMod() { return m_pEnabledMod; }
|
305 |
|
305 |
|
306 |
//errors
|
306 |
//errors
|
Line 312... |
Line 312... |
312 |
CLinkList<CBaseFile>* getFoundPackageList() { return &m_lFoundPackages; }
|
312 |
CLinkList<CBaseFile>* getFoundPackageList() { return &m_lFoundPackages; }
|
313 |
bool AnyAvailablePackages(int type = -1);
|
313 |
bool AnyAvailablePackages(int type = -1);
|
314 |
bool addAvailablePackage(SAvailablePackage *package);
|
314 |
bool addAvailablePackage(SAvailablePackage *package);
|
315 |
void saveAvailablePackages();
|
315 |
void saveAvailablePackages();
|
316 |
void readAvailablePackages();
|
316 |
void readAvailablePackages();
|
317 |
void parseAvailablePackage(const Utils::String &str, const Utils::String &webaddress = Utils::String::Null());
|
317 |
void parseAvailablePackage(const Utils::WString &str, const Utils::WString &webaddress = Utils::WString::Null());
|
318 |
const SAvailablePackage* findAvailablePackage(const Utils::String& filename) const;
|
318 |
const SAvailablePackage* findAvailablePackage(const Utils::WString& filename) const;
|
319 |
const SAvailablePackage* findAvailablePackage(const Utils::String& name, const Utils::String& author) const;
|
319 |
const SAvailablePackage* findAvailablePackage(const Utils::WString& name, const Utils::WString& author) const;
|
320 |
CBaseFile* findFoundPackage(const Utils::String& name, const Utils::String& author) const;
|
320 |
CBaseFile* findFoundPackage(const Utils::WString& name, const Utils::WString& author) const;
|
321 |
int findAllServers(Utils::CStringList *list) const;
|
321 |
int findAllServers(Utils::CStringList *list) const;
|
322 |
|
322 |
|
323 |
CBaseFile *findScriptByAuthor(const Utils::String &author, CBaseFile *prev = NULL);
|
323 |
CBaseFile *findScriptByAuthor(const Utils::String &author, CBaseFile *prev = NULL);
|
324 |
void RemoveFailedFiles();
|
324 |
void RemoveFailedFiles();
|
325 |
|
325 |
|
Line 329... |
Line 329... |
329 |
bool _checkForDisable(CBaseFile *package, bool disabled, CBaseFile *oldPackage);
|
329 |
bool _checkForDisable(CBaseFile *package, bool disabled, CBaseFile *oldPackage);
|
330 |
CBaseFile *_archive_fromRar(const Utils::String &filename, bool toInstall) const;
|
330 |
CBaseFile *_archive_fromRar(const Utils::String &filename, bool toInstall) const;
|
331 |
CBaseFile *_archive_fromZip(const Utils::String &filename, bool toInstall) const;
|
331 |
CBaseFile *_archive_fromZip(const Utils::String &filename, bool toInstall) const;
|
332 |
void _addToFakePatch(CBaseFile *pPackage);
|
332 |
void _addToFakePatch(CBaseFile *pPackage);
|
333 |
int _gameTextNumber() const;
|
333 |
int _gameTextNumber() const;
|
334 |
void _addWareOverride(enum WareTypes type, int pos, const Utils::String &id, int value, bool noto);
|
334 |
void _addWareOverride(enum WareTypes type, int pos, const Utils::WString &id, int value, bool noto);
|
335 |
int _warePriceOverride(enum WareTypes type, int pos, const Utils::String &id);
|
335 |
int _warePriceOverride(enum WareTypes type, int pos, const Utils::WString &id);
|
336 |
bool _wareNotoOverride(enum WareTypes type, int pos, const Utils::String &id, int *noto);
|
336 |
bool _wareNotoOverride(enum WareTypes type, int pos, const Utils::WString &id, int *noto);
|
337 |
void _removeWareOverride(enum WareTypes type, int pos, const Utils::String &id);
|
337 |
void _removeWareOverride(enum WareTypes type, int pos, const Utils::WString &id);
|
338 |
|
338 |
|
339 |
private:
|
339 |
private:
|
340 |
Utils::String m_sCurrentDir;
|
340 |
Utils::WString m_sCurrentDir;
|
341 |
static Utils::String m_sTempDir;
|
341 |
static Utils::WString m_sTempDir;
|
342 |
Utils::String m_sMyDoc;
|
342 |
Utils::WString m_sMyDoc;
|
343 |
Utils::String m_sSetMod;
|
343 |
Utils::WString m_sSetMod;
|
344 |
Utils::String _sSaveDir;
|
344 |
Utils::WString _sSaveDir;
|
345 |
GameDirectory *_pCurrentDir;
|
345 |
GameDirectory *_pCurrentDir;
|
346 |
|
346 |
|
347 |
// global files list
|
347 |
// global files list
|
348 |
CLinkList<C_File> m_lFiles;
|
348 |
CLinkList<C_File> m_lFiles;
|
349 |
CLinkList<CBaseFile> m_lPackages;
|
349 |
CLinkList<CBaseFile> m_lPackages;
|
Line 357... |
Line 357... |
357 |
// prepared lists
|
357 |
// prepared lists
|
358 |
CLinkList<CBaseFile> m_lInstallList; // install/uninstalling packages
|
358 |
CLinkList<CBaseFile> m_lInstallList; // install/uninstalling packages
|
359 |
CLinkList<CBaseFile> m_lEnableList; // enable packages
|
359 |
CLinkList<CBaseFile> m_lEnableList; // enable packages
|
360 |
CLinkList<CBaseFile> m_lDisableList; // disable packages
|
360 |
CLinkList<CBaseFile> m_lDisableList; // disable packages
|
361 |
|
361 |
|
362 |
Utils::CStringList m_lCreatedFiles; // list of files we've created
|
362 |
Utils::WStringList _lCreatedFiles; // list of files we've created
|
363 |
Utils::CStringList m_lNonRemovedFiles; // list of fiels that couldn't be removed for some reason
|
363 |
Utils::WStringList _lNonRemovedFiles; // list of fiels that couldn't be removed for some reason
|
364 |
Utils::CStringList m_lGlobals; // global settigns that we want changed
|
364 |
Utils::WStringList _lGlobals; // global settigns that we want changed
|
365 |
Utils::CStringList m_lFakePatchOrder; // ordered fake patches
|
365 |
Utils::WStringList _lFakePatchOrder; // ordered fake patches
|
366 |
CLinkList<SAvailablePackage> m_lAvailablePackages; // list of available packages online
|
366 |
CLinkList<SAvailablePackage> m_lAvailablePackages; // list of available packages online
|
367 |
|
367 |
|
368 |
CVirtualFileSystem m_pGameVFS; // Games Virtual File System
|
368 |
CVirtualFileSystem m_pGameVFS; // Games Virtual File System
|
369 |
|
369 |
|
370 |
CGameExe m_gameExe;
|
370 |
CGameExe m_gameExe;
|
Line 381... |
Line 381... |
381 |
int m_iSaveGameManager; // Save game manager
|
381 |
int m_iSaveGameManager; // Save game manager
|
382 |
bool m_bSurpressProtectedWarning; // prevent checking for protected directory
|
382 |
bool m_bSurpressProtectedWarning; // prevent checking for protected directory
|
383 |
|
383 |
|
384 |
int m_iGame; // the game the directory is
|
384 |
int m_iGame; // the game the directory is
|
385 |
int m_iGameVersion; // the version of the game (version position)
|
385 |
int m_iGameVersion; // the version of the game (version position)
|
386 |
Utils::String m_sGameVersion; // the version of the game (full version)
|
386 |
Utils::WString _sGameVersion; // the version of the game (full version)
|
387 |
int m_iGameFlags; // the flags for the game from SGameExe
|
387 |
int m_iGameFlags; // the flags for the game from SGameExe
|
388 |
int m_iMaxPatch; // the maximum patch for the game
|
388 |
int m_iMaxPatch; // the maximum patch for the game
|
389 |
|
389 |
|
390 |
int m_iSaveGame;
|
390 |
int m_iSaveGame;
|
391 |
int m_iError;
|
391 |
int m_iError;
|