* get rid of file handling through grpc and signalr * make non empty uri for serialization * adjust api DataHash calc into their respective classes * Revert "adapt api extensions" This reverts commit5fb78ba367. * Revert "adapt userpermissions" This reverts commit28dd123ca6. * Revert "Revert "adapt api extensions"" This reverts commit 12c9bc3c53566532e2984ace0b3d2e0a8b7facc0. * Revert "Revert "adapt userpermissions"" This reverts commit 4193ac008cccf2f5b42e9cdf50b2a084877cbf9a. * update flags * add upload status to server --------- Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using MareSynchronos.API.Data.Enum;
|
|
using MessagePack;
|
|
using System.Text.Json.Serialization;
|
|
using System.Text.Json;
|
|
using System.Text;
|
|
using System.Security.Cryptography;
|
|
|
|
namespace MareSynchronos.API.Data;
|
|
|
|
[MessagePackObject(keyAsPropertyName: true)]
|
|
public class CharacterData
|
|
{
|
|
public CharacterData()
|
|
{
|
|
DataHash = new(() =>
|
|
{
|
|
var json = JsonSerializer.Serialize(this);
|
|
#pragma warning disable SYSLIB0021 // Type or member is obsolete
|
|
using SHA256CryptoServiceProvider cryptoProvider = new();
|
|
#pragma warning restore SYSLIB0021 // Type or member is obsolete
|
|
return BitConverter.ToString(cryptoProvider.ComputeHash(Encoding.UTF8.GetBytes(json))).Replace("-", "", StringComparison.Ordinal);
|
|
});
|
|
}
|
|
|
|
[JsonIgnore]
|
|
public Lazy<string> DataHash { get; }
|
|
|
|
public Dictionary<ObjectKind, List<FileReplacementData>> FileReplacements { get; set; } = new();
|
|
public Dictionary<ObjectKind, string> GlamourerData { get; set; } = new();
|
|
public string ManipulationData { get; set; } = string.Empty;
|
|
public string CustomizePlusData { get; set; } = string.Empty;
|
|
public string PalettePlusData { get; set; } = string.Empty;
|
|
public float HeelsOffset { get; set; } = 0.0f;
|
|
} |