v0.10.5.1
This commit is contained in:
@@ -9,6 +9,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
//force can only be adjusted at 10% intervals -> no need for more accuracy than this
|
||||
msg.WriteRangedInteger((int)(targetForce / 10.0f), -10, 10);
|
||||
msg.Write(User == null ? Entity.NullEntityID : User.ID);
|
||||
}
|
||||
|
||||
public void ServerRead(ClientNetObject type, IReadMessage msg, Client c)
|
||||
@@ -23,6 +24,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
|
||||
targetForce = newTargetForce;
|
||||
User = c.Character;
|
||||
}
|
||||
|
||||
//notify all clients of the changed state
|
||||
|
||||
@@ -31,9 +31,22 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
private ulong serverEventId = 0;
|
||||
public override void ServerAppendExtraData(ref object[] extraData)
|
||||
{
|
||||
//ensuring the uniqueness of this event is
|
||||
//required for the fabricator to sync correctly;
|
||||
//otherwise, the event manager would incorrectly
|
||||
//assume that the client actually has the latest state
|
||||
Array.Resize(ref extraData, 4);
|
||||
extraData[2] = serverEventId;
|
||||
extraData[3] = State;
|
||||
}
|
||||
|
||||
public void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
|
||||
{
|
||||
msg.Write((byte)State);
|
||||
FabricatorState stateAtEvent = (FabricatorState)extraData[3];
|
||||
msg.Write((byte)stateAtEvent);
|
||||
msg.Write(timeUntilReady);
|
||||
int itemIndex = fabricatedItem == null ? -1 : fabricationRecipes.IndexOf(fabricatedItem);
|
||||
msg.WriteRangedInteger(itemIndex, -1, fabricationRecipes.Count - 1);
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
GameServer.Log(GameServer.CharacterLogName(c.Character) + (newIsActive ? " turned on " : " turned off ") + item.Name, ServerLog.MessageType.ItemInteraction);
|
||||
}
|
||||
if (pumpSpeedLockTimer <= 0.0f)
|
||||
{
|
||||
targetLevel = null;
|
||||
}
|
||||
|
||||
FlowPercentage = newFlowPercentage;
|
||||
IsActive = newIsActive;
|
||||
|
||||
@@ -22,13 +22,12 @@ namespace Barotrauma.Items.Components
|
||||
bool autoPilot = msg.ReadBoolean();
|
||||
bool dockingButtonClicked = msg.ReadBoolean();
|
||||
Vector2 newSteeringInput = targetVelocity;
|
||||
bool maintainPos = false;
|
||||
Vector2? newPosToMaintain = null;
|
||||
bool headingToStart = false;
|
||||
|
||||
if (autoPilot)
|
||||
{
|
||||
maintainPos = msg.ReadBoolean();
|
||||
bool maintainPos = msg.ReadBoolean();
|
||||
if (maintainPos)
|
||||
{
|
||||
newPosToMaintain = new Vector2(
|
||||
|
||||
Reference in New Issue
Block a user