Add MCDO (#20)
* rudimentary charadata first impl * dto adaptation * mark as msgpack, split file * erghtyfjgk * fileswapapapapwpwpdpfdesgb * use userdata * add gamepath to orig file * rework some shit * make serializable * add manip data * naming * make prop public * renaming * add pose shit * fix api * adjust worlddata * make record struct * record struct deez * bump apilevel --------- Co-authored-by: Stanley Dimant <root.darkarchon@outlook.com>
This commit is contained in:
9
MareSynchronosAPI/Dto/CharaData/AccessTypeDto.cs
Normal file
9
MareSynchronosAPI/Dto/CharaData/AccessTypeDto.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace MareSynchronos.API.Dto.CharaData;
|
||||||
|
|
||||||
|
public enum AccessTypeDto
|
||||||
|
{
|
||||||
|
Individuals,
|
||||||
|
ClosePairs,
|
||||||
|
AllPairs,
|
||||||
|
Public
|
||||||
|
}
|
||||||
14
MareSynchronosAPI/Dto/CharaData/CharaDataDownloadDto.cs
Normal file
14
MareSynchronosAPI/Dto/CharaData/CharaDataDownloadDto.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using MareSynchronos.API.Data;
|
||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace MareSynchronos.API.Dto.CharaData;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public record CharaDataDownloadDto(string Id, UserData Uploader) : CharaDataDto(Id, Uploader)
|
||||||
|
{
|
||||||
|
public string GlamourerData { get; init; } = string.Empty;
|
||||||
|
public string CustomizeData { get; init; } = string.Empty;
|
||||||
|
public string ManipulationData { get; set; } = string.Empty;
|
||||||
|
public List<GamePathEntry> FileGamePaths { get; init; } = [];
|
||||||
|
public List<GamePathEntry> FileSwaps { get; init; } = [];
|
||||||
|
}
|
||||||
9
MareSynchronosAPI/Dto/CharaData/CharaDataDto.cs
Normal file
9
MareSynchronosAPI/Dto/CharaData/CharaDataDto.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using MareSynchronos.API.Data;
|
||||||
|
|
||||||
|
namespace MareSynchronos.API.Dto.CharaData;
|
||||||
|
|
||||||
|
public record CharaDataDto(string Id, UserData Uploader)
|
||||||
|
{
|
||||||
|
public string Description { get; init; } = string.Empty;
|
||||||
|
public DateTime UpdatedDate { get; init; }
|
||||||
|
}
|
||||||
61
MareSynchronosAPI/Dto/CharaData/CharaDataFullDto.cs
Normal file
61
MareSynchronosAPI/Dto/CharaData/CharaDataFullDto.cs
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
using MareSynchronos.API.Data;
|
||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace MareSynchronos.API.Dto.CharaData;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public record CharaDataFullDto(string Id, UserData Uploader) : CharaDataDto(Id, Uploader)
|
||||||
|
{
|
||||||
|
public DateTime CreatedDate { get; init; }
|
||||||
|
public DateTime ExpiryDate { get; set; }
|
||||||
|
public string GlamourerData { get; set; } = string.Empty;
|
||||||
|
public string CustomizeData { get; set; } = string.Empty;
|
||||||
|
public string ManipulationData { get; set; } = string.Empty;
|
||||||
|
public int DownloadCount { get; set; } = 0;
|
||||||
|
public List<UserData> AllowedUsers { get; set; } = [];
|
||||||
|
public List<GamePathEntry> FileGamePaths { get; set; } = [];
|
||||||
|
public List<GamePathEntry> FileSwaps { get; set; } = [];
|
||||||
|
public List<GamePathEntry> OriginalFiles { get; set; } = [];
|
||||||
|
public AccessTypeDto AccessType { get; set; }
|
||||||
|
public ShareTypeDto ShareType { get; set; }
|
||||||
|
public List<PoseEntry> PoseData { get; set; } = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public record GamePathEntry(string HashOrFileSwap, string GamePath);
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public record PoseEntry(long? Id)
|
||||||
|
{
|
||||||
|
public string? Description { get; set; } = string.Empty;
|
||||||
|
public string? PoseData { get; set; } = string.Empty;
|
||||||
|
public WorldData? WorldData { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[MessagePackObject]
|
||||||
|
public record struct WorldData
|
||||||
|
{
|
||||||
|
[Key(0)] public LocationInfo LocationInfo { get; set; }
|
||||||
|
[Key(1)] public float PositionX { get; set; }
|
||||||
|
[Key(2)] public float PositionY { get; set; }
|
||||||
|
[Key(3)] public float PositionZ { get; set; }
|
||||||
|
[Key(4)] public float RotationX { get; set; }
|
||||||
|
[Key(5)] public float RotationY { get; set; }
|
||||||
|
[Key(6)] public float RotationZ { get; set; }
|
||||||
|
[Key(7)] public float RotationW { get; set; }
|
||||||
|
[Key(8)] public float ScaleX { get; set; }
|
||||||
|
[Key(9)] public float ScaleY { get; set; }
|
||||||
|
[Key(10)] public float ScaleZ { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[MessagePackObject]
|
||||||
|
public record struct LocationInfo
|
||||||
|
{
|
||||||
|
[Key(0)] public uint ServerId { get; set; }
|
||||||
|
[Key(1)] public uint MapId { get; set; }
|
||||||
|
[Key(2)] public uint TerritoryId { get; set; }
|
||||||
|
[Key(3)] public uint DivisionId { get; set; }
|
||||||
|
[Key(4)] public uint WardId { get; set; }
|
||||||
|
[Key(5)] public uint HouseId { get; set; }
|
||||||
|
[Key(6)] public uint RoomId { get; set; }
|
||||||
|
}
|
||||||
11
MareSynchronosAPI/Dto/CharaData/CharaDataMetaInfoDto.cs
Normal file
11
MareSynchronosAPI/Dto/CharaData/CharaDataMetaInfoDto.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using MareSynchronos.API.Data;
|
||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace MareSynchronos.API.Dto.CharaData;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public record CharaDataMetaInfoDto(string Id, UserData Uploader) : CharaDataDto(Id, Uploader)
|
||||||
|
{
|
||||||
|
public bool CanBeDownloaded { get; init; }
|
||||||
|
public List<PoseEntry> PoseData { get; set; } = [];
|
||||||
|
}
|
||||||
19
MareSynchronosAPI/Dto/CharaData/CharaDataUpdateDto.cs
Normal file
19
MareSynchronosAPI/Dto/CharaData/CharaDataUpdateDto.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using MessagePack;
|
||||||
|
|
||||||
|
namespace MareSynchronos.API.Dto.CharaData;
|
||||||
|
|
||||||
|
[MessagePackObject(keyAsPropertyName: true)]
|
||||||
|
public record CharaDataUpdateDto(string Id)
|
||||||
|
{
|
||||||
|
public string? Description { get; set; }
|
||||||
|
public DateTime? ExpiryDate { get; set; }
|
||||||
|
public string? GlamourerData { get; set; }
|
||||||
|
public string? CustomizeData { get; set; }
|
||||||
|
public string? ManipulationData { get; set; }
|
||||||
|
public List<string>? AllowedUsers { get; set; }
|
||||||
|
public List<GamePathEntry>? FileGamePaths { get; set; }
|
||||||
|
public List<GamePathEntry>? FileSwaps { get; set; }
|
||||||
|
public AccessTypeDto? AccessType { get; set; }
|
||||||
|
public ShareTypeDto? ShareType { get; set; }
|
||||||
|
public List<PoseEntry>? Poses { get; set; }
|
||||||
|
}
|
||||||
7
MareSynchronosAPI/Dto/CharaData/ShareTypeDto.cs
Normal file
7
MareSynchronosAPI/Dto/CharaData/ShareTypeDto.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace MareSynchronos.API.Dto.CharaData;
|
||||||
|
|
||||||
|
public enum ShareTypeDto
|
||||||
|
{
|
||||||
|
Private,
|
||||||
|
Shared
|
||||||
|
}
|
||||||
@@ -21,4 +21,5 @@ public record ServerInfo
|
|||||||
public int MaxGroupsCreatedByUser { get; set; }
|
public int MaxGroupsCreatedByUser { get; set; }
|
||||||
public int MaxGroupsJoinedByUser { get; set; }
|
public int MaxGroupsJoinedByUser { get; set; }
|
||||||
public Uri FileServerAddress { get; set; } = new Uri("http://nonemptyuri");
|
public Uri FileServerAddress { get; set; } = new Uri("http://nonemptyuri");
|
||||||
|
public int MaxCharaData { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using MareSynchronos.API.Data;
|
using MareSynchronos.API.Data;
|
||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.API.Dto;
|
using MareSynchronos.API.Dto;
|
||||||
|
using MareSynchronos.API.Dto.CharaData;
|
||||||
using MareSynchronos.API.Dto.Chat;
|
using MareSynchronos.API.Dto.Chat;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.API.Dto.User;
|
using MareSynchronos.API.Dto.User;
|
||||||
@@ -118,4 +119,12 @@ public interface IMareHub
|
|||||||
Task UserSetPairPermissions(UserPermissionsDto userPermissions);
|
Task UserSetPairPermissions(UserPermissionsDto userPermissions);
|
||||||
|
|
||||||
Task UserSetProfile(UserProfileDto userDescription);
|
Task UserSetProfile(UserProfileDto userDescription);
|
||||||
|
|
||||||
|
Task<CharaDataFullDto?> CharaDataCreate();
|
||||||
|
Task<CharaDataFullDto?> CharaDataUpdate(CharaDataUpdateDto updateDto);
|
||||||
|
Task<bool> CharaDataDelete(string id);
|
||||||
|
Task<CharaDataMetaInfoDto?> CharaDataGetMetainfo(string id);
|
||||||
|
Task<CharaDataDownloadDto?> CharaDataDownload(string id);
|
||||||
|
Task<List<CharaDataFullDto>> CharaDataGetOwn();
|
||||||
|
Task<List<CharaDataMetaInfoDto>> CharaDataGetShared();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user