Content packages & MD5 hash comparison between client and server
This commit is contained in:
@@ -400,6 +400,27 @@ namespace Subsurface
|
||||
CharacterList.Add(this);
|
||||
}
|
||||
|
||||
private static string humanConfigFile;
|
||||
public static string HumanConfigFile
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrEmpty(humanConfigFile))
|
||||
{
|
||||
var characterFiles = Game1.SelectedPackage.GetFilesOfType(ContentType.Character);
|
||||
|
||||
humanConfigFile = characterFiles.Find(c => c.EndsWith("human.xml"));
|
||||
if (humanConfigFile == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Couldn't find a config file for humans from the selected content package!");
|
||||
DebugConsole.ThrowError("(The config file must end with ''human.xml'')");
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return humanConfigFile;
|
||||
}
|
||||
}
|
||||
|
||||
public void GiveJobItems(WayPoint spawnPoint)
|
||||
{
|
||||
if (Info == null || Info.Job == null) return;
|
||||
|
||||
@@ -104,17 +104,20 @@ namespace Subsurface
|
||||
}
|
||||
|
||||
|
||||
public static void LoadAll(string filePath)
|
||||
public static void LoadAll(List<string> filePaths)
|
||||
{
|
||||
List = new List<JobPrefab>();
|
||||
|
||||
XDocument doc = ToolBox.TryLoadXml(filePath);
|
||||
if (doc == null) return;
|
||||
|
||||
foreach (XElement element in doc.Root.Elements())
|
||||
foreach (string filePath in filePaths)
|
||||
{
|
||||
JobPrefab job = new JobPrefab(element);
|
||||
List.Add(job);
|
||||
XDocument doc = ToolBox.TryLoadXml(filePath);
|
||||
if (doc == null) return;
|
||||
|
||||
foreach (XElement element in doc.Root.Elements())
|
||||
{
|
||||
JobPrefab job = new JobPrefab(element);
|
||||
List.Add(job);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user