Unstable 0.15.15.0 (and the one before it I forgor)
This commit is contained in:
@@ -58,7 +58,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<object> SendStateAfterDelay()
|
||||
private IEnumerable<CoroutineStatus> SendStateAfterDelay()
|
||||
{
|
||||
while (sendStateTimer > 0.0f)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<object> SendStateAfterDelay()
|
||||
private IEnumerable<CoroutineStatus> SendStateAfterDelay()
|
||||
{
|
||||
while (sendStateTimer > 0.0f)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Barotrauma.Networking;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
@@ -20,6 +18,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
|
||||
{
|
||||
msg.Write(user?.ID ?? 0);
|
||||
msg.Write(IsActive);
|
||||
msg.Write(progressTimer);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class Reactor
|
||||
{
|
||||
const float NetworkUpdateIntervalLow = 10.0f;
|
||||
|
||||
private Client blameOnBroken;
|
||||
|
||||
private float? nextServerLogWriteTime;
|
||||
@@ -17,19 +19,19 @@ namespace Barotrauma.Items.Components
|
||||
float fissionRate = msg.ReadRangedSingle(0.0f, 100.0f, 8);
|
||||
float turbineOutput = msg.ReadRangedSingle(0.0f, 100.0f, 8);
|
||||
|
||||
if (!item.CanClientAccess(c)) return;
|
||||
if (!item.CanClientAccess(c)) { return; }
|
||||
|
||||
IsActive = true;
|
||||
|
||||
if (!autoTemp && AutoTemp) blameOnBroken = c;
|
||||
if (turbineOutput < targetTurbineOutput) blameOnBroken = c;
|
||||
if (fissionRate > targetFissionRate) blameOnBroken = c;
|
||||
if (turbineOutput < TargetTurbineOutput) blameOnBroken = c;
|
||||
if (fissionRate > TargetFissionRate) blameOnBroken = c;
|
||||
if (!_powerOn && powerOn) blameOnBroken = c;
|
||||
|
||||
AutoTemp = autoTemp;
|
||||
_powerOn = powerOn;
|
||||
targetFissionRate = fissionRate;
|
||||
targetTurbineOutput = turbineOutput;
|
||||
TargetFissionRate = fissionRate;
|
||||
TargetTurbineOutput = turbineOutput;
|
||||
|
||||
LastUser = c.Character;
|
||||
if (nextServerLogWriteTime == null)
|
||||
@@ -46,8 +48,8 @@ namespace Barotrauma.Items.Components
|
||||
msg.Write(autoTemp);
|
||||
msg.Write(_powerOn);
|
||||
msg.WriteRangedSingle(temperature, 0.0f, 100.0f, 8);
|
||||
msg.WriteRangedSingle(targetFissionRate, 0.0f, 100.0f, 8);
|
||||
msg.WriteRangedSingle(targetTurbineOutput, 0.0f, 100.0f, 8);
|
||||
msg.WriteRangedSingle(TargetFissionRate, 0.0f, 100.0f, 8);
|
||||
msg.WriteRangedSingle(TargetTurbineOutput, 0.0f, 100.0f, 8);
|
||||
msg.WriteRangedSingle(degreeOfSuccess, 0.0f, 1.0f, 8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<object> SendStateAfterDelay()
|
||||
private IEnumerable<CoroutineStatus> SendStateAfterDelay()
|
||||
{
|
||||
while (sendStateTimer > 0.0f)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Barotrauma.Networking;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
@@ -19,17 +20,17 @@ namespace Barotrauma.Items.Components
|
||||
GameServer.Log(GameServer.CharacterLogName(c.Character) + " entered \"" + newOutputValue + "\" on " + item.Name,
|
||||
ServerLog.MessageType.ItemInteraction);
|
||||
OutputValue = newOutputValue;
|
||||
ShowOnDisplay(newOutputValue, addToHistory: true);
|
||||
ShowOnDisplay(newOutputValue, addToHistory: true, TextColor);
|
||||
item.SendSignal(newOutputValue, "signal_out");
|
||||
item.CreateServerEvent(this);
|
||||
}
|
||||
}
|
||||
|
||||
partial void ShowOnDisplay(string input, bool addToHistory)
|
||||
partial void ShowOnDisplay(string input, bool addToHistory, Color color)
|
||||
{
|
||||
if (addToHistory)
|
||||
{
|
||||
messageHistory.Add(input);
|
||||
messageHistory.Add(new TerminalMessage(input, color));
|
||||
while (messageHistory.Count > MaxMessages)
|
||||
{
|
||||
messageHistory.RemoveAt(0);
|
||||
@@ -41,7 +42,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
//split too long messages to multiple parts
|
||||
int msgIndex = 0;
|
||||
foreach (string str in messageHistory)
|
||||
foreach (var (str, _) in messageHistory)
|
||||
{
|
||||
string msgToSend = str;
|
||||
if (string.IsNullOrEmpty(msgToSend))
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
partial class TriggerComponent : ItemComponent, IServerSerializable
|
||||
{
|
||||
public void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
|
||||
{
|
||||
msg.WriteRangedSingle(CurrentForceFluctuation, 0.0f, 1.0f, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user