v0.14.9.1
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.Networking;
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.Xml.Linq;
|
||||
using System.IO;
|
||||
using Barotrauma.IO;
|
||||
using Barotrauma.Items.Components;
|
||||
|
||||
namespace Barotrauma
|
||||
|
||||
@@ -494,7 +494,26 @@ namespace Barotrauma.Networking
|
||||
stream?.Close();
|
||||
break;
|
||||
case FileTransferType.CampaignSave:
|
||||
//TODO: verify that the received file is a valid save file
|
||||
try
|
||||
{
|
||||
var files = SaveUtil.EnumerateContainedFiles(fileTransfer.FilePath);
|
||||
foreach (var file in files)
|
||||
{
|
||||
string extension = Path.GetExtension(file);
|
||||
if ((!extension.Equals(".sub", StringComparison.OrdinalIgnoreCase)
|
||||
&& !file.Equals("gamesession.xml"))
|
||||
|| file.CleanUpPathCrossPlatform(correctFilenameCase: false).Contains('/'))
|
||||
{
|
||||
ErrorMessage = $"Found unexpected file in \"{fileTransfer.FileName}\"! ({file})";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ErrorMessage = $"Loading received campaign save \"{fileTransfer.FileName}\" failed! {{{e.Message}}}";
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Barotrauma.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
Reference in New Issue
Block a user