Having multiple sub files with the same name doesn't prevent clients from selecting or requesting the correct one

This commit is contained in:
Regalis
2017-03-28 21:01:44 +03:00
parent 2a5a2bc6f6
commit 5bdd801da4
4 changed files with 33 additions and 20 deletions

View File

@@ -271,7 +271,8 @@ namespace Barotrauma.Networking
{
case (byte)FileTransferType.Submarine:
string fileName = inc.ReadString();
var requestedSubmarine = Submarine.SavedSubmarines.Find(s => s.Name == fileName);
string fileHash = inc.ReadString();
var requestedSubmarine = Submarine.SavedSubmarines.Find(s => s.Name == fileName && s.MD5Hash.Hash == fileHash);
if (requestedSubmarine != null)
{