2025-07-18 15:41 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000649Spring engineGeneralpublic2007-10-13 16:00
Reporterredstar 
Assigned Toimbaczek 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000649: [PATCH] Unitsync Extra functions, doxygen, and extra archivescanner data
DescriptionThis patch adds 2 new tags game= and shortgame= to modinfo.tdf and exposes them to unitsync.

The patch also exposes these 2 fields and the values of several other modinfo.tdf tags to lobbies in unitsync.

These extra functions have doxygen commenting, and commenting was added to several other functions.

A Commit of this patch will b followed up by updates to the java interface
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon 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.");
    
    patch file icon unitsyncGameandextrafunctions.patch (3,589 bytes) 2007-09-29 13:30 +
  • patch file icon 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.");
    
    patch file icon unitsyncGameandextrafunctions2.patch (7,001 bytes) 2007-10-02 00:47 +

-Relationships
+Relationships

-Notes

~0001327

imbaczek (reporter)

Last edited: 2007-10-02 00:39

this patch causes instability of both tasclient and springlobby, please test and fix.

at least, that's what it looks like, even though i can't see anything obviously wrong. maybe something else is broken.

~0001328

redstar (reporter)

There's nothing in the patch that could cause that. The only new code that would ever get executed by tasclient and spring lobby are the 2 lines:

+ md.game = p->SGetValueDef("", (section + "\\Game").c_str());
+ md.shortGame = p->SGetValueDef("", (section + "\\ShortGame").c_str());

However I will remake the patch as it seems the doxygen comments weren't saved before I made the patch

~0001329

imbaczek (reporter)

yeah, I reversed the patch and lobbies were still crashing when joining and exiting. this needs further investigation.

~0001347

imbaczek (reporter)

committed this in r4561 since apparently lobby devs don't have any objections. thanks for the patch.
+Notes

-Issue History
Date Modified Username Field Change
2007-09-29 13:30 redstar New Issue
2007-09-29 13:30 redstar File Added: unitsyncGameandextrafunctions.patch
2007-10-02 00:38 imbaczek Note Added: 0001327
2007-10-02 00:39 imbaczek Note Edited: 0001327
2007-10-02 00:43 redstar Note Added: 0001328
2007-10-02 00:47 redstar File Added: unitsyncGameandextrafunctions2.patch
2007-10-02 10:36 imbaczek Note Added: 0001329
2007-10-13 16:00 imbaczek Status new => resolved
2007-10-13 16:00 imbaczek Resolution open => fixed
2007-10-13 16:00 imbaczek Assigned To => imbaczek
2007-10-13 16:00 imbaczek Note Added: 0001347
+Issue History