DownloadManager bug fixed
This commit is contained in:
@ -437,7 +437,7 @@ namespace CoopClient
|
|||||||
return Game.IsControlPressed((Control)control);
|
return Game.IsControlPressed((Control)control);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsMapLoaded()
|
public bool AnyMapLoaded()
|
||||||
{
|
{
|
||||||
return MapLoader.AnyMapLoaded();
|
return MapLoader.AnyMapLoaded();
|
||||||
}
|
}
|
||||||
|
@ -146,9 +146,10 @@ namespace CoopServer
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.IsCurrentFile(id))
|
if (!client.DownloadComplete() && client.IsCurrentFile(id))
|
||||||
{
|
{
|
||||||
client.FilePosition++;
|
client.FilePosition++;
|
||||||
|
client.FileDataPosition = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.DownloadComplete())
|
if (client.DownloadComplete())
|
||||||
@ -175,7 +176,7 @@ namespace CoopServer
|
|||||||
public long NetHandle = 0;
|
public long NetHandle = 0;
|
||||||
private readonly List<DownloadFile> _files = null;
|
private readonly List<DownloadFile> _files = null;
|
||||||
public int FilePosition = 0;
|
public int FilePosition = 0;
|
||||||
private int _fileDataPosition = 0;
|
public int FileDataPosition = 0;
|
||||||
|
|
||||||
public DownloadClient(long nethandle, List<DownloadFile> files)
|
public DownloadClient(long nethandle, List<DownloadFile> files)
|
||||||
{
|
{
|
||||||
@ -233,10 +234,10 @@ namespace CoopServer
|
|||||||
|
|
||||||
Send(NetHandle, file);
|
Send(NetHandle, file);
|
||||||
|
|
||||||
if (_fileDataPosition >= file.FileChunks.Count)
|
if (FileDataPosition >= file.FileChunks.Count)
|
||||||
{
|
{
|
||||||
FilePosition++;
|
FilePosition++;
|
||||||
_fileDataPosition = 0;
|
FileDataPosition = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DownloadComplete();
|
return DownloadComplete();
|
||||||
@ -253,7 +254,7 @@ namespace CoopServer
|
|||||||
|
|
||||||
NetOutgoingMessage outgoingMessage = Server.MainNetServer.CreateMessage();
|
NetOutgoingMessage outgoingMessage = Server.MainNetServer.CreateMessage();
|
||||||
|
|
||||||
new Packets.FileTransferTick() { ID = file.FileID, FileChunk = file.FileChunks[_fileDataPosition++] }.PacketToNetOutGoingMessage(outgoingMessage);
|
new Packets.FileTransferTick() { ID = file.FileID, FileChunk = file.FileChunks[FileDataPosition++] }.PacketToNetOutGoingMessage(outgoingMessage);
|
||||||
|
|
||||||
Server.MainNetServer.SendMessage(outgoingMessage, conn, NetDeliveryMethod.ReliableUnordered, (byte)ConnectionChannel.File);
|
Server.MainNetServer.SendMessage(outgoingMessage, conn, NetDeliveryMethod.ReliableUnordered, (byte)ConnectionChannel.File);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user