Luski.Net/Luski.net/Structures/Public/ServerProfile.cs

30 lines
1.2 KiB
C#
Raw Normal View History

2024-03-20 23:18:34 -04:00
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Luski.net.Enums;
using Luski.Shared.PublicServers.V1.Enums;
namespace Luski.net.Structures.Public;
2024-08-27 10:57:22 -04:00
public class ServerProfile
2024-03-20 23:18:34 -04:00
{
public PublicServer Server { get; init; } = default!;
2024-08-27 10:57:22 -04:00
public long ID { get; init; } = default!;
2024-03-20 23:18:34 -04:00
public string DisplayName { get; init; } = default!;
2024-08-27 10:57:22 -04:00
public PictureType? PictureType { get; init; } = default!;
2024-03-20 23:18:34 -04:00
public long[] Controllers { get; internal set; } = default!;
2024-08-27 10:57:22 -04:00
public long[] RoleControllers { get; internal set; } = default!;
2024-03-20 23:18:34 -04:00
public async Task<Stream> GetAvatar(CancellationToken CancellationToken)
{
2024-08-27 10:57:22 -04:00
bool isc = System.IO.File.Exists(Server.Storage.GetStorageDirectory(StorageDirectory.ProfileAvatars) + ID.ToString());
if (!isc) await Server.GetFromServer($"socketprofile/Avatar/{ID}", Server.Storage.GetStorageDirectory(StorageDirectory.ProfileAvatars) + ID.ToString(), CancellationToken);
return Server.Storage.GetResourceStream(StorageDirectory.ProfileAvatars, ID.ToString());
2024-03-20 23:18:34 -04:00
}
public Task<PublicKeyInfo[]> GetUserKeys(CancellationToken CancellationToken)
{
throw new NotImplementedException();
}
}