Skip to content

INI duplicate entry issue #856

@stavrosfa

Description

@stavrosfa

When a .INI file has a duplicate entry, the game doesn't crash, but it doesn't load the unit art and also doesn't behave like a unit (can't move/fight, etc)

As an example, Tank has 2 DEAD entries under [Sound Effects].

This looks like a library issue that has also stopped being updated for several years now.
https://github.com/rickyah/ini-parser

Pasting (part of) the exception here so you don't have to replicate

IniParser.Exceptions.ParsingException: Duplicated key 'DEAD' found in section 'Sound Effects while parsing line number 0 with value '' - IniParser version: 2.5.2.0 while parsing line number 78 with value 'DEAD=' - IniParser version: 2.5.2.0
 ---> IniParser.Exceptions.ParsingException: Duplicated key 'DEAD' found in section 'Sound Effects while parsing line number 0 with value '' - IniParser version: 2.5.2.0
   at IniParser.Parser.IniDataParser.HandleDuplicatedKeyInCollection(String key, String value, KeyDataCollection keyDataCollection, String sectionName)
   at IniParser.Parser.IniDataParser.AddKeyToKeyValueCollection(String key, String value, KeyDataCollection keyDataCollection, String sectionName)
   at IniParser.Parser.IniDataParser.ProcessKeyValuePair(String line, IniData currentIniData)
   at IniParser.Parser.IniDataParser.ProcessLine(String currentLine, IniData currentIniData)
   at IniParser.Parser.IniDataParser.Parse(String iniDataString)
   --- End of inner exception stack trace ---
   at IniParser.Parser.IniDataParser.Parse(String iniDataString)
   at IniParser.StreamIniDataParser.ReadData(StreamReader reader)
   at IniParser.FileIniDataParser.ReadFile(String filePath, Encoding fileEncoding)
   at IniParser.FileIniDataParser.ReadFile(String filePath)
   at AnimationManager.getINIData(String pathKey) in C:\Users\Stavros\Documents\C7\C7-Prototype\C7\Animations\AnimationManager.cs:line 66
   at AnimationManager.getUnitINIData(String unitTypeName) in C:\Users\Stavros\Documents\C7\C7-Prototype\C7\Animations\AnimationManager.cs:line 112
   at AnimationManager.getUnitFlicFilepath(UnitPrototype unit, AnimatedAction action) in C:\Users\Stavros\Documents\C7\C7-Prototype\C7\Animations\AnimationManager.cs:line 117
   at AnimationManager.LoadAnimation(UnitPrototype unit, AnimatedAction action) in C:\Users\Stavros\Documents\C7\C7-Prototype\C7\Animations\AnimationManager.cs:line 178

What could we do here?
Find another library that is actively maintained? I looked around, it doesn't look promising...
Create and maintain our own fork of this, fixing issues ad hoc (meh) ?
Write our own tiny parser (hmm) ?
Modify through code known problematic source files (ew no) ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    assetsinvolving actual art, sound, text, or other assets included in the gamehelp wantedExtra attention is neededinfrastructureProject infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions