Moved (re)connection handling to ConnectionManager

This commit is contained in:
RogueException
2017-02-23 16:38:57 -04:00
parent 8630185ac9
commit 3190d7e26d
15 changed files with 447 additions and 588 deletions

View File

@@ -14,7 +14,7 @@ namespace Discord.Audio
/// <summary> Gets the estimated round-trip latency, in milliseconds, to the gateway server. </summary>
int Latency { get; }
Task DisconnectAsync();
Task StopAsync();
/// <summary>
/// Creates a new outgoing stream accepting Opus-encoded data.

View File

@@ -10,8 +10,8 @@ namespace Discord
ConnectionState ConnectionState { get; }
ISelfUser CurrentUser { get; }
Task ConnectAsync();
Task DisconnectAsync();
Task StartAsync();
Task StopAsync();
Task<IApplication> GetApplicationInfoAsync();

View File

@@ -19,7 +19,7 @@ namespace Discord
}
public override string ToString() => ToString(null);
public string ToString(StringBuilder builder = null, bool fullException = true, bool prependTimestamp = true, DateTimeKind timestampKind = DateTimeKind.Local, int? padSource = 9)
public string ToString(StringBuilder builder = null, bool fullException = true, bool prependTimestamp = true, DateTimeKind timestampKind = DateTimeKind.Local, int? padSource = 11)
{
string sourceName = Source;
string message = Message;
@@ -87,8 +87,11 @@ namespace Discord
}
if (exMessage != null)
{
builder.Append(':');
builder.AppendLine();
if (!string.IsNullOrEmpty(Message))
{
builder.Append(':');
builder.AppendLine();
}
builder.Append(exMessage);
}