Attached Files |
-
unitsyncGameandextrafunctions.patch (3,589 bytes) 2007-09-29 13:30
Index: rts/System/FileSystem/ArchiveScanner.cpp
===================================================================
--- rts/System/FileSystem/ArchiveScanner.cpp (revision 4476)
+++ rts/System/FileSystem/ArchiveScanner.cpp (working copy)
@@ -59,6 +59,8 @@
md.name = p->SGetValueDef("", (section + "\\Name").c_str());
md.shortName = p->SGetValueDef("", (section + "\\ShortName").c_str());
+ md.game = p->SGetValueDef("", (section + "\\Game").c_str());
+ md.shortGame = p->SGetValueDef("", (section + "\\ShortGame").c_str());
md.version = p->SGetValueDef("", (section + "\\Version").c_str());
md.mutator = p->SGetValueDef("", (section + "\\Mutator").c_str());
md.description = p->SGetValueDef("", (section + "\\Description").c_str());
Index: rts/System/FileSystem/ArchiveScanner.h
===================================================================
--- rts/System/FileSystem/ArchiveScanner.h (revision 4476)
+++ rts/System/FileSystem/ArchiveScanner.h (working copy)
@@ -31,6 +31,8 @@
struct ModData {
string name; // ex: Original Total Annihilation v2.3
string shortName; // ex: OTA
+ string game; // ex: Total Annihilation
+ string shortGame; // ex: TA
string version; // ex: v2.3
string mutator; // ex: deployment
string description; // ex: Little units blowing up other little units
Index: tools/unitsync/unitsync.cpp
===================================================================
--- tools/unitsync/unitsync.cpp (revision 4477)
+++ tools/unitsync/unitsync.cpp (working copy)
@@ -745,6 +745,47 @@
return GetStr(x);
}
+DLL_EXPORT const char* __stdcall GetPrimaryModShortName(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModShortName.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModShortName.");
+ string x = modData[index].shortName;
+ return GetStr(x);
+}
+
+DLL_EXPORT const char* __stdcall GetPrimaryModGame(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModName.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModName.");
+ string x = modData[index].game;
+ return GetStr(x);
+}
+
+DLL_EXPORT const char* __stdcall GetPrimaryModShortGame(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModShortGame.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModShortGame.");
+ string x = modData[index].shortGame;
+ return GetStr(x);
+}
+
+DLL_EXPORT const char* __stdcall GetPrimaryModMutator(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModMutator.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModMutator.");
+ string x = modData[index].mutator;
+ return GetStr(x);
+}
+
+DLL_EXPORT const char* __stdcall GetPrimaryModDescription(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModDescription.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModDescription.");
+ string x = modData[index].description;
+ return GetStr(x);
+}
+
+
DLL_EXPORT const char* __stdcall GetPrimaryModArchive(int index)
{
ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModArchive.");
-
unitsyncGameandextrafunctions2.patch (7,001 bytes) 2007-10-02 00:47
Index: rts/System/FileSystem/ArchiveScanner.cpp
===================================================================
--- rts/System/FileSystem/ArchiveScanner.cpp (revision 4486)
+++ rts/System/FileSystem/ArchiveScanner.cpp (working copy)
@@ -59,6 +59,8 @@
md.name = p->SGetValueDef("", (section + "\\Name").c_str());
md.shortName = p->SGetValueDef("", (section + "\\ShortName").c_str());
+ md.game = p->SGetValueDef("", (section + "\\Game").c_str());
+ md.shortGame = p->SGetValueDef("", (section + "\\ShortGame").c_str());
md.version = p->SGetValueDef("", (section + "\\Version").c_str());
md.mutator = p->SGetValueDef("", (section + "\\Mutator").c_str());
md.description = p->SGetValueDef("", (section + "\\Description").c_str());
Index: rts/System/FileSystem/ArchiveScanner.h
===================================================================
--- rts/System/FileSystem/ArchiveScanner.h (revision 4486)
+++ rts/System/FileSystem/ArchiveScanner.h (working copy)
@@ -31,6 +31,8 @@
struct ModData {
string name; // ex: Original Total Annihilation v2.3
string shortName; // ex: OTA
+ string game; // ex: Total Annihilation
+ string shortGame; // ex: TA
string version; // ex: v2.3
string mutator; // ex: deployment
string description; // ex: Little units blowing up other little units
Index: tools/unitsync/unitsync.cpp
===================================================================
--- tools/unitsync/unitsync.cpp (revision 4486)
+++ tools/unitsync/unitsync.cpp (working copy)
@@ -151,9 +151,10 @@
return 1;
}
-/* Deprecated function, DO NOT USE! Temporarily readded to make buildbot'
-generated unitsync.dll work with TASClient.exe from Spring 0.74b3.
-FIXME: Should be removed just after 0.75 release! */
+/* @brief Deprecated function, DO NOT USE! Temporarily readded to make buildbot'
+ * generated unitsync.dll work with TASClient.exe from Spring 0.74b3.
+ * FIXME: Should be removed just after 0.75 release!
+ */
DLL_EXPORT int __stdcall InitArchiveScanner(void)
{
return 1;
@@ -730,6 +731,13 @@
vector<CArchiveScanner::ModData> modData;
+/*
+ * @brief Retrieves the name of this mod
+ * @return int The number of mods
+ *
+ * Returns the name of the mod usually found in modinfo.tdf.
+ * Be sure you've made calls to Init and GetPrimaryModCount prior to using this.
+ */
DLL_EXPORT int __stdcall GetPrimaryModCount()
{
ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModCount.");
@@ -737,6 +745,14 @@
return modData.size();
}
+/*
+ * @brief Retrieves the name of this mod
+ * @param index in The mods index/id
+ * @return const char* The mods name
+ *
+ * Returns the name of the mod usually found in modinfo.tdf.
+ * Be sure you've made calls to Init and GetPrimaryModCount prior to using this.
+ */
DLL_EXPORT const char* __stdcall GetPrimaryModName(int index)
{
ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModName.");
@@ -745,6 +761,87 @@
return GetStr(x);
}
+/*
+ * @brief Retrieves the shortened name of this mod
+ * @param index in The mods index/id
+ * @return const char* The mods abbrieviated name
+ *
+ * Returns the shortened name of the mod usually found in modinfo.tdf.
+ * Be sure you've made calls to Init and GetPrimaryModCount prior to using this.
+ */
+DLL_EXPORT const char* __stdcall GetPrimaryModShortName(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModShortName.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModShortName.");
+ string x = modData[index].shortName;
+ return GetStr(x);
+}
+
+/*
+ * @brief Retrieves the game name of this mod
+ * @param index in The mods index/id
+ * @return const char* The mods game
+ *
+ * Returns the name of the game this mod belongs to usually found in modinfo.tdf.
+ * Be sure you've made calls to Init and GetPrimaryModCount prior to using this.
+ */
+DLL_EXPORT const char* __stdcall GetPrimaryModGame(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModName.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModName.");
+ string x = modData[index].game;
+ return GetStr(x);
+}
+
+/*
+ * @brief Retrieves the short game name of this mod
+ * @param index in The mods index/id
+ * @return const char* The mods abbrieviated game name
+ *
+ * Returns the abbrieviated name of the game this mod belongs to usually found in modinfo.tdf.
+ * Be sure you've made calls to Init and GetPrimaryModCount prior to using this.
+ */
+DLL_EXPORT const char* __stdcall GetPrimaryModShortGame(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModShortGame.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModShortGame.");
+ string x = modData[index].shortGame;
+ return GetStr(x);
+}
+
+/*
+ * @brief Retrieves the mutator name of this mod
+ * @param index in The mods index/id
+ * @return const char* The mods mutator name
+ *
+ * Returns value of the mutator tag for the specified mod usually found in modinfo.tdf.
+ * Be sure you've made calls to Init and GetPrimaryModCount prior to using this.
+ */
+DLL_EXPORT const char* __stdcall GetPrimaryModMutator(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModMutator.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModMutator.");
+ string x = modData[index].mutator;
+ return GetStr(x);
+}
+
+/*
+ * @brief Retrieves the description of this mod
+ * @param index in The mods index/id
+ * @return const char* The mods description
+ *
+ * Returns a description for the specified mod usually found in modinfo.tdf.
+ * Be sure you've made calls to Init and GetPrimaryModCount prior to using this.
+ */
+DLL_EXPORT const char* __stdcall GetPrimaryModDescription(int index)
+{
+ ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModDescription.");
+ ASSERT((unsigned)index < modData.size(), "Array index out of bounds. Call GetPrimaryModCount before GetPrimaryModDescription.");
+ string x = modData[index].description;
+ return GetStr(x);
+}
+
+
DLL_EXPORT const char* __stdcall GetPrimaryModArchive(int index)
{
ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModArchive.");
@@ -759,6 +856,11 @@
*/
vector<string> primaryArchives;
+/* @brief Retrieves the number of archives a mod requires
+ * @param index int The index of the mod
+ *
+ * Returns the number of archives this mod depends on.
+ */
DLL_EXPORT int __stdcall GetPrimaryModArchiveCount(int index)
{
ASSERT(archiveScanner && hpiHandler, "Call InitArchiveScanner before GetPrimaryModArchiveCount.");
|
---|