Skip to content

Commit 499b6ab

Browse files
committed
multiple improvements to scenario viewer, including not freezing indefinitely
1 parent e2d4c4c commit 499b6ab

21 files changed

+758
-608
lines changed

Dat/Data/ObjectSource.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

Dat/Data/SourceGame.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,24 @@ public enum SourceGame : byte
77
Vanilla = 2,
88
OpenLoco = 3,
99
}
10+
public enum ObjectSource // note this is similar to the DAT enum `SourceGame`, but we need more definition now
11+
{
12+
Custom,
13+
LocomotionSteam,
14+
LocomotionGoG,
15+
OpenLoco,
16+
}
17+
18+
public static class ObjectSourceConverter
19+
{
20+
public static SourceGame ToSourceGame(this ObjectSource objectSource)
21+
=> objectSource switch
22+
{
23+
ObjectSource.Custom => SourceGame.Custom,
24+
ObjectSource.LocomotionSteam => SourceGame.Vanilla,
25+
ObjectSource.LocomotionGoG => SourceGame.Vanilla,
26+
ObjectSource.OpenLoco => SourceGame.OpenLoco,
27+
_ => throw new NotImplementedException(),
28+
};
29+
}
1030
}

Dat/Types/SCV5/GameState.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ public record GameStateScenarioA(
7878
[property: LocoStructOffset(0x1B2)] uint8_t LastWallOption,
7979
[property: LocoStructOffset(0x1B3)] uint8_t ProduceAICompanyTimeout,
8080
[property: LocoStructOffset(0x1B4), LocoArrayLength(2)] uint32_t[] TickStartPrngState,
81-
[property: LocoStructOffset(0x1BC), LocoArrayLength(256)] char_t[] ScenarioFileName,
82-
[property: LocoStructOffset(0x2BC), LocoArrayLength(64)] char_t[] ScenarioName,
83-
[property: LocoStructOffset(0x2FC), LocoArrayLength(256)] char_t[] ScenarioDetails,
81+
[property: LocoStructOffset(0x1BC), LocoArrayLength(256), Browsable(false)] char_t[] ScenarioFileName,
82+
[property: LocoStructOffset(0x2BC), LocoArrayLength(64), Browsable(false)] char_t[] ScenarioName,
83+
[property: LocoStructOffset(0x2FC), LocoArrayLength(256), Browsable(false)] char_t[] ScenarioDetails,
8484
[property: LocoStructOffset(0x3FC)] uint8_t CompetitorStartDelay,
8585
[property: LocoStructOffset(0x3FD)] uint8_t PreferredAIIntelligence,
8686
[property: LocoStructOffset(0x3FE)] uint8_t PreferredAIAggressiveness,
@@ -125,23 +125,23 @@ public record GameStateScenarioA(
125125
[property: LocoStructOffset(0x474)] uint16_t LastMapWindowVar88A,
126126
[property: LocoStructOffset(0x476)] uint16_t LastMapWindowVar88C,
127127
[property: LocoStructOffset(0x478)] uint32_t var_478,
128-
[property: LocoStructOffset(0x47C), LocoArrayLength(0x13B6 - 0x47C)] uint8_t[] var_047C,
128+
[property: LocoStructOffset(0x47C), LocoArrayLength(0x13B6 - 0x47C), Browsable(false)] uint8_t[] var_047C,
129129
[property: LocoStructOffset(0x13B6)] uint16_t NumMessages,
130130
[property: LocoStructOffset(0x13B8)] uint16_t ActiveMessageIndex,
131131
[property: LocoStructOffset(0x13BA), LocoArrayLength((int)Limits.kMaxMessages)] Message[] Messages,
132-
[property: LocoStructOffset(0xB886), LocoArrayLength(0xB94C - 0xB886)] uint8_t[] var_B886,
132+
[property: LocoStructOffset(0xB886), LocoArrayLength(0xB94C - 0xB886), Browsable(false)] uint8_t[] var_B886,
133133
[property: LocoStructOffset(0xB94C)] uint8_t var_B94C,
134-
[property: LocoStructOffset(0xB94D), LocoArrayLength(0xB950 - 0xB94D)] uint8_t[] var_B94D,
134+
[property: LocoStructOffset(0xB94D), LocoArrayLength(0xB950 - 0xB94D), Browsable(false)] uint8_t[] var_B94D,
135135
[property: LocoStructOffset(0xB950)] uint8_t var_B950,
136136
[property: LocoStructOffset(0xB951)] uint8_t var_B951,
137137
[property: LocoStructOffset(0xB952)] uint8_t var_B952,
138138
[property: LocoStructOffset(0xB953)] uint8_t var_B953,
139139
[property: LocoStructOffset(0xB954)] uint8_t var_B954,
140140
[property: LocoStructOffset(0xB955)] uint8_t var_B955,
141141
[property: LocoStructOffset(0xB956)] uint8_t var_B956,
142-
[property: LocoStructOffset(0xB957), LocoArrayLength(0xB968 - 0xB957)] uint8_t[] var_B957,
142+
[property: LocoStructOffset(0xB957), LocoArrayLength(0xB968 - 0xB957), Browsable(false)] uint8_t[] var_B957,
143143
[property: LocoStructOffset(0xB958)] uint8_t CurrentRainLevel,
144-
[property: LocoStructOffset(0xB959), LocoArrayLength(0xB96C - 0xB969)] uint8_t[] var_B969
144+
[property: LocoStructOffset(0xB959), LocoArrayLength(0xB96C - 0xB969), Browsable(false)] uint8_t[] var_B969
145145
//[property: LocoStructOffset(0xB96C), LocoArrayLength((int)Limits.kMaxCompanies)] Company[] Companies // this isn't actually part of the data chunk in a scenario!
146146
)
147147
: ILocoStruct
@@ -155,9 +155,9 @@ public record GameStateScenarioA(
155155
[LocoStructSize(0x123480)]
156156
public record GameStateScenarioB(
157157

158-
[property: LocoStructOffset(0x0), LocoArrayLength((int)Limits.kMaxTowns)] Town[] Towns,
159-
[property: LocoStructOffset(0xC300), LocoArrayLength((int)Limits.kMaxIndustries)] Industry[] Industries,
160-
[property: LocoStructOffset(0x2EC80), LocoArrayLength((int)Limits.kMaxStations)] Station[] Stations
158+
[property: LocoStructOffset(0x0), LocoArrayLength((int)Limits.kMaxTowns), Browsable(false)] Town[] Towns,
159+
[property: LocoStructOffset(0xC300), LocoArrayLength((int)Limits.kMaxIndustries), Browsable(false)] Industry[] Industries,
160+
[property: LocoStructOffset(0x2EC80), LocoArrayLength((int)Limits.kMaxStations), Browsable(false)] Station[] Stations
161161
//[property: LocoStructOffset(0x123480), LocoArrayLength((int)Limits.kMaxEntities)] Entity[] Entities // this isn't actually part of the data chunk in a scenario!
162162
) : ILocoStruct
163163
{
@@ -167,11 +167,11 @@ public record GameStateScenarioB(
167167
[TypeConverter(typeof(ExpandableObjectConverter))]
168168
[LocoStructSize(0x79D80)]
169169
public record GameStateScenarioC(
170-
[property: LocoStructOffset(0x0), LocoArrayLength((int)Limits.kMaxAnimations)] Animation[] Animations,
171-
[property: LocoStructOffset(0xC000), LocoArrayLength((int)Limits.kMaxWaves)] Wave[] Waves,
172-
[property: LocoStructOffset(0xC180), LocoArrayLength((int)Limits.kMaxUserStrings * 32)] uint8_t[] UserStrings,
173-
[property: LocoStructOffset(0x1C180), LocoArrayLength((int)(Limits.kMaxVehicles * Limits.kMaxRoutingsPerVehicle))] uint16_t[] Routings,
174-
[property: LocoStructOffset(0x3B580), LocoArrayLength((int)Limits.kMaxWaves)] uint8_t[] Orders
170+
[property: LocoStructOffset(0x0), LocoArrayLength((int)Limits.kMaxAnimations), Browsable(false)] Animation[] Animations,
171+
[property: LocoStructOffset(0xC000), LocoArrayLength((int)Limits.kMaxWaves), Browsable(false)] Wave[] Waves,
172+
[property: LocoStructOffset(0xC180), LocoArrayLength((int)Limits.kMaxUserStrings * 32), Browsable(false)] uint8_t[] UserStrings,
173+
[property: LocoStructOffset(0x1C180), LocoArrayLength((int)(Limits.kMaxVehicles * Limits.kMaxRoutingsPerVehicle)), Browsable(false)] uint16_t[] Routings,
174+
[property: LocoStructOffset(0x3B580), LocoArrayLength((int)Limits.kMaxWaves), Browsable(false)] uint8_t[] Orders
175175
) : ILocoStruct
176176
{
177177
public bool Validate() => true;

Dat/Types/SCV5/Message.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using OpenLoco.Dat.FileParsing;
2+
using System.ComponentModel;
23

34
namespace OpenLoco.Dat.Types.SCV5
45
{
6+
[TypeConverter(typeof(ExpandableObjectConverter))]
57
[LocoStructSize(0xD4)]
68
public class Message : ILocoStruct
79
{

Dat/Types/SCV5/S5File.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static int GetMaxObjectCount(ObjectType objectType)
8585
[LocoStructSize(StructLength)]
8686
public record S5File(
8787
[property: LocoStructOffset(0x00)] S5FileHeader Header,
88-
[property: LocoStructOffset(0x20)] ScenarioOptions? LandscapeOptions,
88+
[property: LocoStructOffset(0x20)] ScenarioOptions? ScenarioOptions,
8989
[property: LocoStructOffset(0x433A)] SaveDetails? SaveDetails,
9090
[property: LocoStructOffset(0x10952), LocoArrayLength(S5File.RequiredObjectsCount), Browsable(false)] List<S5Header> RequiredObjects,
9191
IGameState? GameState,
@@ -115,7 +115,7 @@ public byte[] Write()
115115

116116
if (Header.Type == S5FileType.Scenario)
117117
{
118-
scenario = SawyerStreamWriter.WriteChunk(LandscapeOptions, SawyerEncoding.Rotate);
118+
scenario = SawyerStreamWriter.WriteChunk(ScenarioOptions, SawyerEncoding.Rotate);
119119
}
120120

121121
// packed

Dat/Types/SCV5/SaveDetails.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ namespace OpenLoco.Dat.Types.SCV5
55
{
66
[TypeConverter(typeof(ExpandableObjectConverter))]
77
[LocoStructSize(StructLength)]
8-
public record SaveDetails([property: LocoStructOffset(0x00), LocoArrayLength(256)] char_t[] Company,
9-
[property: LocoStructOffset(0x100), LocoArrayLength(256)] char_t[] Owner,
8+
public record SaveDetails(
9+
[property: LocoStructOffset(0x00), LocoArrayLength(256), Browsable(false)] char_t[] Company,
10+
[property: LocoStructOffset(0x100), LocoArrayLength(256), Browsable(false)] char_t[] Owner,
1011
[property: LocoStructOffset(0x200)] uint32_t Date,
1112
[property: LocoStructOffset(0x204)] uint16_t PerformanceIndex,
12-
[property: LocoStructOffset(0x206), LocoArrayLength(64)] char_t[] Scenario,
13+
[property: LocoStructOffset(0x206), LocoArrayLength(64), Browsable(false)] char_t[] Scenario,
1314
[property: LocoStructOffset(0x246)] uint8_t ChallengeProgress,
1415
[property: LocoStructOffset(0x247)] byte var_247,
15-
[property: LocoStructOffset(0x248), LocoArrayLength(250 * 200)] uint8_t[] Image,
16+
[property: LocoStructOffset(0x248), LocoArrayLength(250 * 200), Browsable(false)] uint8_t[] Image,
1617
[property: LocoStructOffset(0xC598)] CompanyFlags ChallengeFlags,
17-
[property: LocoStructOffset(0xC59C), LocoArrayLength(124)] byte[] var_C59C)
18+
[property: LocoStructOffset(0xC59C), LocoArrayLength(124), Browsable(false)] byte[] var_C59C)
1819
: ILocoStruct
1920
{
2021
public const int StructLength = 0xC618;

Dat/Types/SCV5/ScenarioOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public record ScenarioOptions(
1414
[property: LocoStructOffset(0x08)] uint8_t MadeAnyChanges,
1515
[property: LocoStructOffset(0x09)] uint8_t var_9,
1616
[property: LocoStructOffset(0x0A), LocoArrayLength(32)] LandDistributionPattern LandDistributionPatterns,
17-
[property: LocoStructOffset(0x2A), LocoArrayLength(64)] char_t[] ScenarioName, // this is a string
18-
[property: LocoStructOffset(0x6A), LocoArrayLength(256)] char_t[] ScenarioDetails, // this is a string
17+
[property: LocoStructOffset(0x2A), LocoArrayLength(64), Browsable(false)] char_t[] ScenarioName, // this is a string
18+
[property: LocoStructOffset(0x6A), LocoArrayLength(256), Browsable(false)] char_t[] ScenarioDetails, // this is a string
1919
[property: LocoStructOffset(0x16A)] S5Header ScenarioText,
2020
[property: LocoStructOffset(0x17A)] uint16_t NumberOfForests,
2121
[property: LocoStructOffset(0x17C)] uint8_t MinForestRadius,
@@ -31,7 +31,7 @@ public record ScenarioOptions(
3131
[property: LocoStructOffset(0x187)] uint8_t NumberOfTowns,
3232
[property: LocoStructOffset(0x188)] uint8_t MaxTownSize,
3333
[property: LocoStructOffset(0x189)] uint8_t NumberOfIndustries,
34-
[property: LocoStructOffset(0x18A), LocoArrayLength(128 * 128)] uint8_t[] Preview,
34+
[property: LocoStructOffset(0x18A), LocoArrayLength(128 * 128), Browsable(false)] uint8_t[] Preview,
3535
[property: LocoStructOffset(0x418A)] uint8_t MaxCompetingCompanies,
3636
[property: LocoStructOffset(0x418B)] uint8_t CompetitorStartDelay,
3737
[property: LocoStructOffset(0x418C)] ScenarioObjective Objective,
@@ -45,7 +45,7 @@ public record ScenarioOptions(
4545
[property: LocoStructOffset(0x41C1)] uint8_t MaxRiverWidth,
4646
[property: LocoStructOffset(0x41C2)] uint8_t RiverbankWidth,
4747
[property: LocoStructOffset(0x41C3)] uint8_t RiverMeanderRate,
48-
[property: LocoStructOffset(0x41C4), LocoArrayLength(342)] byte[] var_41C4) : ILocoStruct
48+
[property: LocoStructOffset(0x41C4), LocoArrayLength(342), Browsable(false)] byte[] var_41C4) : ILocoStruct
4949
{
5050
public const int StructLength = 0x431A;
5151
public bool Validate() => true;

Definitions/DTO/DtoExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static TblDatObject ToTable(this DtoDatObjectEntry dto)
9191
=> new() { Id = dto.Id, DatName = dto.DatName, DatChecksum = dto.DatChecksum, xxHash3 = dto.xxHash3, ObjectId = dto.ObjectId };
9292

9393
public static DtoObjectEntry ToDtoEntry(this TblObject table)
94-
=> new(table.Id, table.Name, table.DatObjects.FirstOrDefault()?.DatName ?? "<--->", table.Description, table.ObjectSource, table.ObjectType, table.VehicleType, table.CreatedDate, table.ModifiedDate, table.UploadedDate);
94+
=> new(table.Id, table.Name, table.DatObjects.FirstOrDefault()?.DatName ?? "<--->", table.DatObjects.FirstOrDefault()?.DatChecksum, table.Description, table.ObjectSource, table.ObjectType, table.VehicleType, table.CreatedDate, table.ModifiedDate, table.UploadedDate);
9595

9696
public static TblObject ToTable(this DtoObjectEntry dto)
9797
=> new() { Id = dto.Id, Name = dto.InternalName, Description = dto.Description, ObjectSource = dto.ObjectSource, ObjectType = dto.ObjectType, VehicleType = dto.VehicleType, CreatedDate = dto.CreatedDate, ModifiedDate = dto.ModifiedDate, UploadedDate = dto.UploadedDate };

Definitions/DTO/DtoObjectEntry.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public record DtoObjectEntry(
77
DbKey Id,
88
string InternalName,
99
string DisplayName,
10+
uint? DatChecksum,
1011
string? Description,
1112
ObjectSource ObjectSource,
1213
ObjectType ObjectType,

Gui/Models/ObjectEditorModel.cs

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -187,61 +187,65 @@ bool TryLoadOnlineFile(FileSystemItemBase filesystemItem, out UiDatLocoFile? loc
187187

188188
if (!OnlineCache.TryGetValue(uniqueObjectId, out var cachedLocoObjDto)) // issue - if an object doesn't download its full file, it's 'header' will remain in cache but unable to attempt redownload
189189
{
190+
Logger.Debug($"Didn't find object {filesystemItem.DisplayName} with unique id {uniqueObjectId} in cache - downloading it from {ObjectServiceClient.WebClient.BaseAddress}");
191+
190192
if (ObjectServiceClient == null)
191193
{
192194
Logger.Error("Object service client is null");
193195
return false;
194196
}
195197

196-
Logger.Debug($"Didn't find object {filesystemItem.DisplayName} with unique id {uniqueObjectId} in cache - downloading it from {ObjectServiceClient.WebClient.BaseAddress}");
197198
cachedLocoObjDto = Task.Run(async () => await ObjectServiceClient.GetObjectAsync(uniqueObjectId)).Result;
198199

199200
if (cachedLocoObjDto == null)
200201
{
201202
Logger.Error($"Unable to download object {filesystemItem.DisplayName} with unique id {uniqueObjectId} from online - received no data");
202203
return false;
203204
}
204-
else if (string.IsNullOrEmpty(cachedLocoObjDto.DatObjects.FirstOrDefault()?.DatBytes))
205+
206+
Logger.Debug(cachedLocoObjDto.ToString());
207+
Logger.Info($"Object {filesystemItem.DisplayName} with unique id {uniqueObjectId} has {cachedLocoObjDto.DatObjects} attached DAT objects");
208+
209+
foreach (var datObject in cachedLocoObjDto.DatObjects)
205210
{
206211
if (cachedLocoObjDto.ObjectSource is ObjectSource.LocomotionSteam or ObjectSource.LocomotionGoG)
207212
{
208-
Logger.Warning("This is a vanilla object. The DAT file cannot be downloaded due to copyright. Any available metadata will still be shown.");
213+
Logger.Warning($"Unable to download object {filesystemItem.DisplayName} with unique id {uniqueObjectId} from online - requested object is a vanilla object and it is illegal to distribute copyright material. Any available metadata will still be shown");
214+
continue;
209215
}
210216

211-
Logger.Warning($"Unable to download object {filesystemItem.DisplayName} with unique id {uniqueObjectId} from online - received no DAT object data. Any available metadata will still be shown.");
212-
}
213-
else if (cachedLocoObjDto.ObjectSource is ObjectSource.LocomotionSteam or ObjectSource.LocomotionGoG)
214-
{
215-
Logger.Warning($"Unable to download object {filesystemItem.DisplayName} with unique id {uniqueObjectId} from online - requested object is a vanilla object and it is illegal to distribute copyright material. Any available metadata will still be shown.");
216-
}
217-
218-
Logger.Debug(cachedLocoObjDto.ToString());
217+
if (string.IsNullOrEmpty(datObject.DatBytes))
218+
{
219+
Logger.Warning($"Unable to download object {filesystemItem.DisplayName} with unique id {uniqueObjectId} from online - received no DAT object data. Any available metadata will still be shown");
220+
continue;
221+
}
219222

220-
var datFile = Convert.FromBase64String(cachedLocoObjDto.DatObjects.First().DatBytes);
221-
if (datFile == null || datFile.Length == 0)
222-
{
223-
Logger.Warning($"Unable to download object {filesystemItem.DisplayName} with unique id {uniqueObjectId} from online - received no DAT object data. Any available metadata will still be shown.");
224-
}
225-
else
226-
{
227-
var filename = Path.Combine(Settings.DownloadFolder, $"{cachedLocoObjDto.InternalName}.dat");
228-
if (!File.Exists(filename))
223+
var datFile = Convert.FromBase64String(datObject.DatBytes);
224+
if (datFile == null || datFile.Length == 0)
229225
{
230-
File.WriteAllBytes(filename, datFile);
231-
Logger.Info($"Saved the downloaded object {filesystemItem.DisplayName} with unique id {uniqueObjectId} as {filename}");
226+
Logger.Warning($"Unable to download object {filesystemItem.DisplayName} with unique id {uniqueObjectId} from online - received DAT object data, but it was unable to be decoded. Any available metadata will still be shown");
227+
continue;
228+
}
232229

233-
var obj = SawyerStreamReader.LoadFullObjectFromStream(datFile, Logger, $"{filesystemItem.Filename}-{filesystemItem.DisplayName}", true);
234-
fileInfo = obj.DatFileInfo;
235-
locoObject = obj.LocoObject;
236-
if (obj.LocoObject == null)
237-
{
238-
Logger.Warning($"Unable to load {filesystemItem.DisplayName} from the received DAT object data");
239-
}
230+
var filename = $"{cachedLocoObjDto.DisplayName}-{cachedLocoObjDto.Id}.dat";
231+
var pathname = Path.Combine(Settings.DownloadFolder, filename);
232+
if (!File.Exists(pathname))
233+
{
234+
File.WriteAllBytes(pathname, datFile);
235+
Logger.Info($"Saved the downloaded object {filesystemItem.DisplayName} with unique id {uniqueObjectId} as {pathname}");
236+
237+
//var obj = SawyerStreamReader.LoadFullObjectFromStream(datFile, Logger, $"{filesystemItem.Filename}-{filesystemItem.DisplayName}", true);
238+
//fileInfo = obj.DatFileInfo;
239+
//locoObject = obj.LocoObject;
240+
//if (obj.LocoObject == null)
241+
//{
242+
// Logger.Warning($"Unable to load {filesystemItem.DisplayName} from the received DAT object data");
243+
//}
240244
}
241245
}
242246

243247
Logger.Info($"Downloaded object \"{filesystemItem.DisplayName}\" with unique id {uniqueObjectId} and added it to the local cache");
244-
Logger.Debug($"{filesystemItem.DisplayName} has authors=[{string.Join(", ", cachedLocoObjDto?.Authors?.Select(x => x.Name) ?? [])}], tags=[{string.Join(", ", cachedLocoObjDto?.Tags?.Select(x => x.Name) ?? [])}], objectpacks=[{string.Join(", ", cachedLocoObjDto?.ObjectPacks?.Select(x => x.Name) ?? [])}], licence={cachedLocoObjDto?.Licence}");
248+
Logger.Debug($"{filesystemItem.DisplayName} has authors=[{string.Join(", ", cachedLocoObjDto?.Authors?.Select(x => x.Name) ?? [])}], tags=[{string.Join(", ", cachedLocoObjDto?.Tags?.Select(x => x.Name) ?? [])}], objectpacks=[{string.Join(", ", cachedLocoObjDto?.ObjectPacks?.Select(x => x.Name) ?? [])}], licence={cachedLocoObjDto?.Licence} datobjects=[{string.Join(",", cachedLocoObjDto?.DatObjects?.Select(x => x.DatName) ?? [])}]");
245249

246250
OnlineCache.Add(uniqueObjectId, cachedLocoObjDto!);
247251
}
@@ -265,7 +269,13 @@ bool TryLoadOnlineFile(FileSystemItemBase filesystemItem, out UiDatLocoFile? loc
265269
}
266270
else
267271
{
268-
Logger.Error($"Caches object {filesystemItem.DisplayName} had no data in DatBytes");
272+
Logger.Warning($"Cached object {filesystemItem.DisplayName} had no data in DatBytes");
273+
var fakeS5Header = new S5Header(0, firstLinkedDatFile.DatName, firstLinkedDatFile.DatChecksum)
274+
{
275+
ObjectType = cachedLocoObjDto.ObjectType,
276+
SourceGame = cachedLocoObjDto.ObjectSource.ToSourceGame()
277+
};
278+
fileInfo = new DatFileInfo(fakeS5Header, ObjectHeader.NullHeader);
269279
}
270280

271281
metadata = new MetadataModel(cachedLocoObjDto.InternalName)

0 commit comments

Comments
 (0)