(77d1794a) Tester's build January 10th, 2020

This commit is contained in:
juanjp600
2020-01-10 14:42:38 -03:00
parent c02da46ef5
commit e6a08d715b
4529 changed files with 1145046 additions and 218950 deletions
@@ -0,0 +1,36 @@
using Barotrauma.Networking;
using Microsoft.Xna.Framework;
namespace Barotrauma.Items.Components
{
partial class Holdable : Pickable, IServerSerializable, IClientSerializable
{
public override void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
{
base.ServerWrite(msg, c, extraData);
if (!attachable || body == null) { return; }
msg.Write(Attached);
msg.Write(body.SimPosition.X);
msg.Write(body.SimPosition.Y);
}
public void ServerRead(ClientNetObject type, IReadMessage msg, Client c)
{
Vector2 simPosition = new Vector2(msg.ReadSingle(), msg.ReadSingle());
if (!item.CanClientAccess(c) || !Attachable || attached || !MathUtils.IsValid(simPosition)) { return; }
Vector2 offset = simPosition - c.Character.SimPosition;
offset = offset.ClampLength(MaxAttachDistance * 1.5f);
simPosition = c.Character.SimPosition + offset;
Drop(false, null);
item.SetTransform(simPosition, 0.0f);
AttachToWall();
item.CreateServerEvent(this);
GameServer.Log(c.Character.LogName + " attached " + item.Name + " to a wall", ServerLog.MessageType.ItemInteraction);
}
}
}
@@ -0,0 +1,14 @@
using Barotrauma.Networking;
namespace Barotrauma.Items.Components
{
partial class LevelResource : ItemComponent, IServerSerializable
{
private float lastSentDeattachTimer;
public void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
{
msg.Write(deattachTimer);
}
}
}