add the ability for novetus to generate _meta.ini files!

This commit is contained in:
Bitl 2023-12-11 16:40:32 -07:00
parent 4df2bde691
commit 629b19b2ed
2 changed files with 12 additions and 14 deletions

View File

@ -2,6 +2,7 @@ EDGE Snapshot v23.8745.28516.1
Enhancements:
- Play Solo now uses the current server port (defined in the Host menu.)
- This makes it easier to launch Play Solo on some computers.
- Novetus will now create basic _meta.ini files for games that have badges! They can then be filled out with correct information by map creators and archivists.
Fixes:
- Fixed the AwardBadge and HasBadge extensions not working properly.
----------------------------------------------------------------------------

View File

@ -72,21 +72,18 @@ public class AwardBadge : IWebProxyExtension
metaFile = GlobalPaths.DataDir + "\\Appreciation_meta.ini";
}
if (File.Exists(metaFile))
try
{
INIFile metaIni = new INIFile(metaFile, !(File.Exists(metaFile));
string section = BadgeID.ToString();
string name = metaIni.IniReadValue(section, "BadgeName", "Unknown Badge #" + BadgeID.ToString());
string creator = metaIni.IniReadValue(section, "BadgeCreatorName", "Unknown");
result.BadgeName = name;
result.BadgeCreatorName = creator;
}
catch (Exception)
{
try
{
INIFile metaIni = new INIFile(metaFile, false);
string section = BadgeID.ToString();
string name = metaIni.IniReadValue(section, "BadgeName", BadgeID.ToString());
string creator = metaIni.IniReadValue(section, "BadgeCreatorName", "Unknown");
result.BadgeName = name;
result.BadgeCreatorName = creator;
}
catch (Exception)
{
}
}
return result;