diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Application.cs | 5 | ||||
| -rw-r--r-- | src/slskd/Core/State.cs | 24 |
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; } |
