richardthombs / scunpacked

Star Citizen data browser and API
https://scunpacked.com
GNU General Public License v3.0
62 stars 16 forks source link

Loader.exe | AEGS_Redeemer parsing failed #87

Closed mortik closed 2 years ago

mortik commented 3 years ago

Hey,

i'm getting the following Error when trying to parse data from 3.15.1 PTU

EntityService: Cache saved to input folder d:\scdata\3.15.1
Load Localisation
Load Manufacturers
Load Ammunition
Load Insurance
Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: AEGS_Redeemer
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Loader.InsuranceLoader.Load() in D:\scdata\scunpacked\Loader\InsuranceLoader.cs:line 22
   at Loader.Program.Main(String[] args) in D:\scdata\scunpacked\Loader\Program.cs:line 112
PS D:\scdata\3.15.1> 
mortik commented 3 years ago

I put a guard clause in to prevent this error but its actually an issue with the exported xml from the Gamefiles... seems like they put 2 entries in for the Redeemer. Will check if what entry is the one used in the current PTU Patch.

The temp fix in : Loader/InsuranceLoader.cs line 19 and forward:

            var insurance = Parse<ShipInsuranceRecord>(Path.Combine(DataRoot, @"data\libs\foundry\records\shipinsurancerecord\shipinsurance.xml"));
            foreach (var record in insurance.allShips)
            {
                                if (output.ContainsKey(record.shipEntityClassName)) {
                                        continue;
                                }

                output.Add(record.shipEntityClassName, new StandardisedInsurance
                {
                    StandardClaimTime = record.baseWaitTimeMinutes,
                    ExpeditedClaimTime = record.mandatoryWaitTimeMinutes,
                    ExpeditedCost = record.baseExpeditingFee
                });
            }

The correct Entry in the XML is the first Entry with 17.55 Minutes so the guard clause would pick the correct value.

jonBarcus commented 2 years ago

Also getting this, but for LIVE 3.15.1.

richardthombs commented 2 years ago

Sometimes it takes CIG ages to even notice these kinds of problems. I've added @mortik 's fix so we can work around it.

cintaracorp commented 2 years ago

Perhaps we should do some debug output when this happens and notify CIG? We are still all alpha testers and helping CIG with bugs is a part of SC.