Unstable 0.17.0.0
This commit is contained in:
@@ -9,11 +9,11 @@ namespace Barotrauma.Items.Components
|
||||
msg.Write(tainted);
|
||||
if (tainted)
|
||||
{
|
||||
msg.Write(selectedTaintedEffect?.UIntIdentifier ?? 0);
|
||||
msg.Write(selectedTaintedEffect?.UintIdentifier ?? 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Write(selectedEffect?.UIntIdentifier ?? 0);
|
||||
msg.Write(selectedEffect?.UintIdentifier ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ namespace Barotrauma.Items.Components
|
||||
private const int serverHealthUpdateDelay = 10;
|
||||
private int serverHealthUpdateTimer;
|
||||
|
||||
partial void LoadVines(XElement element)
|
||||
partial void LoadVines(ContentXElement element)
|
||||
{
|
||||
foreach (XElement subElement in element.Elements())
|
||||
foreach (var subElement in element.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class ItemComponent : ISerializableEntity
|
||||
{
|
||||
private bool LoadElemProjSpecific(XElement subElement)
|
||||
private bool LoadElemProjSpecific(ContentXElement subElement)
|
||||
{
|
||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||
{
|
||||
|
||||
@@ -11,28 +11,28 @@ namespace Barotrauma.Items.Components
|
||||
private string lastSentText;
|
||||
private float sendStateTimer;
|
||||
|
||||
[Serialize("", true, description: "The text to display on the label.", alwaysUseInstanceValues: true), Editable(100)]
|
||||
[Serialize("", IsPropertySaveable.Yes, description: "The text to display on the label.", alwaysUseInstanceValues: true), Editable(100)]
|
||||
public string Text
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Editable, Serialize("0,0,0,255", true, description: "The color of the text displayed on the label.", alwaysUseInstanceValues: true)]
|
||||
[Editable, Serialize("0,0,0,255", IsPropertySaveable.Yes, description: "The color of the text displayed on the label.", alwaysUseInstanceValues: true)]
|
||||
public Color TextColor
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Editable, Serialize(1.0f, true, description: "The scale of the text displayed on the label.", alwaysUseInstanceValues: true)]
|
||||
[Editable, Serialize(1.0f, IsPropertySaveable.Yes, description: "The scale of the text displayed on the label.", alwaysUseInstanceValues: true)]
|
||||
public float TextScale
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Serialize("0,0,0,0", true, description: "The amount of padding around the text in pixels (left,top,right,bottom).")]
|
||||
[Serialize("0,0,0,0", IsPropertySaveable.Yes, description: "The amount of padding around the text in pixels (left,top,right,bottom).")]
|
||||
public Vector4 Padding
|
||||
{
|
||||
get;
|
||||
@@ -44,7 +44,7 @@ namespace Barotrauma.Items.Components
|
||||
//do nothing
|
||||
}
|
||||
|
||||
public ItemLabel(Item item, XElement element)
|
||||
public ItemLabel(Item item, ContentXElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,23 +11,23 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
public void ServerRead(ClientNetObject type, IReadMessage msg, Client c)
|
||||
{
|
||||
int itemIndex = msg.ReadRangedInteger(-1, fabricationRecipes.Count - 1);
|
||||
uint recipeHash = msg.ReadUInt32();
|
||||
|
||||
item.CreateServerEvent(this);
|
||||
|
||||
if (!item.CanClientAccess(c)) return;
|
||||
|
||||
if (itemIndex == -1)
|
||||
if (recipeHash == 0)
|
||||
{
|
||||
CancelFabricating(c.Character);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if already fabricating the selected item, return
|
||||
if (fabricatedItem != null && fabricationRecipes.IndexOf(fabricatedItem) == itemIndex) return;
|
||||
if (itemIndex < 0 || itemIndex >= fabricationRecipes.Count) return;
|
||||
if (fabricatedItem != null && fabricatedItem.RecipeHash == recipeHash) { return; }
|
||||
if (recipeHash == 0) { return; }
|
||||
|
||||
StartFabricating(fabricationRecipes[itemIndex], c.Character);
|
||||
StartFabricating(fabricationRecipes[recipeHash], c.Character);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@ namespace Barotrauma.Items.Components
|
||||
FabricatorState stateAtEvent = (FabricatorState)extraData[3];
|
||||
msg.Write((byte)stateAtEvent);
|
||||
msg.Write(timeUntilReady);
|
||||
int itemIndex = fabricatedItem == null ? -1 : fabricationRecipes.IndexOf(fabricatedItem);
|
||||
msg.WriteRangedInteger(itemIndex, -1, fabricationRecipes.Count - 1);
|
||||
UInt16 userID = fabricatedItem == null || user == null ? (UInt16)0 : user.ID;
|
||||
uint recipeHash = fabricatedItem?.RecipeHash ?? 0;
|
||||
msg.Write(recipeHash);
|
||||
UInt16 userID = fabricatedItem is null || user is null ? (UInt16)0 : user.ID;
|
||||
msg.Write(userID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class Repairable : ItemComponent, IServerSerializable, IClientSerializable
|
||||
{
|
||||
void InitProjSpecific()
|
||||
private Character prevLoggedFixer;
|
||||
private FixActions prevLoggedFixAction;
|
||||
|
||||
partial void InitProjSpecific(ContentXElement _)
|
||||
{
|
||||
//let the clients know the initial deterioration delay
|
||||
item.CreateServerEvent(this);
|
||||
@@ -19,7 +22,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (!c.Character.IsTraitor && requestedFixAction == FixActions.Sabotage)
|
||||
{
|
||||
if (GameSettings.VerboseLogging)
|
||||
if (GameSettings.CurrentConfig.VerboseLogging)
|
||||
{
|
||||
DebugConsole.Log($"Non traitor \"{c.Character.Name}\" attempted to sabotage item.");
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Barotrauma
|
||||
{
|
||||
accessible = false;
|
||||
}
|
||||
else if (!characterInventory.AccessibleWhenAlive && !ownerCharacter.IsDead)
|
||||
else if (!characterInventory.AccessibleWhenAlive && !ownerCharacter.IsDead && !characterInventory.AccessibleByOwner)
|
||||
{
|
||||
accessible = false;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Barotrauma.Networking;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -14,7 +15,7 @@ namespace Barotrauma
|
||||
|
||||
public override Sprite Sprite
|
||||
{
|
||||
get { return prefab?.sprite; }
|
||||
get { return base.Prefab?.Sprite; }
|
||||
}
|
||||
|
||||
partial void AssignCampaignInteractionTypeProjSpecific(CampaignMode.InteractionType interactionType)
|
||||
@@ -232,14 +233,14 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteSpawnData(IWriteMessage msg, UInt16 entityID, UInt16 originalInventoryID, byte originalItemContainerIndex)
|
||||
public void WriteSpawnData(IWriteMessage msg, UInt16 entityID, UInt16 originalInventoryID, byte originalItemContainerIndex, int originalSlotIndex)
|
||||
{
|
||||
if (GameMain.Server == null) { return; }
|
||||
|
||||
msg.Write(Prefab.OriginalName);
|
||||
msg.Write(Prefab.Identifier);
|
||||
msg.Write(Description != prefab.Description);
|
||||
if (Description != prefab.Description)
|
||||
msg.Write(Description != base.Prefab.Description);
|
||||
if (Description != base.Prefab.Description)
|
||||
{
|
||||
msg.Write(Description);
|
||||
}
|
||||
@@ -259,9 +260,7 @@ namespace Barotrauma
|
||||
{
|
||||
msg.Write(originalInventoryID);
|
||||
msg.Write(originalItemContainerIndex);
|
||||
|
||||
int slotIndex = ParentInventory.FindIndex(this);
|
||||
msg.Write(slotIndex < 0 ? (byte)255 : (byte)slotIndex);
|
||||
msg.Write(originalSlotIndex < 0 ? (byte)255 : (byte)originalSlotIndex);
|
||||
}
|
||||
|
||||
msg.Write(body == null ? (byte)0 : (byte)body.BodyType);
|
||||
@@ -285,13 +284,13 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
msg.Write(teamID);
|
||||
bool tagsChanged = tags.Count != prefab.Tags.Count || !tags.All(t => prefab.Tags.Contains(t));
|
||||
bool tagsChanged = tags.Count != base.Prefab.Tags.Count || !tags.All(t => base.Prefab.Tags.Contains(t));
|
||||
msg.Write(tagsChanged);
|
||||
if (tagsChanged)
|
||||
{
|
||||
string[] splitTags = Tags.Split(',');
|
||||
msg.Write(string.Join(',', splitTags.Where(t => !prefab.Tags.Contains(t))));
|
||||
msg.Write(string.Join(',', prefab.Tags.Where(t => !splitTags.Contains(t))));
|
||||
IEnumerable<Identifier> splitTags = Tags.Split(',').ToIdentifiers();
|
||||
msg.Write(string.Join(',', splitTags.Where(t => !base.Prefab.Tags.Contains(t))));
|
||||
msg.Write(string.Join(',', base.Prefab.Tags.Where(t => !splitTags.Contains(t))));
|
||||
}
|
||||
var nameTag = GetComponent<NameTag>();
|
||||
msg.Write(nameTag != null);
|
||||
@@ -386,7 +385,7 @@ namespace Barotrauma
|
||||
if (!ItemList.Contains(this))
|
||||
{
|
||||
string errorMsg = "Attempted to create a network event for an item (" + Name + ") that hasn't been fully initialized yet.\n" + Environment.StackTrace.CleanupStackTrace();
|
||||
DebugConsole.ThrowError(errorMsg);
|
||||
DebugConsole.AddWarning(errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("Item.CreateServerEvent:EventForUninitializedItem" + Name + ID, GameAnalyticsManager.ErrorSeverity.Error, errorMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user