v0.13.0.11

This commit is contained in:
Joonas Rikkonen
2021-04-22 17:33:08 +03:00
parent 0697d7fc64
commit 8bb31f2893
391 changed files with 17271 additions and 5949 deletions
@@ -5,15 +5,13 @@ namespace Barotrauma.Items.Components
{
partial class DockingPort : ItemComponent, IDrawableComponent, IServerSerializable
{
private UInt16 originalDockingTargetID;
public void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
{
msg.Write(docked);
if (docked)
{
msg.Write(originalDockingTargetID);
msg.Write(DockingTarget.item.ID);
msg.Write(IsLocked);
}
}
@@ -8,7 +8,10 @@ namespace Barotrauma.Items.Components
public override void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
{
base.ServerWrite(msg, c, extraData);
if (!attachable || body == null) { return; }
bool writeAttachData = attachable && body != null;
msg.Write(writeAttachData);
if (!writeAttachData) { return; }
msg.Write(Attached);
msg.Write(body.SimPosition.X);
@@ -51,7 +51,7 @@ namespace Barotrauma.Items.Components
if (dockingButtonClicked)
{
item.SendSignal(0, "1", "toggle_docking", sender: null);
item.SendSignal("1", "toggle_docking");
GameMain.Server.CreateEntityEvent(item, new object[] { NetEntityEvent.Type.ComponentState, item.GetComponentIndex(this), true });
}
@@ -20,17 +20,20 @@ namespace Barotrauma.Items.Components
ServerLog.MessageType.ItemInteraction);
OutputValue = newOutputValue;
ShowOnDisplay(newOutputValue);
item.SendSignal(0, newOutputValue, "signal_out", null);
item.SendSignal(newOutputValue, "signal_out");
item.CreateServerEvent(this);
}
}
partial void ShowOnDisplay(string input)
partial void ShowOnDisplay(string input, bool addToHistory = true)
{
messageHistory.Add(input);
while (messageHistory.Count > MaxMessages)
if (addToHistory)
{
messageHistory.RemoveAt(0);
messageHistory.Add(input);
while (messageHistory.Count > MaxMessages)
{
messageHistory.RemoveAt(0);
}
}
}