-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ivXor of CPlugVehiclePhyTuning (ty Auris!)
- Loading branch information
1 parent
0cb2f89
commit 2a85c39
Showing
2 changed files
with
30 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Text; | ||
|
||
namespace GBX.NET.Engines.Plug; | ||
|
||
public partial class CPlugVehiclePhyTuning | ||
{ | ||
public partial class Chunk090EB000 | ||
{ | ||
public override void ReadWrite(CPlugVehiclePhyTuning n, GbxReaderWriter rw) | ||
{ | ||
rw.Id(ref n.name); | ||
rw.NodeRef<CFuncKeysReal>(ref U01); | ||
rw.Single(ref U02); | ||
|
||
if (rw.Reader?.Settings.EncryptionInitializer is not null) | ||
{ | ||
if (n.name is null || n.name.Length < 4) | ||
{ | ||
throw new InvalidOperationException("Name length must be at least 4 characters."); | ||
} | ||
|
||
rw.Reader.Settings.EncryptionInitializer.Initialize(Encoding.ASCII.GetBytes(n.name.Substring(0, 4)), 0, 4); | ||
} | ||
} | ||
} | ||
} |
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