Compare commits

...

10 Commits

Author SHA1 Message Date
Stanley Dimant
eecd28b9bd update version 2025-03-27 16:26:06 +01:00
Stanley Dimant
2632fa5451 add some more logging and such 2025-02-26 15:51:23 +01:00
Stanley Dimant
e7221be14a add CharaDataAttemptRestore 2025-02-07 23:59:26 +01:00
rootdarkarchon
fa3201fdba most of gpose together impl (#21)
Co-authored-by: Stanley Dimant <root.darkarchon@outlook.com>
2025-01-19 14:27:18 +01:00
Stanley Dimant
395123f055 update api to include allowedgroups 2025-01-12 12:19:04 +01:00
rootdarkarchon
b4b8ff4a52 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>
2025-01-12 01:11:08 +01:00
Stanley Dimant
be05321ed0 Revert "net9 update"
This reverts commit 32657a2ae3.
2024-11-17 12:43:12 +01:00
Stanley Dimant
32657a2ae3 net9 update 2024-11-17 12:29:59 +01:00
Stanley Dimant
3979f8b0d4 add speedtest stuff or so 2024-11-11 12:45:52 +01:00
Stanley Dimant
dc1c409ec6 add api call to get uids based on secret key, renaming 2024-10-31 09:25:59 +01:00
13 changed files with 207 additions and 12 deletions

View File

@@ -0,0 +1,9 @@
namespace MareSynchronos.API.Dto.CharaData;
public enum AccessTypeDto
{
Individuals,
ClosePairs,
AllPairs,
Public
}

View 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; } = [];
}

View 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; }
}

View File

@@ -0,0 +1,88 @@
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<GroupData> AllowedGroups { 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; }
}
[MessagePackObject]
public record struct PoseData
{
[Key(0)] public bool IsDelta { get; set; }
[Key(1)] public Dictionary<string, BoneData> Bones { get; set; }
[Key(2)] public Dictionary<string, BoneData> MainHand { get; set; }
[Key(3)] public Dictionary<string, BoneData> OffHand { get; set; }
[Key(4)] public BoneData ModelDifference { get; set; }
}
[MessagePackObject]
public record struct BoneData
{
[Key(0)] public bool Exists { 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; }
}

View 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; } = [];
}

View File

@@ -0,0 +1,20 @@
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<string>? AllowedGroups { 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; }
}

View File

@@ -0,0 +1,7 @@
namespace MareSynchronos.API.Dto.CharaData;
public enum ShareTypeDto
{
Private,
Shared
}

View File

@@ -22,4 +22,6 @@ 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; }
public int MaxCharaDataVanity { get; set; }
} }

View File

@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MessagePack.Annotations" Version="2.5.187" /> <PackageReference Include="MessagePack.Annotations" Version="3.1.3" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -6,6 +6,7 @@ public class MareAuth
public const string Auth = "/auth"; public const string Auth = "/auth";
public const string Auth_CreateIdent = "createWithIdent"; public const string Auth_CreateIdent = "createWithIdent";
public const string Auth_RenewToken = "renewToken"; public const string Auth_RenewToken = "renewToken";
public const string OAuth_GetUIDsBasedOnSecretKeys = "getUIDsViaSecretKey";
public const string OAuth_CreateOAuth = "createWithOAuth"; public const string OAuth_CreateOAuth = "createWithOAuth";
public const string OAuth_RenewOAuthToken = "renewToken"; public const string OAuth_RenewOAuthToken = "renewToken";
public const string OAuth_GetDiscordOAuthEndpoint = "getDiscordOAuthEndpoint"; public const string OAuth_GetDiscordOAuthEndpoint = "getDiscordOAuthEndpoint";
@@ -15,7 +16,8 @@ public class MareAuth
public static Uri AuthWithOauthFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_CreateOAuth); public static Uri AuthWithOauthFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_CreateOAuth);
public static Uri RenewTokenFullPath(Uri baseUri) => new Uri(baseUri, Auth + "/" + Auth_RenewToken); public static Uri RenewTokenFullPath(Uri baseUri) => new Uri(baseUri, Auth + "/" + Auth_RenewToken);
public static Uri RenewOAuthTokenFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_RenewOAuthToken); public static Uri RenewOAuthTokenFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_RenewOAuthToken);
public static Uri GetDiscordOAuthEndpoint(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_GetDiscordOAuthEndpoint); public static Uri GetUIDsBasedOnSecretKeyFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_GetUIDsBasedOnSecretKeys);
public static Uri GetDiscordOAuthToken(Uri baseUri, string sessionId) => new Uri(baseUri, OAuth + "/" + OAuth_GetDiscordOAuthToken + "?sessionId=" + sessionId); public static Uri GetDiscordOAuthEndpointFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_GetDiscordOAuthEndpoint);
public static Uri GetUIDs(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_GetUIDs); public static Uri GetDiscordOAuthTokenFullPath(Uri baseUri, string sessionId) => new Uri(baseUri, OAuth + "/" + OAuth_GetDiscordOAuthToken + "?sessionId=" + sessionId);
public static Uri GetUIDsFullPath(Uri baseUri) => new Uri(baseUri, OAuth + "/" + OAuth_GetUIDs);
} }

View File

@@ -16,8 +16,8 @@ public class MareFiles
public const string ServerFiles_FilesSend = "filesSend"; public const string ServerFiles_FilesSend = "filesSend";
public const string ServerFiles_GetSizes = "getFileSizes"; public const string ServerFiles_GetSizes = "getFileSizes";
public const string ServerFiles_Upload = "upload"; public const string ServerFiles_Upload = "upload";
public const string ServerFiles_UploadRaw = "uploadRaw";
public const string ServerFiles_UploadMunged = "uploadMunged"; public const string ServerFiles_UploadMunged = "uploadMunged";
public const string ServerFiles_DownloadServers = "downloadServers";
public const string Distribution = "/dist"; public const string Distribution = "/dist";
public const string Distribution_Get = "get"; public const string Distribution_Get = "get";
@@ -25,6 +25,9 @@ public class MareFiles
public const string Main = "/main"; public const string Main = "/main";
public const string Main_SendReady = "sendReady"; public const string Main_SendReady = "sendReady";
public const string Speedtest = "/speedtest";
public const string Speedtest_Run = "run";
public static Uri CacheGetFullPath(Uri baseUri, Guid requestId) => new(baseUri, Cache + "/" + Cache_Get + "?requestId=" + requestId.ToString()); public static Uri CacheGetFullPath(Uri baseUri, Guid requestId) => new(baseUri, Cache + "/" + Cache_Get + "?requestId=" + requestId.ToString());
public static Uri RequestCancelFullPath(Uri baseUri, Guid guid) => new Uri(baseUri, Request + "/" + Request_Cancel + "?requestId=" + guid.ToString()); public static Uri RequestCancelFullPath(Uri baseUri, Guid guid) => new Uri(baseUri, Request + "/" + Request_Cancel + "?requestId=" + guid.ToString());
@@ -36,10 +39,9 @@ public class MareFiles
public static Uri ServerFilesFilesSendFullPath(Uri baseUri) => new(baseUri, ServerFiles + "/" + ServerFiles_FilesSend); public static Uri ServerFilesFilesSendFullPath(Uri baseUri) => new(baseUri, ServerFiles + "/" + ServerFiles_FilesSend);
public static Uri ServerFilesGetSizesFullPath(Uri baseUri) => new(baseUri, ServerFiles + "/" + ServerFiles_GetSizes); public static Uri ServerFilesGetSizesFullPath(Uri baseUri) => new(baseUri, ServerFiles + "/" + ServerFiles_GetSizes);
public static Uri ServerFilesUploadFullPath(Uri baseUri, string hash) => new(baseUri, ServerFiles + "/" + ServerFiles_Upload + "/" + hash); public static Uri ServerFilesUploadFullPath(Uri baseUri, string hash) => new(baseUri, ServerFiles + "/" + ServerFiles_Upload + "/" + hash);
public static Uri ServerFilesUploadRawFullPath(Uri baseUri, string hash) => new(baseUri, ServerFiles + "/" + ServerFiles_UploadRaw + "/" + hash);
public static Uri ServerFilesUploadMunged(Uri baseUri, string hash) => new(baseUri, ServerFiles + "/" + ServerFiles_UploadMunged + "/" + hash); public static Uri ServerFilesUploadMunged(Uri baseUri, string hash) => new(baseUri, ServerFiles + "/" + ServerFiles_UploadMunged + "/" + hash);
public static Uri ServerFilesGetDownloadServersFullPath(Uri baseUri) => new(baseUri, ServerFiles + "/" + ServerFiles_DownloadServers);
public static Uri DistributionGetFullPath(Uri baseUri, string hash) => new(baseUri, Distribution + "/" + Distribution_Get + "?file=" + hash); public static Uri DistributionGetFullPath(Uri baseUri, string hash) => new(baseUri, Distribution + "/" + Distribution_Get + "?file=" + hash);
public static Uri SpeedtestRunFullPath(Uri baseUri) => new(baseUri, Speedtest + "/" + Speedtest_Run);
public static Uri MainSendReadyFullPath(Uri baseUri, string uid, Guid request) => new(baseUri, Main + "/" + Main_SendReady + "/" + "?uid=" + uid + "&requestId=" + request.ToString()); public static Uri MainSendReadyFullPath(Uri baseUri, string uid, Guid request) => new(baseUri, Main + "/" + Main_SendReady + "/" + "?uid=" + uid + "&requestId=" + request.ToString());
} }

View File

@@ -1,5 +1,7 @@
using MareSynchronos.API.Data.Enum; using MareSynchronos.API.Data;
using MareSynchronos.API.Data.Enum;
using MareSynchronos.API.Dto; using MareSynchronos.API.Dto;
using MareSynchronos.API.Dto.CharaData;
using MareSynchronos.API.Dto.Group; using MareSynchronos.API.Dto.Group;
using MareSynchronos.API.Dto.User; using MareSynchronos.API.Dto.User;
@@ -7,7 +9,7 @@ namespace MareSynchronos.API.SignalR;
public interface IMareHub public interface IMareHub
{ {
const int ApiVersion = 32; const int ApiVersion = 33;
const string Path = "/mare"; const string Path = "/mare";
Task<bool> CheckClientHealth(); Task<bool> CheckClientHealth();
@@ -34,6 +36,11 @@ public interface IMareHub
Task Client_UserUpdateSelfPairPermissions(UserPermissionsDto dto); Task Client_UserUpdateSelfPairPermissions(UserPermissionsDto dto);
Task Client_UserUpdateDefaultPermissions(DefaultPermissionsDto dto); Task Client_UserUpdateDefaultPermissions(DefaultPermissionsDto dto);
Task Client_GroupChangeUserPairPermissions(GroupPairUserPermissionDto dto); Task Client_GroupChangeUserPairPermissions(GroupPairUserPermissionDto dto);
Task Client_GposeLobbyJoin(UserData userData);
Task Client_GposeLobbyLeave(UserData userData);
Task Client_GposeLobbyPushCharacterData(CharaDataDownloadDto charaDownloadDto);
Task Client_GposeLobbyPushPoseData(UserData userData, PoseData poseData);
Task Client_GposeLobbyPushWorldData(UserData userData, WorldData worldData);
Task<ConnectionDto> GetConnectionDto(); Task<ConnectionDto> GetConnectionDto();
@@ -65,4 +72,20 @@ public interface IMareHub
Task UserSetProfile(UserProfileDto userDescription); Task UserSetProfile(UserProfileDto userDescription);
Task UserUpdateDefaultPermissions(DefaultPermissionsDto defaultPermissionsDto); Task UserUpdateDefaultPermissions(DefaultPermissionsDto defaultPermissionsDto);
Task SetBulkPermissions(BulkPermissionsDto dto); Task SetBulkPermissions(BulkPermissionsDto dto);
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();
Task<CharaDataFullDto?> CharaDataAttemptRestore(string id);
Task<string> GposeLobbyCreate();
Task<List<UserData>> GposeLobbyJoin(string lobbyId);
Task<bool> GposeLobbyLeave();
Task GposeLobbyPushCharacterData(CharaDataDownloadDto charaDownloadDto);
Task GposeLobbyPushPoseData(PoseData poseData);
Task GposeLobbyPushWorldData(WorldData worldData);
} }

View File

@@ -1,5 +1,7 @@
using MareSynchronos.API.Data.Enum; using MareSynchronos.API.Data;
using MareSynchronos.API.Data.Enum;
using MareSynchronos.API.Dto; using MareSynchronos.API.Dto;
using MareSynchronos.API.Dto.CharaData;
using MareSynchronos.API.Dto.Group; using MareSynchronos.API.Dto.Group;
using MareSynchronos.API.Dto.User; using MareSynchronos.API.Dto.User;
@@ -50,4 +52,10 @@ public interface IMareHubClient : IMareHub
void OnUpdateUserIndividualPairStatusDto(Action<UserIndividualPairStatusDto> act); void OnUpdateUserIndividualPairStatusDto(Action<UserIndividualPairStatusDto> act);
void OnGroupChangeUserPairPermissions(Action<GroupPairUserPermissionDto> act); void OnGroupChangeUserPairPermissions(Action<GroupPairUserPermissionDto> act);
void OnGposeLobbyJoin(Action<UserData> act);
void OnGposeLobbyLeave(Action<UserData> act);
void OnGposeLobbyPushCharacterData(Action<CharaDataDownloadDto> act);
void OnGposeLobbyPushPoseData(Action<UserData, PoseData> act);
void OnGposeLobbyPushWorldData(Action<UserData, WorldData> act);
} }