adjust DTOs, add call to push character data to visible clients

This commit is contained in:
Stanley Dimant
2022-06-30 17:19:58 +02:00
parent 3e00bc4efd
commit d56923d553
13 changed files with 82 additions and 72 deletions

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MareSynchronos.API
namespace MareSynchronos.API
{
public class BannedUserDto
public record BannedUserDto
{
public string CharacterHash { get; set; }
public string Reason { get; set; }

View File

@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace MareSynchronos.API
{
public class CharacterCacheDto
public record CharacterCacheDto
{
public List<FileReplacementDto> FileReplacements { get; set; } = new();
public string GlamourerData { get; set; }
@@ -15,10 +10,4 @@ namespace MareSynchronos.API
public string Hash { get; set; }
public int JobId { get; set; }
}
public class FileReplacementDto
{
public string[] GamePaths { get; set; } = Array.Empty<string>();
public string Hash { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace MareSynchronos.API
{
public class ClientPairDto
public record ClientPairDto
{
public string OtherUID { get; set; }
public bool IsPaused { get; set; }

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MareSynchronos.API
namespace MareSynchronos.API
{
public class DownloadFileDto
public record DownloadFileDto : ITransferFileDto
{
public bool FileExists { get; set; } = true;
public string Hash { get; set; } = string.Empty;

View File

@@ -0,0 +1,10 @@
using System;
namespace MareSynchronos.API
{
public record FileReplacementDto
{
public string[] GamePaths { get; set; } = Array.Empty<string>();
public string Hash { get; set; }
}
}

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MareSynchronos.API
namespace MareSynchronos.API
{
public class ForbiddenFileDto
public record ForbiddenFileDto
{
public string Hash { get; set; }
public string ForbiddenBy { get; set; }

View File

@@ -0,0 +1,9 @@
namespace MareSynchronos.API
{
public interface ITransferFileDto
{
string Hash { get; set; }
bool IsForbidden { get; set; }
string ForbiddenBy { get; set; }
}
}

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MareSynchronos.API
namespace MareSynchronos.API
{
public class LoggedInUserDto
public record LoggedInUserDto
{
public bool IsAdmin { get; set; }
public bool IsModerator { get; set; }

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MareSynchronos.API
namespace MareSynchronos.API
{
public class OnlineUserDto
public record OnlineUserDto
{
public string UID { get; set; }
public string CharacterNameHash { get; set; }

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MareSynchronos.API
namespace MareSynchronos.API
{
public class UploadFileDto
public record UploadFileDto : ITransferFileDto
{
public string Hash { get; set; } = string.Empty;
public bool IsForbidden { get; set; } = false;