mirror of
https://github.com/Stone-Red-Code/HyperbolicDownloader.git
synced 2026-09-09 15:56:25 +02:00
Add more debug logs
This commit is contained in:
@@ -113,19 +113,27 @@ internal class NetworkClient(FilesManager filesManager)
|
|||||||
|
|
||||||
if (dataReceived.StartsWith("Download"))
|
if (dataReceived.StartsWith("Download"))
|
||||||
{
|
{
|
||||||
|
ApiManager.SendNotificationMessageNewLine($"{(client.Client.RemoteEndPoint as IPEndPoint)?.Address} > Download request", NotificationMessageType.Debug);
|
||||||
_ = Upload(client, dataReceived[8..]);
|
_ = Upload(client, dataReceived[8..]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (string.IsNullOrWhiteSpace(dataReceived))
|
if (string.IsNullOrWhiteSpace(dataReceived))
|
||||||
{
|
{
|
||||||
|
ApiManager.SendNotificationMessageNewLine($"{(client.Client.RemoteEndPoint as IPEndPoint)?.Address} > Disconnected", NotificationMessageType.Debug);
|
||||||
client.Close();
|
client.Close();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApiManager.SendNotificationMessageNewLine($"{(client.Client.RemoteEndPoint as IPEndPoint)?.Address} > Deserializing data", NotificationMessageType.Debug);
|
||||||
|
|
||||||
DataContainer? dataContainer = JsonSerializer.Deserialize<DataContainer>(dataReceived);
|
DataContainer? dataContainer = JsonSerializer.Deserialize<DataContainer>(dataReceived);
|
||||||
|
|
||||||
|
ApiManager.SendNotificationMessageNewLine($"{(client.Client.RemoteEndPoint as IPEndPoint)?.Address} > Data deserialized", NotificationMessageType.Debug);
|
||||||
|
|
||||||
if (dataContainer is not null && events.TryGetValue(dataContainer.EventName, out (Type type, Delegate method) value))
|
if (dataContainer is not null && events.TryGetValue(dataContainer.EventName, out (Type type, Delegate method) value))
|
||||||
{
|
{
|
||||||
|
ApiManager.SendNotificationMessageNewLine($"{(client.Client.RemoteEndPoint as IPEndPoint)?.Address} > Found event", NotificationMessageType.Debug);
|
||||||
|
|
||||||
(Type type, Delegate method) = value;
|
(Type type, Delegate method) = value;
|
||||||
|
|
||||||
Type eventArgsType = typeof(MessageRecivedEventArgs<>).MakeGenericType(type);
|
Type eventArgsType = typeof(MessageRecivedEventArgs<>).MakeGenericType(type);
|
||||||
@@ -138,6 +146,12 @@ internal class NetworkClient(FilesManager filesManager)
|
|||||||
|
|
||||||
_ = (method?.DynamicInvoke(this, eventArgs));
|
_ = (method?.DynamicInvoke(this, eventArgs));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ApiManager.SendNotificationMessageNewLine($"{(client.Client.RemoteEndPoint as IPEndPoint)?.Address} > Event not found", NotificationMessageType.Debug);
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiManager.SendNotificationMessageNewLine($"{(client.Client.RemoteEndPoint as IPEndPoint)?.Address} > Closing connection", NotificationMessageType.Debug);
|
||||||
|
|
||||||
client.Close();
|
client.Close();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user