Checking if a client can access an item in the itemcomponent serialization methods

This commit is contained in:
Regalis
2016-12-09 16:56:17 +02:00
parent bea523187b
commit fa712e0102
5 changed files with 33 additions and 8 deletions
@@ -236,8 +236,13 @@ namespace Barotrauma.Items.Components
public void ServerRead(Lidgren.Network.NetIncomingMessage msg, Barotrauma.Networking.Client c)
{
FlowPercentage = msg.ReadRangedInteger(-10, 10) * 10.0f;
IsActive = msg.ReadBoolean();
float flowPercentage = msg.ReadRangedInteger(-10, 10) * 10.0f;
bool isActive = msg.ReadBoolean();
if (!item.CanClientAccess(c)) return;
FlowPercentage = flowPercentage;
IsActive = isActive;
}
public void ServerWrite(Lidgren.Network.NetBuffer msg, Barotrauma.Networking.Client c, object[] extraData = null)