-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX]: Fixed bad reads on property arrays
[MISC]: Implemented ExtraData [MISC]: Release 0.0.13
- Loading branch information
Showing
54 changed files
with
760 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
SatisfactorySaveNet.Abstracts/Exceptions/BadReadException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Runtime.Serialization; | ||
using System; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Exceptions; | ||
|
||
[Serializable] | ||
public class BadReadException : SatisFactoryException | ||
{ | ||
public BadReadException() | ||
{ | ||
} | ||
|
||
public BadReadException(string? message) : base(message) | ||
{ | ||
} | ||
|
||
public BadReadException(string? message, Exception? innerException) : base(message, innerException) | ||
{ | ||
} | ||
|
||
protected BadReadException(SerializationInfo info, StreamingContext context) : base(info, context) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Model.Extra; | ||
|
||
public class BlueprintData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.BlueprintData; | ||
|
||
public int Count { get; set; } | ||
public required ICollection<ObjectReference> Objects { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class CargoObject | ||
{ | ||
public string Name { get; set; } = string.Empty; | ||
public string Unknown { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using SatisfactorySaveNet.Abstracts.Model; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class Circuit | ||
{ | ||
public int CircuitId { get; set; } | ||
public required ObjectReference ObjectReference { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using SatisfactorySaveNet.Abstracts.Model.Extra; | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class CircuitData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.CircuitData; | ||
|
||
public int Count { get; set; } | ||
public required ICollection<Circuit> Circuits { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Model.Extra; | ||
|
||
public class ConveyorData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.Conveyor; | ||
|
||
public int Count { get; set; } | ||
public required ICollection<Item> Items { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using SatisfactorySaveNet.Abstracts.Model.Properties; | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class DroneStationAction | ||
{ | ||
public string Name { get; set; } = string.Empty; | ||
public required ICollection<Property> Properties { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using SatisfactorySaveNet.Abstracts.Model.Extra; | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class DroneStationData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.DroneStationData; | ||
|
||
public int Unknown1 { get; set; } | ||
public int Unknown2 { get; set; } | ||
/// <summary> | ||
/// Should only be null if Missing is filled, which indicates that there were unparseable data | ||
/// </summary> | ||
public ICollection<DroneStationAction>? ActiveActions { get; set; } | ||
/// <summary> | ||
/// Should only be null if Missing is filled, which indicates that there were unparseable data | ||
/// </summary> | ||
public ICollection<DroneStationAction>? ActionQueue { get; set; } | ||
public string? Missing { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace SatisfactorySaveNet.Abstracts.Model.Extra; | ||
|
||
public abstract class ExtraData | ||
{ | ||
public abstract ExtraDataConstraint Type { get; } | ||
} |
14 changes: 14 additions & 0 deletions
14
SatisfactorySaveNet.Abstracts/Extra/ExtraDataConstraint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace SatisfactorySaveNet.Abstracts.Model.Extra; | ||
|
||
public enum ExtraDataConstraint | ||
{ | ||
Conveyor, | ||
BlueprintData, | ||
PlayerData, | ||
PowerLineData, | ||
VehicleData, | ||
LocomotiveData, | ||
DroneStationData, | ||
CircuitData, | ||
UnknownExtraData | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using SatisfactorySaveNet.Abstracts.Model; | ||
using SatisfactorySaveNet.Abstracts.Model.Extra; | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class LocomotiveData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.LocomotiveData; | ||
|
||
public int Count { get; set; } | ||
public required ICollection<CargoObject> CargoObjects { get; set; } | ||
public required ObjectReference Previous { get; set; } | ||
public required ObjectReference Next { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace SatisfactorySaveNet.Abstracts.Model.Extra; | ||
|
||
public class PlayerData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.PlayerData; | ||
|
||
public string? Missing { get; set; } | ||
public byte PlayerType { get; set; } | ||
public string? EpicOnlineServicesId { get; set; } | ||
public string? SteamId { get; set; } | ||
public string? PlatformId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using SatisfactorySaveNet.Abstracts.Maths.Vector; | ||
using SatisfactorySaveNet.Abstracts.Model; | ||
using SatisfactorySaveNet.Abstracts.Model.Extra; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class PowerLineData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.PowerLineData; | ||
|
||
public int Count { get; set; } | ||
public required ObjectReference Source { get; set; } | ||
public required ObjectReference Target { get; set; } | ||
public Vector3? SourceTranslation { get; set; } | ||
public Vector3? TargetTranslation { get; set;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using SatisfactorySaveNet.Abstracts.Model.Extra; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class UnknownExtraData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.UnknownExtraData; | ||
|
||
public string Missing { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using SatisfactorySaveNet.Abstracts.Model.Extra; | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Extra; | ||
|
||
public class VehicleData : ExtraData | ||
{ | ||
public override ExtraDataConstraint Type => ExtraDataConstraint.VehicleData; | ||
|
||
public int Count { get; set; } | ||
public required ICollection<CargoObject> CargoObjects { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using SatisfactorySaveNet.Abstracts.Model; | ||
using SatisfactorySaveNet.Abstracts.Model.Extra; | ||
using System.IO; | ||
|
||
namespace SatisfactorySaveNet.Abstracts; | ||
|
||
public interface IExtraDataSerializer | ||
{ | ||
public ExtraData? Deserialize(BinaryReader reader, string typePath, Header header, long expectedPosition); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using SatisfactorySaveNet.Abstracts.Maths.Vector; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Model; | ||
|
||
public class Item | ||
{ | ||
public string Name { get; set; } = string.Empty; | ||
public required ObjectReference ObjectReference { get; set; } | ||
/// <summary> | ||
/// Supposed to be a float, but Vec4 seems to be logical? | ||
/// </summary> | ||
public Vector4I Position { get; set; } | ||
public int Length { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace SatisfactorySaveNet.Abstracts.Model; | ||
|
||
public class Level | ||
{ | ||
public string Name { get; set; } = string.Empty; | ||
public IList<ObjectReference> Collectables { get; set; } = []; | ||
public IList<ComponentObject> Objects { get; set; } = []; | ||
public ICollection<ObjectReference> Collectables { get; set; } = []; | ||
public ICollection<ComponentObject> Objects { get; set; } = []; | ||
[Obsolete("These information seem to be obsolete")] | ||
public IList<ObjectReference>? SecondCollectables { get; set; } = []; | ||
public ICollection<ObjectReference>? SecondCollectables { get; set; } = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
SatisfactorySaveNet.Abstracts/Model/Properties/ArrayByteProperty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.Generic; | ||
namespace SatisfactorySaveNet.Abstracts.Model.Properties; | ||
|
||
public class ArrayByteProperty : IArrayProperty | ||
{ | ||
public IList<sbyte> Values { get; set; } = []; | ||
public ICollection<sbyte> Values { get; set; } = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
SatisfactorySaveNet.Abstracts/Model/Properties/ArrayEnumProperty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.Generic; | ||
namespace SatisfactorySaveNet.Abstracts.Model.Properties; | ||
|
||
public class ArrayEnumProperty : IArrayProperty | ||
{ | ||
public IList<string> Values { get; set; } = []; | ||
public ICollection<string> Values { get; set; } = []; | ||
} |
4 changes: 2 additions & 2 deletions
4
SatisfactorySaveNet.Abstracts/Model/Properties/ArrayFloatProperty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.Generic; | ||
namespace SatisfactorySaveNet.Abstracts.Model.Properties; | ||
|
||
public class ArrayFloatProperty : IArrayProperty | ||
{ | ||
public IList<float> Values { get; set; } = []; | ||
public ICollection<float> Values { get; set; } = []; | ||
} |
Oops, something went wrong.