- server doesn't create a new EntityEvent if there's a duplicate event waiting to be sent
- hull, radar, steering & pump syncing
This commit is contained in:
@@ -1451,12 +1451,6 @@ namespace Barotrauma
|
|||||||
closestCharacter = null;
|
closestCharacter = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
findClosestTimer = 0.1f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
findClosestTimer -= deltaTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedCharacter == null && closestItem != null)
|
if (selectedCharacter == null && closestItem != null)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Xna.Framework;
|
using Barotrauma.Networking;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
@@ -7,15 +8,13 @@ using System.Xml.Linq;
|
|||||||
|
|
||||||
namespace Barotrauma.Items.Components
|
namespace Barotrauma.Items.Components
|
||||||
{
|
{
|
||||||
class Pump : Powered
|
class Pump : Powered, IServerSerializable, IClientSerializable
|
||||||
{
|
{
|
||||||
private float flowPercentage;
|
private float flowPercentage;
|
||||||
private float maxFlow;
|
private float maxFlow;
|
||||||
|
|
||||||
private float? targetLevel;
|
private float? targetLevel;
|
||||||
|
|
||||||
private float lastUpdate;
|
|
||||||
|
|
||||||
public Hull hull1;
|
public Hull hull1;
|
||||||
|
|
||||||
private GUITickBox isActiveTickBox;
|
private GUITickBox isActiveTickBox;
|
||||||
@@ -75,6 +74,15 @@ namespace Barotrauma.Items.Components
|
|||||||
IsActive = !IsActive;
|
IsActive = !IsActive;
|
||||||
if (!IsActive) currPowerConsumption = 0.0f;
|
if (!IsActive) currPowerConsumption = 0.0f;
|
||||||
|
|
||||||
|
if (GameMain.Server != null)
|
||||||
|
{
|
||||||
|
item.CreateServerEvent(this);
|
||||||
|
}
|
||||||
|
else if (GameMain.Client != null)
|
||||||
|
{
|
||||||
|
item.CreateClientEvent(this);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -83,6 +91,15 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
FlowPercentage -= 10.0f;
|
FlowPercentage -= 10.0f;
|
||||||
|
|
||||||
|
if (GameMain.Server != null)
|
||||||
|
{
|
||||||
|
item.CreateServerEvent(this);
|
||||||
|
}
|
||||||
|
else if (GameMain.Client != null)
|
||||||
|
{
|
||||||
|
item.CreateClientEvent(this);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -91,6 +108,15 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
FlowPercentage += 10.0f;
|
FlowPercentage += 10.0f;
|
||||||
|
|
||||||
|
if (GameMain.Server != null)
|
||||||
|
{
|
||||||
|
item.CreateServerEvent(this);
|
||||||
|
}
|
||||||
|
else if (GameMain.Client != null)
|
||||||
|
{
|
||||||
|
item.CreateClientEvent(this);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using FarseerPhysics;
|
using Barotrauma.Networking;
|
||||||
|
using FarseerPhysics;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
@@ -8,7 +9,7 @@ using Voronoi2;
|
|||||||
|
|
||||||
namespace Barotrauma.Items.Components
|
namespace Barotrauma.Items.Components
|
||||||
{
|
{
|
||||||
class Radar : Powered
|
class Radar : Powered, IServerSerializable, IClientSerializable
|
||||||
{
|
{
|
||||||
private float range;
|
private float range;
|
||||||
|
|
||||||
@@ -56,6 +57,14 @@ namespace Barotrauma.Items.Components
|
|||||||
isActiveTickBox = new GUITickBox(new Rectangle(0, 0, 20, 20), "Sonar", Alignment.TopLeft, GuiFrame);
|
isActiveTickBox = new GUITickBox(new Rectangle(0, 0, 20, 20), "Sonar", Alignment.TopLeft, GuiFrame);
|
||||||
isActiveTickBox.OnSelected = (GUITickBox box) =>
|
isActiveTickBox.OnSelected = (GUITickBox box) =>
|
||||||
{
|
{
|
||||||
|
if (GameMain.Server != null)
|
||||||
|
{
|
||||||
|
item.CreateServerEvent(this);
|
||||||
|
}
|
||||||
|
else if (GameMain.Client != null)
|
||||||
|
{
|
||||||
|
item.CreateClientEvent(this);
|
||||||
|
}
|
||||||
IsActive = box.Selected;
|
IsActive = box.Selected;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -420,6 +429,8 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
IsActive = msg.ReadBoolean();
|
IsActive = msg.ReadBoolean();
|
||||||
isActiveTickBox.Selected = IsActive;
|
isActiveTickBox.Selected = IsActive;
|
||||||
|
|
||||||
|
item.CreateServerEvent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ServerWrite(Lidgren.Network.NetBuffer msg, Barotrauma.Networking.Client c, object[] extraData = null)
|
public void ServerWrite(Lidgren.Network.NetBuffer msg, Barotrauma.Networking.Client c, object[] extraData = null)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using FarseerPhysics;
|
using Barotrauma.Networking;
|
||||||
|
using FarseerPhysics;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
@@ -11,7 +12,7 @@ using Voronoi2;
|
|||||||
|
|
||||||
namespace Barotrauma.Items.Components
|
namespace Barotrauma.Items.Components
|
||||||
{
|
{
|
||||||
class Steering : Powered
|
class Steering : Powered, IServerSerializable, IClientSerializable
|
||||||
{
|
{
|
||||||
private const float AutopilotRayCastInterval = 0.5f;
|
private const float AutopilotRayCastInterval = 0.5f;
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ namespace Barotrauma.Items.Components
|
|||||||
private PathFinder pathFinder;
|
private PathFinder pathFinder;
|
||||||
|
|
||||||
private float networkUpdateTimer;
|
private float networkUpdateTimer;
|
||||||
private bool valueChanged;
|
private bool unsentChanges;
|
||||||
|
|
||||||
private float autopilotRayCastTimer;
|
private float autopilotRayCastTimer;
|
||||||
|
|
||||||
@@ -112,7 +113,7 @@ namespace Barotrauma.Items.Components
|
|||||||
autopilotTickBox.OnSelected = (GUITickBox box) =>
|
autopilotTickBox.OnSelected = (GUITickBox box) =>
|
||||||
{
|
{
|
||||||
AutoPilot = box.Selected;
|
AutoPilot = box.Selected;
|
||||||
valueChanged = true;
|
unsentChanges = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
@@ -139,13 +140,22 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
public override void Update(float deltaTime, Camera cam)
|
public override void Update(float deltaTime, Camera cam)
|
||||||
{
|
{
|
||||||
if (valueChanged)
|
if (unsentChanges)
|
||||||
{
|
{
|
||||||
networkUpdateTimer -= deltaTime;
|
networkUpdateTimer -= deltaTime;
|
||||||
if (networkUpdateTimer <= 0.0f)
|
if (networkUpdateTimer <= 0.0f)
|
||||||
{
|
{
|
||||||
|
if (GameMain.Client != null)
|
||||||
|
{
|
||||||
|
item.CreateClientEvent(this);
|
||||||
|
}
|
||||||
|
else if (GameMain.Server != null)
|
||||||
|
{
|
||||||
|
item.CreateServerEvent(this);
|
||||||
|
}
|
||||||
|
|
||||||
networkUpdateTimer = 0.5f;
|
networkUpdateTimer = 0.5f;
|
||||||
valueChanged = false;
|
unsentChanges = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +229,7 @@ namespace Barotrauma.Items.Components
|
|||||||
TargetVelocity = PlayerInput.MousePosition - new Vector2(velRect.Center.X, velRect.Center.Y);
|
TargetVelocity = PlayerInput.MousePosition - new Vector2(velRect.Center.X, velRect.Center.Y);
|
||||||
targetVelocity.Y = -targetVelocity.Y;
|
targetVelocity.Y = -targetVelocity.Y;
|
||||||
|
|
||||||
valueChanged = true;
|
unsentChanges = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -389,7 +399,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
private bool ToggleMaintainPosition(GUITickBox tickBox)
|
private bool ToggleMaintainPosition(GUITickBox tickBox)
|
||||||
{
|
{
|
||||||
valueChanged = true;
|
unsentChanges = true;
|
||||||
|
|
||||||
levelStartTickBox.Selected = false;
|
levelStartTickBox.Selected = false;
|
||||||
levelEndTickBox.Selected = false;
|
levelEndTickBox.Selected = false;
|
||||||
@@ -410,7 +420,7 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
private bool SelectDestination(GUITickBox tickBox)
|
private bool SelectDestination(GUITickBox tickBox)
|
||||||
{
|
{
|
||||||
valueChanged = true;
|
unsentChanges = true;
|
||||||
|
|
||||||
if (tickBox == levelStartTickBox)
|
if (tickBox == levelStartTickBox)
|
||||||
{
|
{
|
||||||
@@ -501,6 +511,9 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//notify all clients of the changed state
|
||||||
|
unsentChanges = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ServerWrite(Lidgren.Network.NetBuffer msg, Barotrauma.Networking.Client c, object[] extraData = null)
|
public void ServerWrite(Lidgren.Network.NetBuffer msg, Barotrauma.Networking.Client c, object[] extraData = null)
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ using FarseerPhysics.Dynamics;
|
|||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Lidgren.Network;
|
using Lidgren.Network;
|
||||||
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
|
|
||||||
class Hull : MapEntity, IPropertyObject
|
class Hull : MapEntity, IPropertyObject, IServerSerializable
|
||||||
{
|
{
|
||||||
public static List<Hull> hullList = new List<Hull>();
|
public static List<Hull> hullList = new List<Hull>();
|
||||||
private static List<EntityGrid> entityGrids = new List<EntityGrid>();
|
private static List<EntityGrid> entityGrids = new List<EntityGrid>();
|
||||||
@@ -362,6 +363,8 @@ namespace Barotrauma
|
|||||||
public void AddFireSource(FireSource fireSource)
|
public void AddFireSource(FireSource fireSource)
|
||||||
{
|
{
|
||||||
fireSources.Add(fireSource);
|
fireSources.Add(fireSource);
|
||||||
|
|
||||||
|
if (GameMain.Server != null) GameMain.Server.CreateEntityEvent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update(Camera cam, float deltaTime)
|
public override void Update(Camera cam, float deltaTime)
|
||||||
@@ -452,7 +455,7 @@ namespace Barotrauma
|
|||||||
if (Math.Abs(lastSentVolume - volume) > FullVolume * 0.1f ||
|
if (Math.Abs(lastSentVolume - volume) > FullVolume * 0.1f ||
|
||||||
Math.Abs(lastSentOxygen - OxygenPercentage) > 5f)
|
Math.Abs(lastSentOxygen - OxygenPercentage) > 5f)
|
||||||
{
|
{
|
||||||
|
if (GameMain.Server != null) GameMain.Server.CreateEntityEvent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!update)
|
if (!update)
|
||||||
@@ -461,6 +464,7 @@ namespace Barotrauma
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float surfaceY = rect.Y - rect.Height + Volume / rect.Width;
|
float surfaceY = rect.Y - rect.Height + Volume / rect.Width;
|
||||||
for (int i = 0; i < waveY.Length; i++)
|
for (int i = 0; i < waveY.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -555,6 +559,8 @@ namespace Barotrauma
|
|||||||
public void RemoveFire(FireSource fire)
|
public void RemoveFire(FireSource fire)
|
||||||
{
|
{
|
||||||
fireSources.Remove(fire);
|
fireSources.Remove(fire);
|
||||||
|
|
||||||
|
if (GameMain.Server != null) GameMain.Server.CreateEntityEvent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true)
|
public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true)
|
||||||
@@ -806,19 +812,82 @@ namespace Barotrauma
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//public List<Gap> FindGaps()
|
public void ServerWrite(NetBuffer message, Client c, object[] extraData = null)
|
||||||
//{
|
{
|
||||||
// List<Gap> gaps = new List<Gap>();
|
message.WriteRangedSingle(MathHelper.Clamp(volume / FullVolume, 0.0f, 1.5f), 0.0f, 1.5f, 8);
|
||||||
|
message.WriteRangedSingle(MathHelper.Clamp(OxygenPercentage, 0.0f, 100.0f), 0.0f, 100.0f, 8);
|
||||||
|
|
||||||
// foreach (Gap gap in Gap.GapList)
|
message.Write(fireSources.Count > 0);
|
||||||
// {
|
if (fireSources.Count > 0)
|
||||||
// if (gap.Open < 0.01f) continue;
|
{
|
||||||
|
message.WriteRangedInteger(0, 16, Math.Min(fireSources.Count, 16));
|
||||||
|
for (int i = 0; i < Math.Min(fireSources.Count, 16); i++)
|
||||||
|
{
|
||||||
|
var fireSource = fireSources[i];
|
||||||
|
Vector2 normalizedPos = new Vector2(
|
||||||
|
(fireSource.Position.X - rect.X) / rect.Width,
|
||||||
|
(fireSource.Position.Y - (rect.Y - rect.Height)) / rect.Height);
|
||||||
|
|
||||||
// if (gap.linkedTo.Contains(this)) gaps.Add(gap);
|
message.WriteRangedSingle(MathHelper.Clamp(normalizedPos.X, 0.0f, 1.0f), 0.0f, 1.0f, 4);
|
||||||
// }
|
message.WriteRangedSingle(MathHelper.Clamp(normalizedPos.Y, 0.0f, 1.0f), 0.0f, 1.0f, 4);
|
||||||
|
message.WriteRangedSingle(MathHelper.Clamp(fireSource.Size.X / rect.Width, 0.0f, 1.0f), 0, 1.0f, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// return gaps;
|
lastSentVolume = volume;
|
||||||
//}
|
lastSentOxygen = OxygenPercentage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClientRead(NetIncomingMessage message, float sendingTime)
|
||||||
|
{
|
||||||
|
Volume = message.ReadRangedSingle(0.0f, 1.5f, 8) * FullVolume;
|
||||||
|
OxygenPercentage = message.ReadRangedSingle(0.0f, 100.0f, 8);
|
||||||
|
|
||||||
|
bool hasFireSources = message.ReadBoolean();
|
||||||
|
|
||||||
|
List<FireSource> newFireSources = new List<FireSource>();
|
||||||
|
if (hasFireSources)
|
||||||
|
{
|
||||||
|
int fireSourceCount = message.ReadRangedInteger(0, 16);
|
||||||
|
for (int i = 0; i < fireSourceCount; i++)
|
||||||
|
{
|
||||||
|
Vector2 pos = Vector2.Zero;
|
||||||
|
float size = 0.0f;
|
||||||
|
pos.X = MathHelper.Clamp(message.ReadRangedSingle(0.0f, 1.0f, 4), 0.05f, 0.95f);
|
||||||
|
pos.Y = MathHelper.Clamp(message.ReadRangedSingle(0.0f, 1.0f, 4), 0.05f, 0.95f);
|
||||||
|
size = message.ReadRangedSingle(0.0f, 1.0f, 6);
|
||||||
|
|
||||||
|
pos = new Vector2(
|
||||||
|
rect.X + rect.Width * pos.X,
|
||||||
|
rect.Y - rect.Height + (rect.Height * pos.Y));
|
||||||
|
|
||||||
|
var existingFire = fireSources.Find(fs => fs.Contains(pos));
|
||||||
|
if (existingFire != null)
|
||||||
|
{
|
||||||
|
newFireSources.Add(existingFire);
|
||||||
|
existingFire.Position = pos;
|
||||||
|
existingFire.Size = new Vector2(
|
||||||
|
existingFire.Hull == null ? size : size * existingFire.Hull.rect.Width,
|
||||||
|
existingFire.Size.Y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var newFire = new FireSource(pos + Submarine.Position);
|
||||||
|
newFire.Size = new Vector2(
|
||||||
|
newFire.Hull == null ? size : size * newFire.Hull.rect.Width,
|
||||||
|
newFire.Size.Y);
|
||||||
|
//ignore if the fire wasn't added to this room (invalid position)?
|
||||||
|
if (!fireSources.Contains(newFire)) continue;
|
||||||
|
newFireSources.Add(newFire);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var toBeRemoved = fireSources.FindAll(fs => !newFireSources.Contains(fs));
|
||||||
|
toBeRemoved.ForEach(tbr => tbr.Remove());
|
||||||
|
|
||||||
|
fireSources = newFireSources;
|
||||||
|
}
|
||||||
|
|
||||||
public override XElement Save(XElement parentElement)
|
public override XElement Save(XElement parentElement)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ namespace Barotrauma.Networking
|
|||||||
sparseUpdateTimer = DateTime.Now + sparseUpdateInterval;
|
sparseUpdateTimer = DateTime.Now + sparseUpdateInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CreateEntityEvent(IServerSerializable entity, object[] extraData)
|
public void CreateEntityEvent(IServerSerializable entity, object[] extraData = null)
|
||||||
{
|
{
|
||||||
entityEventManager.CreateEvent(entity, extraData);
|
entityEventManager.CreateEvent(entity, extraData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ namespace Barotrauma.Networking
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
interface IClientSerializable : INetSerializable
|
interface IClientSerializable : INetSerializable
|
||||||
{
|
{
|
||||||
UInt32 NetStateID { get; }
|
|
||||||
|
|
||||||
void ClientWrite(NetBuffer msg, object[] extraData = null);
|
void ClientWrite(NetBuffer msg, object[] extraData = null);
|
||||||
void ServerRead(NetIncomingMessage msg, Client c);
|
void ServerRead(NetIncomingMessage msg, Client c);
|
||||||
}
|
}
|
||||||
@@ -21,8 +19,6 @@ namespace Barotrauma.Networking
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
interface IServerSerializable : INetSerializable
|
interface IServerSerializable : INetSerializable
|
||||||
{
|
{
|
||||||
UInt32 NetStateID { get; }
|
|
||||||
|
|
||||||
void ServerWrite(NetBuffer msg, Client c, object[] extraData = null);
|
void ServerWrite(NetBuffer msg, Client c, object[] extraData = null);
|
||||||
void ClientRead(NetIncomingMessage msg, float sendingTime);
|
void ClientRead(NetIncomingMessage msg, float sendingTime);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
private IServerSerializable serializable;
|
private IServerSerializable serializable;
|
||||||
|
|
||||||
|
public bool Sent;
|
||||||
|
|
||||||
public ServerEntityEvent(IServerSerializable entity, UInt32 id)
|
public ServerEntityEvent(IServerSerializable entity, UInt32 id)
|
||||||
: base(entity, id)
|
: base(entity, id)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,11 +26,18 @@ namespace Barotrauma.Networking
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ID++;
|
var newEvent = new ServerEntityEvent(entity, ID + 1);
|
||||||
|
|
||||||
var newEvent = new ServerEntityEvent(entity, ID);
|
|
||||||
if (extraData != null) newEvent.SetData(extraData);
|
if (extraData != null) newEvent.SetData(extraData);
|
||||||
|
|
||||||
|
for (int i = events.Count - 1; i >= 0 && !events[i].Sent; i--)
|
||||||
|
{
|
||||||
|
//we already have an identical event that's waiting to be sent
|
||||||
|
// -> no need to add a new one
|
||||||
|
if (events[i].IsDuplicate(newEvent)) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ID++;
|
||||||
|
|
||||||
events.Add(newEvent);
|
events.Add(newEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,6 +65,7 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
foreach (NetEntityEvent entityEvent in eventsToSync)
|
foreach (NetEntityEvent entityEvent in eventsToSync)
|
||||||
{
|
{
|
||||||
|
(entityEvent as ServerEntityEvent).Sent = true;
|
||||||
client.entityEventLastSent[entityEvent.ID] = (float)NetTime.Now;
|
client.entityEventLastSent[entityEvent.ID] = (float)NetTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,10 +189,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Character.Controlled.SelectedConstruction.DrawHUD(spriteBatch, cam, Character.Controlled);
|
Character.Controlled.SelectedConstruction.DrawHUD(spriteBatch, cam, Character.Controlled);
|
||||||
}
|
}
|
||||||
else if (!Character.Controlled.SelectedConstruction.IsInPickRange(Character.Controlled.WorldPosition))
|
|
||||||
{
|
|
||||||
Character.Controlled.SelectedConstruction = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Character.Controlled != null && cam != null) Character.Controlled.DrawHUD(spriteBatch, cam);
|
if (Character.Controlled != null && cam != null) Character.Controlled.DrawHUD(spriteBatch, cam);
|
||||||
|
|||||||
Reference in New Issue
Block a user