FillNetworkData uses NetBuffer instead of OutgoingMessage

This commit is contained in:
Regalis
2015-11-04 20:21:34 +02:00
parent 9f9f0205e7
commit 5a21d64b3a
23 changed files with 36 additions and 39 deletions
@@ -196,13 +196,13 @@ namespace Barotrauma.Items.Components
}
}
public override void FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetOutgoingMessage message)
public override void FillNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
{
message.WriteRangedSingle(MathHelper.Clamp(rechargeSpeed/MaxRechargeSpeed, 0.0f, 1.0f), 0.0f, 1.0f, 8);
message.WriteRangedSingle(MathHelper.Clamp(charge/capacity,0.0f, 1.0f), 0.0f, 1.0f, 8);
}
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetIncomingMessage message)
public override void ReadNetworkData(Networking.NetworkEventType type, Lidgren.Network.NetBuffer message)
{
float newRechargeSpeed = 0f;
float newCharge = 0.0f;