Content packages & MD5 hash comparison between client and server

This commit is contained in:
Regalis
2015-07-20 21:27:44 +03:00
parent 4aa3d9d7ee
commit 326b46cf18
45 changed files with 1217 additions and 158 deletions
+26 -1
View File
@@ -25,6 +25,12 @@ namespace Subsurface
set;
}
public ContentPackage SelectedContentPackage
{
get;
set;
}
public GameSettings(string filePath)
{
Load(filePath);
@@ -45,7 +51,19 @@ namespace Subsurface
{
GraphicsWidth = 1024;
GraphicsHeight = 768;
return;
}
foreach (XElement subElement in doc.Root.Elements())
{
switch (subElement.Name.ToString().ToLower())
{
case "contentpackage":
string path = ToolBox.GetAttributeString(subElement, "path", "");
SelectedContentPackage = ContentPackage.list.Find(cp => cp.Path == path);
if (SelectedContentPackage == null) SelectedContentPackage = new ContentPackage(path);
break;
}
}
}
@@ -79,6 +97,13 @@ namespace Subsurface
new XAttribute("height", GraphicsHeight),
new XAttribute("fullscreen", FullScreenEnabled ? "true" : "false"));
if (SelectedContentPackage != null)
{
doc.Root.Add(new XElement("contentpackage",
new XAttribute("path", SelectedContentPackage.Path)));
}
doc.Save(filePath);
}
}