Clean up some debug statements

This commit is contained in:
Brandon Smith
2015-08-24 18:55:02 -03:00
parent 649e1bbe7c
commit 2df72bbb8f
2 changed files with 11 additions and 8 deletions

View File

@@ -247,7 +247,7 @@ namespace Discord
#if !DNXCORE50 #if !DNXCORE50
private void ProcessUdpMessage(UdpReceiveResult msg) private void ProcessUdpMessage(UdpReceiveResult msg)
{ {
if (msg.Buffer.Length > 0 && msg.RemoteEndPoint.Equals(_endpoint)) if (msg.Buffer.Length > 0 && msg.RemoteEndPoint.Equals(_endpoint))
{ {
byte[] buffer = msg.Buffer; byte[] buffer = msg.Buffer;
int length = msg.Buffer.Length; int length = msg.Buffer.Length;

View File

@@ -129,9 +129,10 @@ namespace Discord
} }
while (!result.EndOfMessage); while (!result.EndOfMessage);
//TODO: Remove this #if DEBUG
System.Diagnostics.Debug.WriteLine(">>> " + builder.ToString()); System.Diagnostics.Debug.WriteLine(">>> " + builder.ToString());
#endif
await ProcessMessage(builder.ToString()); await ProcessMessage(builder.ToString());
builder.Clear(); builder.Clear();
@@ -171,15 +172,17 @@ namespace Discord
protected void QueueMessage(object message) protected void QueueMessage(object message)
{ {
//TODO: Remove this #if DEBUG
System.Diagnostics.Debug.WriteLine("<<< " + JsonConvert.SerializeObject(message)); System.Diagnostics.Debug.WriteLine("<<< " + JsonConvert.SerializeObject(message));
var bytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message)); #endif
var bytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message));
_sendQueue.Enqueue(bytes); _sendQueue.Enqueue(bytes);
} }
protected Task SendMessage(object message, CancellationToken cancelToken) protected Task SendMessage(object message, CancellationToken cancelToken)
{ {
//TODO: Remove this #if DEBUG
System.Diagnostics.Debug.WriteLine("<<< " + JsonConvert.SerializeObject(message)); System.Diagnostics.Debug.WriteLine("<<< " + JsonConvert.SerializeObject(message));
#endif
return SendMessage(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message)), cancelToken); return SendMessage(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message)), cancelToken);
} }
protected async Task SendMessage(byte[] message, CancellationToken cancelToken) protected async Task SendMessage(byte[] message, CancellationToken cancelToken)
@@ -201,7 +204,7 @@ namespace Discord
} }
} }
#region IDisposable Support #region IDisposable Support
private bool _isDisposed = false; private bool _isDisposed = false;
public void Dispose() public void Dispose()
@@ -212,6 +215,6 @@ namespace Discord
_isDisposed = true; _isDisposed = true;
} }
} }
#endregion #endregion
} }
} }