aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-03-14 08:02:30 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-03-14 08:02:30 -0500
commit5d802f45166fea9f4986d46428ec21bf27474721 (patch)
tree03cc735eef552a04c3102ff233fad5f50816141b /src
parented55302b09e51f48fc1064d5d8e5c2178b388954 (diff)
downloadslskd-5d802f45166fea9f4986d46428ec21bf27474721.tar.gz
add DistributedNetworkState
Diffstat (limited to 'src')
-rw-r--r--src/slskd/State.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/slskd/State.cs b/src/slskd/State.cs
index bd82f8d7..71807728 100644
--- a/src/slskd/State.cs
+++ b/src/slskd/State.cs
@@ -18,6 +18,7 @@
namespace slskd
{
using System;
+ using System.Collections.Generic;
using System.Net;
using System.Text.Json.Serialization;
using slskd.Users;
@@ -33,6 +34,7 @@ namespace slskd
public bool PendingRestart { get; init; }
public bool PendingShareRescan { get; init; }
public ServerState Server { get; init; } = new ServerState();
+ public DistributedNetworkState DistributedNetwork { get; init; } = new DistributedNetworkState();
public SharedFileCacheState SharedFileCache { get; init; } = new SharedFileCacheState();
public string[] Rooms { get; init; } = Array.Empty<string>();
public User[] Users { get; init; } = Array.Empty<User>();
@@ -61,6 +63,18 @@ namespace slskd
public bool IsTransitioning => State.HasFlag(SoulseekClientStates.Connecting) || State.HasFlag(SoulseekClientStates.Disconnecting) || State.HasFlag(SoulseekClientStates.LoggingIn);
}
+ public record DistributedNetworkState
+ {
+ public int BranchLevel { get; init; }
+ public string BranchRoot { get; init; }
+ public bool CanAcceptChildren { get; init; }
+ public int ChildLimit { get; init; }
+ public IReadOnlyCollection<(string Username, IPEndPoint IPEndPoint)> Children { get; init; }
+ public bool HasParent { get; init; }
+ public bool IsBranchRoot { get; init; }
+ public (string Username, IPEndPoint IPEndPoint) Parent { get; init; }
+ }
+
/// <summary>
/// Share cache state.
/// </summary>