(62b9ca04f) Removed Berilia from the build

This commit is contained in:
Joonas Rikkonen
2019-06-15 20:00:44 +03:00
parent 1130eef310
commit 157f6cfd21
49 changed files with 290 additions and 475 deletions
@@ -2047,15 +2047,13 @@ namespace Barotrauma.Networking
client.SendMessage(msg, NetDeliveryMethod.ReliableUnordered);
}
public void SetupNewCampaign(Submarine sub, string saveName, string mapSeed)
public void SetupNewCampaign(Submarine sub, string savePath, string mapSeed)
{
saveName = Path.GetFileNameWithoutExtension(saveName);
NetOutgoingMessage msg = client.CreateMessage();
msg.Write((byte)ClientPacketHeader.CAMPAIGN_SETUP_INFO);
msg.Write(true); msg.WritePadBits();
msg.Write(saveName);
msg.Write(savePath);
msg.Write(mapSeed);
msg.Write(sub.Name);
msg.Write(sub.MD5Hash.Hash);
@@ -590,19 +590,12 @@ namespace Barotrauma.Steam
}
else
{
DebugConsole.NewMessage("Publishing workshop item " + item.Title + " failed. " + item.Error, Microsoft.Xna.Framework.Color.Red);
DebugConsole.ThrowError("Publishing workshop item " + item.Title + " failed. " + item.Error);
}
SaveUtil.ClearFolder(WorkshopItemStagingFolder);
Directory.Delete(WorkshopItemStagingFolder);
File.Delete(PreviewImageName);
try
{
Directory.Delete(WorkshopItemStagingFolder);
}
catch (Exception e)
{
DebugConsole.ThrowError("Failed to delete Workshop item staging folder.", e);
}
yield return CoroutineStatus.Success;
}
@@ -934,50 +927,28 @@ namespace Barotrauma.Steam
{
if (instance == null || !instance.isInitialized) { return false; }
bool? itemsUpdated = null;
bool timedOut = false;
var query = instance.client.Workshop.CreateQuery();
query.FileId = new List<ulong>(instance.client.Workshop.GetSubscribedItemIds());
query.UploaderAppId = AppID;
query.Run();
query.OnResult = (Workshop.Query q) =>
bool itemsUpdated = false;
foreach (ulong subscribedItemId in instance.client.Workshop.GetSubscribedItemIds())
{
if (timedOut) { return; }
itemsUpdated = false;
foreach (var item in q.Items)
//TODO: fix this, GetItem doesn't query item.Modified
var item = instance.client.Workshop.GetItem(subscribedItemId);
if (item.Installed && CheckWorkshopItemEnabled(item) && !CheckWorkshopItemUpToDate(item))
{
if (item.Installed && CheckWorkshopItemEnabled(item) && !CheckWorkshopItemUpToDate(item))
if (!UpdateWorkshopItem(item, out string errorMsg))
{
if (!UpdateWorkshopItem(item, out string errorMsg))
{
DebugConsole.ThrowError(errorMsg);
new GUIMessageBox(
TextManager.Get("Error"),
TextManager.GetWithVariables("WorkshopItemUpdateFailed", new string[2] { "[itemname]", "[errormessage]" }, new string[2] { item.Title, errorMsg }));
}
else
{
new GUIMessageBox("", TextManager.GetWithVariable("WorkshopItemUpdated", "[itemname]", item.Title));
itemsUpdated = true;
}
DebugConsole.ThrowError(errorMsg);
new GUIMessageBox(
TextManager.Get("Error"),
TextManager.GetWithVariables("WorkshopItemUpdateFailed", new string[2] { "[itemname]", "[errormessage]" }, new string[2] { item.Title, errorMsg }));
}
else
{
new GUIMessageBox("", TextManager.GetWithVariable("WorkshopItemUpdated", "[itemname]", item.Title));
itemsUpdated = true;
}
}
};
DateTime timeOut = DateTime.Now + new TimeSpan(0, 0, 10);
while (!itemsUpdated.HasValue)
{
if (DateTime.Now > timeOut)
{
itemsUpdated = false;
timedOut = true;
break;
}
instance.client.Update();
System.Threading.Thread.Sleep(10);
}
return itemsUpdated.Value;
return itemsUpdated;
}
public static bool UpdateWorkshopItem(Workshop.Item item, out string errorMsg)
@@ -61,7 +61,6 @@ namespace Barotrauma.Networking
localEnabled = box.Selected;
return true;
}
};
@@ -146,12 +145,16 @@ namespace Barotrauma.Networking
{
if (obj is WhiteListedPlayer)
{
if (!(obj is WhiteListedPlayer wlp)) return false;
WhiteListedPlayer wlp = obj as WhiteListedPlayer;
if (wlp == null) return false;
if (!localRemoved.Contains(wlp.UniqueIdentifier)) localRemoved.Add(wlp.UniqueIdentifier);
}
else if (obj is LocalAdded)
{
if (!(obj is LocalAdded lad)) return false;
LocalAdded lad = obj as LocalAdded;
if (lad == null) return false;
if (localAdded.Contains(lad)) localAdded.Remove(lad);
}
@@ -207,6 +210,7 @@ namespace Barotrauma.Networking
{
ip = "IP concealed by host";
}
DebugConsole.NewMessage("nerd: " + name, Color.Lime);
whitelistedPlayers.Add(new WhiteListedPlayer(name, uniqueIdentifier, ip));
}