forked from kwsch/NHSE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented wherearen.dat and Player.WhereAreN.Poki (kwsch#564)
* implemented wherearen.data and Player.WhereAreN.Poki * Make wherearen savedata presence optional
- Loading branch information
Showing
11 changed files
with
157 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace NHSE.Core | ||
{ | ||
/// <summary> | ||
/// </summary> | ||
public sealed class WhereAreN : EncryptedFilePair | ||
{ | ||
public const string FileName = "wherearen"; | ||
|
||
public readonly WhereAreNOffsets Offsets; | ||
public WhereAreN(string folder) : base(folder, FileName) => Offsets = WhereAreNOffsets.GetOffsets(Info); | ||
|
||
public EncryptedInt32 Poki | ||
{ | ||
get => EncryptedInt32.ReadVerify(Data, Offsets.Poki); | ||
set => value.Write(Data, Offsets.Poki); | ||
} | ||
} | ||
} |
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,25 @@ | ||
using System; | ||
|
||
namespace NHSE.Core | ||
{ | ||
/// <summary> | ||
/// Offset info and object retrieval logic for <see cref="Personal"/> | ||
/// </summary> | ||
public abstract class WhereAreNOffsets | ||
{ | ||
public abstract int Poki { get; } | ||
|
||
public static WhereAreNOffsets GetOffsets(FileHeaderInfo Info) | ||
{ | ||
var rev = Info.GetKnownRevisionIndex(); | ||
return rev switch | ||
{ | ||
22 => new WhereAreNOffsets20(), | ||
23 => new WhereAreNOffsets20(), | ||
24 => new WhereAreNOffsets20(), | ||
25 => new WhereAreNOffsets20(), | ||
_ => throw new IndexOutOfRangeException("Unknown revision!" + Environment.NewLine + Info), | ||
}; | ||
} | ||
} | ||
} |
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 @@ | ||
namespace NHSE.Core | ||
{ | ||
/// <summary> | ||
/// <inheritdoc cref="PersonalOffsets"/> | ||
/// </summary> | ||
public sealed class WhereAreNOffsets20 : WhereAreNOffsets | ||
{ | ||
public override int Poki => 0xB84228; | ||
} | ||
} |
Oops, something went wrong.