From a1d113528e575a828350917d5ac0c53851d4aca5 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 13 Nov 2022 15:27:58 -0600 Subject: rename Network to Relay --- src/slskd/Relay/Types/Agent.cs | 25 +++++++++++++++++++++ src/slskd/Relay/Types/OperationMode.cs | 40 ++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 src/slskd/Relay/Types/Agent.cs create mode 100644 src/slskd/Relay/Types/OperationMode.cs (limited to 'src/slskd/Relay/Types') diff --git a/src/slskd/Relay/Types/Agent.cs b/src/slskd/Relay/Types/Agent.cs new file mode 100644 index 00000000..3ed1767e --- /dev/null +++ b/src/slskd/Relay/Types/Agent.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Relay +{ + public record Agent + { + public string Name { get; init; } + public string IPAddress { get; init; } + } +} diff --git a/src/slskd/Relay/Types/OperationMode.cs b/src/slskd/Relay/Types/OperationMode.cs new file mode 100644 index 00000000..4881e4e7 --- /dev/null +++ b/src/slskd/Relay/Types/OperationMode.cs @@ -0,0 +1,40 @@ +// +// Copyright (c) slskd Team. All rights reserved. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see https://www.gnu.org/licenses/. +// + +namespace slskd.Relay +{ + /// + /// The network operation mode. + /// + public enum OperationMode + { + /// + /// Controller operation mode. + /// + Controller = 0, + + /// + /// Agent operation mode. + /// + Agent = 1, + + /// + /// Debug mode; enables operation as both a controller and agent. + /// + Debug = 2, + } +} -- cgit v1.2.3 From 27626ff743a5d2b5bd3c5db61e7d945fc0f55c75 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 13 Nov 2022 15:50:05 -0600 Subject: more Network -> Relay renaming --- src/slskd/Relay/API/Hubs/RelayHub.cs | 2 +- src/slskd/Relay/DummyRelayClient.cs | 6 +++--- src/slskd/Relay/Types/OperationMode.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/slskd/Relay/Types') diff --git a/src/slskd/Relay/API/Hubs/RelayHub.cs b/src/slskd/Relay/API/Hubs/RelayHub.cs index ac3bc78a..ab14e064 100644 --- a/src/slskd/Relay/API/Hubs/RelayHub.cs +++ b/src/slskd/Relay/API/Hubs/RelayHub.cs @@ -142,7 +142,7 @@ namespace slskd.Relay } /// - /// Notifies the controller that the agent was unable to upload the file requested by a call to . + /// Notifies the controller that the agent was unable to upload the file requested by a call to . /// /// The unique identifier of the request. /// The Exception that caused the failure. diff --git a/src/slskd/Relay/DummyRelayClient.cs b/src/slskd/Relay/DummyRelayClient.cs index 67140281..dca4f808 100644 --- a/src/slskd/Relay/DummyRelayClient.cs +++ b/src/slskd/Relay/DummyRelayClient.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) slskd Team. All rights reserved. // // This program is free software: you can redistribute it and/or modify @@ -20,9 +20,9 @@ namespace slskd.Relay using System.Threading; using System.Threading.Tasks; - public class DummyRelayClient : INetworkClient + public class DummyRelayClient : IRelayClient { - public IStateMonitor StateMonitor => new ManagedState(); + public IStateMonitor StateMonitor => new ManagedState(); public void Dispose() { } diff --git a/src/slskd/Relay/Types/OperationMode.cs b/src/slskd/Relay/Types/OperationMode.cs index 4881e4e7..c572f0da 100644 --- a/src/slskd/Relay/Types/OperationMode.cs +++ b/src/slskd/Relay/Types/OperationMode.cs @@ -18,7 +18,7 @@ namespace slskd.Relay { /// - /// The network operation mode. + /// The relay operation mode. /// public enum OperationMode { -- cgit v1.2.3