Bug fixes and revised DownloadManager for client

This commit is contained in:
EntenKoeniq
2022-04-06 05:10:29 +02:00
parent 2fd3ef32fb
commit a6d2acac79
3 changed files with 146 additions and 46 deletions

View File

@ -107,6 +107,8 @@ namespace CoopServer
}
}
});
Logging.Debug($"Clients [{_clients.Count}]");
}
public static void RemoveClient(long nethandle)
@ -178,6 +180,24 @@ namespace CoopServer
});
}
~DownloadClient()
{
NetConnection conn = Server.MainNetServer.Connections.FirstOrDefault(x => x.RemoteUniqueIdentifier == NetHandle);
if (conn == null)
{
return;
}
NetOutgoingMessage outgoingMessage = Server.MainNetServer.CreateMessage();
new Packets.FileTransferComplete()
{
ID = 0x0
}.PacketToNetOutGoingMessage(outgoingMessage);
Server.MainNetServer.SendMessage(outgoingMessage, conn, NetDeliveryMethod.ReliableOrdered, (byte)ConnectionChannel.File);
}
/// <summary>
///
/// </summary>