diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-01-08 13:30:10 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-08 13:30:10 -0600 |
| commit | bbbde98f571dc7cd7a0ed35ef7846cc177372920 (patch) | |
| tree | d711d033bf604444519f98d9854b67d412efcacf /src/slskd/Application.cs | |
| parent | 9bb9c17312742adb65b37fe84bd64e7267defcd8 (diff) | |
| parent | 5133ac9eabc1ddf195002807f97a95ad0ab8d9a0 (diff) | |
| download | slskd-bbbde98f571dc7cd7a0ed35ef7846cc177372920.tar.gz | |
Merge branch 'master' into relay-docs
Diffstat (limited to 'src/slskd/Application.cs')
| -rw-r--r-- | src/slskd/Application.cs | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 30fee1be..48406931 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -400,32 +400,36 @@ namespace slskd } } - if (OptionsAtStartup.Flags.NoConnect) - { - Log.Warning("Not connecting to the Soulseek server; 'no-connect' option is enabled"); - } - else if (string.IsNullOrEmpty(OptionsAtStartup.Soulseek.Username) || string.IsNullOrEmpty(OptionsAtStartup.Soulseek.Password)) - { - Log.Warning($"Not connecting to the Soulseek server; username and/or password invalid. Specify valid credentials and manually connect, or update config and restart."); - } - else if (OptionsAtStartup.Relay.Enabled && OptionsAtStartup.Relay.Mode.ToEnum<RelayMode>() == RelayMode.Agent) + if (OptionsAtStartup.Relay.Enabled && OptionsAtStartup.Relay.Mode.ToEnum<RelayMode>() == RelayMode.Agent) { Log.Information("Running in Agent relay mode; not connecting to the Soulseek server."); await Relay.Client.StartAsync(cancellationToken); } else { - if (OptionsAtStartup.Relay.Enabled && OptionsAtStartup.Relay.Mode.ToEnum<RelayMode>() == RelayMode.Debug) + if (OptionsAtStartup.Relay.Enabled) { - Log.Warning("Running in Debug relay mode; connecting to controller"); - _ = Relay.Client.StartAsync(cancellationToken); + Log.Information("Running in Controller relay mode. Listening for incoming Agent connections."); + + if (OptionsAtStartup.Relay.Mode.ToEnum<RelayMode>() == RelayMode.Debug) + { + Log.Warning("Running in Debug relay mode; connecting to controller"); + _ = Relay.Client.StartAsync(cancellationToken); + } + } + + if (OptionsAtStartup.Flags.NoConnect) + { + Log.Warning("Not connecting to the Soulseek server; 'no-connect' option is enabled"); + } + else if (string.IsNullOrEmpty(OptionsAtStartup.Soulseek.Username) || string.IsNullOrEmpty(OptionsAtStartup.Soulseek.Password)) + { + Log.Warning($"Not connecting to the Soulseek server; username and/or password invalid. Specify valid credentials and manually connect, or update config and restart."); } else { - Log.Information("Running in Controller relay mode. Listening for incoming Agent connections."); + await Client.ConnectAsync(OptionsAtStartup.Soulseek.Username, OptionsAtStartup.Soulseek.Password).ConfigureAwait(false); } - - await Client.ConnectAsync(OptionsAtStartup.Soulseek.Username, OptionsAtStartup.Soulseek.Password).ConfigureAwait(false); } } @@ -749,6 +753,7 @@ namespace slskd private void Client_UserStatusChanged(object sender, UserStatus args) { + // todo: react to watched user status changes } private Task<int?> PlaceInQueueResolver(string username, IPEndPoint endpoint, string filename) |
