- clients see the submarines that the host has instead of their own subs in server lobby

- possible to vote for subs the client doesn't have
- fixed the "votes required" slider moving when re-opening the server settings
- WIP method for sending missing subs to clients before the round starts (atm the clients won't have time to request a sub file that was chosen by voting)
This commit is contained in:
Regalis
2016-05-22 01:39:10 +03:00
parent c2f1a1a383
commit e6b073f872
10 changed files with 202 additions and 74 deletions
+12 -7
View File
@@ -187,7 +187,7 @@ namespace Barotrauma
//constructors & generation ----------------------------------------------------
public Submarine(string filePath, string hash = "") : base(null)
public Submarine(string filePath, string hash = "", bool tryLoad = true) : base(null)
{
this.filePath = filePath;
try
@@ -196,7 +196,7 @@ namespace Barotrauma
}
catch (Exception e)
{
DebugConsole.ThrowError("Error loading map " + filePath + "!", e);
DebugConsole.ThrowError("Error loading submarine " + filePath + "!", e);
}
if (hash != "")
@@ -204,17 +204,22 @@ namespace Barotrauma
this.hash = new Md5Hash(hash);
}
XDocument doc = OpenDoc(filePath);
if (doc != null && doc.Root != null)
if (tryLoad)
{
Description = ToolBox.GetAttributeString(doc.Root, "description", "");
XDocument doc = OpenDoc(filePath);
if (doc != null && doc.Root != null)
{
Description = ToolBox.GetAttributeString(doc.Root, "description", "");
}
}
ID = ushort.MaxValue;
base.Remove();
}
//drawing ----------------------------------------------------
public static void Draw(SpriteBatch spriteBatch, bool editing = false)
@@ -607,7 +612,7 @@ namespace Barotrauma
SavedSubmarines.Add(new Submarine(path));
}
if (GameMain.NetLobbyScreen!=null) GameMain.NetLobbyScreen.UpdateSubList();
//if (GameMain.NetLobbyScreen!=null) GameMain.NetLobbyScreen.UpdateSubList(Submarine.SavedSubmarines);
}
private XDocument OpenDoc(string file)