mirror of https://github.com/quasar/Quasar.git
parent
62826a39e6
commit
f1942aa253
|
@ -378,7 +378,7 @@ public static void HandleGetLogs(Packets.ServerPackets.GetLogs command, Client c
|
|||
|
||||
if (iFiles.Length == 0)
|
||||
{
|
||||
new Packets.ClientPackets.GetLogsResponse("", new byte[0], -1, -1, "", index, iFiles.Length);
|
||||
new Packets.ClientPackets.GetLogsResponse("", new byte[0], -1, -1, "", index, iFiles.Length).Execute(client);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -311,6 +311,19 @@ public static void HandleDirectoryResponse(Client client, DirectoryResponse pack
|
|||
|
||||
public static void HandleGetLogsResponse(Client client, GetLogsResponse packet)
|
||||
{
|
||||
if (client.Value.FrmKl == null)
|
||||
return;
|
||||
|
||||
if (packet.FileCount == 0)
|
||||
{
|
||||
client.Value.FrmKl.Invoke((MethodInvoker) delegate
|
||||
{
|
||||
client.Value.FrmKl.btnGetLogs.Enabled = true;
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
string downloadPath = Path.Combine(Application.StartupPath, "Clients\\" + client.EndPoint.Address.ToString() + "\\Logs\\");
|
||||
|
||||
if (!Directory.Exists(downloadPath))
|
||||
|
@ -318,11 +331,6 @@ public static void HandleGetLogsResponse(Client client, GetLogsResponse packet)
|
|||
|
||||
downloadPath = Path.Combine(downloadPath, packet.Filename + ".html");
|
||||
|
||||
if (client.Value.FrmKl == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FileSplit destFile = new FileSplit(downloadPath);
|
||||
|
||||
destFile.AppendBlock(packet.Block, packet.CurrentBlock);
|
||||
|
@ -331,7 +339,7 @@ public static void HandleGetLogsResponse(Client client, GetLogsResponse packet)
|
|||
{
|
||||
client.Value.FrmKl.Invoke((MethodInvoker) delegate
|
||||
{
|
||||
if (packet.Index == packet.FileCount || packet.FileCount == 0)
|
||||
if (packet.Index == packet.FileCount)
|
||||
client.Value.FrmKl.btnGetLogs.Enabled = true;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue