aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-01-01 14:46:00 -0600
committerJP Dillingham <jp@dillingham.me>2024-01-01 14:46:00 -0600
commitaa5d96cae4e38f7617a38b15f234d671d8fd4ba6 (patch)
tree306feeb065fa511cd101e2d5b075b401906abc15 /src
parent0a54bc4d58c2400bc9cad1ec227c9b951a6b6bd3 (diff)
downloadslskd-aa5d96cae4e38f7617a38b15f234d671d8fd4ba6.tar.gz
on second thought, don't remove users from state
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs5
-rw-r--r--src/slskd/Core/State.cs24
2 files changed, 29 insertions, 0 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 59aa1d40..d0e34880 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -74,6 +74,11 @@ namespace slskd
/// </summary>
public static readonly string LeecherGroup = "leechers";
+ /// <summary>
+ /// The name of the blacklisted user group.
+ /// </summary>
+ public static readonly string BlacklistedGroup = "blacklisted";
+
private static readonly string ApplicationShutdownTransferExceptionMessage = "Application shut down";
public Application(
diff --git a/src/slskd/Core/State.cs b/src/slskd/Core/State.cs
index 3a0c8c11..9ae6df6b 100644
--- a/src/slskd/Core/State.cs
+++ b/src/slskd/Core/State.cs
@@ -23,6 +23,7 @@ namespace slskd
using System.Net;
using System.Text.Json.Serialization;
using slskd.Relay;
+ using slskd.Users;
using Soulseek;
/// <summary>
@@ -35,9 +36,11 @@ namespace slskd
public bool PendingRestart { get; init; }
public ServerState Server { get; init; } = new ServerState();
public RelayState Relay { get; init; } = new RelayState();
+ public UserState User { get; init; } = new UserState();
public DistributedNetworkState DistributedNetwork { get; init; } = new DistributedNetworkState();
public ShareState Shares { get; init; } = new ShareState();
public string[] Rooms { get; init; } = Array.Empty<string>();
+ public User[] Users { get; init; } = Array.Empty<User>();
}
public record VersionState
@@ -75,6 +78,27 @@ namespace slskd
public RelayClientState State { get; init; } = RelayClientState.Disconnected;
}
+ public record UserState
+ {
+ public string Username { get; init; }
+ public UserPrivilegeState Privileges { get; init; } = new UserPrivilegeState();
+ public UserStatisticsState Statistics { get; init; } = new UserStatisticsState();
+ }
+
+ public record UserPrivilegeState
+ {
+ public bool IsPrivileged { get; init; }
+ public int PrivilegesRemaining { get; init; }
+ }
+
+ public record UserStatisticsState
+ {
+ public int AverageSpeed { get; init; }
+ public int DirectoryCount { get; init; }
+ public int FileCount { get; init; }
+ public long UploadCount { get; init; }
+ }
+
public record DistributedNetworkState
{
public int BranchLevel { get; init; }