Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop
This commit is contained in:
2
.github/DISCUSSION_TEMPLATE/bug-reports.yml
vendored
2
.github/DISCUSSION_TEMPLATE/bug-reports.yml
vendored
@@ -73,7 +73,7 @@ body:
|
||||
label: Version
|
||||
description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu.
|
||||
options:
|
||||
- v1.9.7.0 (Summer Update 2025)
|
||||
- v1.9.8.0 (Summer Update Hotfix 1)
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -461,7 +461,10 @@ namespace Barotrauma
|
||||
|
||||
Eos.EosAccount.LoginPlatformSpecific();
|
||||
|
||||
initialLoadingThread = new Thread(Load);
|
||||
initialLoadingThread = new Thread(Load)
|
||||
{
|
||||
Name = "Load"
|
||||
};
|
||||
initialLoadingThread.Start();
|
||||
}
|
||||
|
||||
|
||||
@@ -265,6 +265,7 @@ namespace Barotrauma.Items.Components
|
||||
float gainDiff = targetGain - loopingSoundChannel.Gain;
|
||||
loopingSoundChannel.Gain += Math.Abs(gainDiff) < 0.1f ? gainDiff : Math.Sign(gainDiff) * 0.1f;
|
||||
loopingSoundChannel.Position = new Vector3(item.WorldPosition, 0.0f);
|
||||
loopingSound.RoundSound.LastStreamSeekPos = loopingSoundChannel.StreamSeekPos;
|
||||
}
|
||||
for (int i = 0; i < playingOneshotSoundChannels.Count; i++)
|
||||
{
|
||||
@@ -409,6 +410,10 @@ namespace Barotrauma.Items.Components
|
||||
loopingSoundChannel.Near = loopingSound.Range * 0.4f;
|
||||
loopingSoundChannel.Far = loopingSound.Range;
|
||||
}
|
||||
if (loopingSound.RoundSound.Stream)
|
||||
{
|
||||
loopingSoundChannel.StreamSeekPos = loopingSound.RoundSound.LastStreamSeekPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace Barotrauma
|
||||
public readonly bool Stream;
|
||||
public readonly bool IgnoreMuffling;
|
||||
|
||||
public int LastStreamSeekPos;
|
||||
|
||||
public readonly bool MuteBackgroundMusic;
|
||||
|
||||
public readonly string? Filename;
|
||||
|
||||
@@ -152,6 +152,8 @@ namespace Barotrauma
|
||||
|
||||
private bool ignoreMuffling;
|
||||
|
||||
private RoundSound lastPlayingSound;
|
||||
|
||||
private void PlaySound(Entity entity, Hull hull, Vector2 worldPosition)
|
||||
{
|
||||
if (sounds.Count == 0) { return; }
|
||||
@@ -204,6 +206,7 @@ namespace Barotrauma
|
||||
else
|
||||
{
|
||||
soundChannel.Position = new Vector3(worldPosition, 0.0f);
|
||||
if (lastPlayingSound != null && lastPlayingSound.Stream) { lastPlayingSound.LastStreamSeekPos = soundChannel.StreamSeekPos; }
|
||||
}
|
||||
|
||||
KeepLoopingSoundAlive(soundChannel);
|
||||
@@ -248,6 +251,11 @@ namespace Barotrauma
|
||||
ignoreMuffling = selectedSound.IgnoreMuffling;
|
||||
if (soundChannel != null)
|
||||
{
|
||||
if (soundChannel.IsStream && lastPlayingSound == selectedSound)
|
||||
{
|
||||
soundChannel.StreamSeekPos = lastPlayingSound.LastStreamSeekPos;
|
||||
}
|
||||
lastPlayingSound = selectedSound;
|
||||
soundChannel.Looping = loopSound;
|
||||
KeepLoopingSoundAlive(soundChannel);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>1.9.7.0</Version>
|
||||
<Version>1.9.8.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>1.9.7.0</Version>
|
||||
<Version>1.9.8.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>1.9.7.0</Version>
|
||||
<Version>1.9.8.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>1.9.7.0</Version>
|
||||
<Version>1.9.8.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>1.9.7.0</Version>
|
||||
<Version>1.9.8.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>1.9.7.0</Version>
|
||||
<Version>1.9.8.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<contentpackage name="[DebugOnlyTest]RegEx Timeout Test" modversion="1.0.0" corepackage="False" gameversion="1.9.7.0">
|
||||
<Submarine file="%ModDir%/RegEx Timeout Test.sub" />
|
||||
</contentpackage>
|
||||
@@ -282,6 +282,8 @@ namespace Barotrauma
|
||||
|
||||
private static async Task<Consent> RequestAnswerFromRemoteDatabase()
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
static void error(string reason, Exception? exception)
|
||||
{
|
||||
DebugConsole.ThrowError($"Error in {nameof(GameAnalyticsManager)}.{nameof(RequestAnswerFromRemoteDatabase)}: {reason}", exception);
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
{
|
||||
class RegExFindComponent : ItemComponent
|
||||
{
|
||||
private static readonly TimeSpan timeout = TimeSpan.FromMilliseconds(1);
|
||||
/// <summary>
|
||||
/// The timeout should be a lot shorter (used to be 1 ms), but there seems to be an issue in .NET 8
|
||||
/// that sometimes causes the evaluation to randomly take a significant amount of time
|
||||
/// (an expression that normally takes 20 ticks might sometimes take several milliseconds every few minutes).
|
||||
/// So let's use a relatively long timeout instead, and measure the actual time the expression took ourselves.
|
||||
/// </summary>
|
||||
private static readonly TimeSpan timeout = TimeSpan.FromMilliseconds(50);
|
||||
|
||||
private static readonly TimeSpan shortTimeout = TimeSpan.FromMilliseconds(1);
|
||||
|
||||
private readonly Stopwatch stopwatch = new Stopwatch();
|
||||
private bool timedOut;
|
||||
private int timeOutsInARow;
|
||||
const int MaxTimeOutsInARow = 3;
|
||||
|
||||
private string expression;
|
||||
|
||||
@@ -19,6 +33,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private bool nonContinuousOutputSent;
|
||||
|
||||
|
||||
private int maxOutputLength;
|
||||
[Editable, Serialize(200, IsPropertySaveable.No, description: "The maximum length of the output string. Warning: Large values can lead to large memory usage or networking issues.")]
|
||||
public int MaxOutputLength
|
||||
@@ -80,7 +95,7 @@ namespace Barotrauma.Items.Components
|
||||
return;
|
||||
}
|
||||
//reactivate the component, in case some faulty/malicious expression caused it to time out and deactivate itself
|
||||
IsActive = true;
|
||||
timedOut = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +108,12 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
if (timedOut)
|
||||
{
|
||||
item.SendSignal("TIMEOUT", "signal_out");
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(expression) || regex == null) { return; }
|
||||
if (!ContinuousOutput && nonContinuousOutputSent) { return; }
|
||||
|
||||
@@ -100,7 +121,26 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
try
|
||||
{
|
||||
stopwatch.Restart();
|
||||
Match match = regex.Match(receivedSignal);
|
||||
stopwatch.Stop();
|
||||
|
||||
//workaround to regex timeout issues in .NET 8, see comment on the timeout variable
|
||||
if (stopwatch.Elapsed > shortTimeout)
|
||||
{
|
||||
timeOutsInARow++;
|
||||
//if the regex times out just once every now and then, it's a symptom of the .NET 8 bug,
|
||||
//if multiple times in a row, it's most likely a performance-intensive/malicious expression we should react to
|
||||
if (timeOutsInARow >= MaxTimeOutsInARow)
|
||||
{
|
||||
throw new RegexMatchTimeoutException();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
timeOutsInARow = 0;
|
||||
}
|
||||
|
||||
previousResult = match.Success;
|
||||
previousGroups = UseCaptureGroup && previousResult ? match.Groups : null;
|
||||
previousReceivedSignal = receivedSignal;
|
||||
@@ -109,9 +149,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (e is RegexMatchTimeoutException)
|
||||
{
|
||||
item.SendSignal("TIMEOUT", "signal_out");
|
||||
//deactivate the component if the expression caused it to time out
|
||||
IsActive = false;
|
||||
timedOut = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2336,7 +2336,6 @@ namespace Barotrauma
|
||||
|
||||
private void SendPendingNetworkUpdatesInternal()
|
||||
{
|
||||
DebugConsole.NewMessage($"Sending status event for item {Name}", Color.Gray);
|
||||
CreateStatusEvent(loadingRound: false);
|
||||
lastSentCondition = condition;
|
||||
sendConditionUpdateTimer = NetConfig.ItemConditionUpdateInterval;
|
||||
|
||||
@@ -113,6 +113,7 @@ namespace Barotrauma
|
||||
public override void Apply(ActionType type, float deltaTime, Entity entity, IReadOnlyList<ISerializableEntity> targets, Vector2? worldPosition = null)
|
||||
{
|
||||
if (this.type != type) { return; }
|
||||
if (Disabled) { return; }
|
||||
if (ShouldWaitForInterval(entity, deltaTime)) { return; }
|
||||
if (!HasRequiredItems(entity)) { return; }
|
||||
if (delayType == DelayTypes.ReachCursor && Character.Controlled == null) { return; }
|
||||
|
||||
@@ -855,6 +855,9 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disabled effects will no longer be executed. Used to make <see cref="oneShot">oneshot</> effects only execute once.
|
||||
/// </summary>
|
||||
public bool Disabled { get; private set; }
|
||||
|
||||
public static StatusEffect Load(ContentXElement element, string parentDebugName)
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.9.8.0
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed RegEx components occasionally timing out for no apparent reason (even if the expression isn't particularly performance-intensive). Seemed to have been caused by RegEx changes in .NET 8.
|
||||
- Fixed the game sometimes freezing for a long time at a specific point during the loading screen. Only affected some players: the issue had to do with the game failing to connect to a server to check whether the player has given their consent collect gameplay analytics.
|
||||
- Fixed streamed sounds always starting from the beginning when they're re-played. Particularly noticeable in the night club modules, when the music always starts from the beginning if you step outside the range of the sounds.
|
||||
- Fixed distance attenuation and positioning not working on the music played by jukeboxes and bar speakers (meaning they'd play at full volume regardless of your distance to the speakers).
|
||||
|
||||
Modding:
|
||||
- Fixed oneshot delayed effects (which should only ever trigger once) still continuing to run some of the logic after the first trigger, causing an unnecessary performance hit. Did not seem to affect any vanilla items.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.9.7.0
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -10,7 +22,7 @@ Modding:
|
||||
- Fixed conditional's TargetSelf property not working on melee weapons.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.9.6.0
|
||||
v1.9.6.0 (Summer Update 2025)
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Changes and additions:
|
||||
@@ -159,7 +171,7 @@ v1.8.7.0
|
||||
- Fixed normal outpost events triggering in outpost that have been abandoned because of Jovian Radiation.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.8.6.2
|
||||
v1.8.6.2 (Calm Before the Storm)
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed some icons still scaling incorrectly (e.g. location icons on the campaign map, device icons on the status monitor).
|
||||
@@ -579,7 +591,7 @@ Modding:
|
||||
- Fixed outpost generation parameters that reference non-existent NPC prefabs causing a crash during outpost generation.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.6.17.0
|
||||
v1.6.17.0 (Unto the Breach)
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed water currents stopping subs entirely (regardless of the size of the sub or the current).
|
||||
@@ -1086,7 +1098,7 @@ v1.4.5.0
|
||||
- Fixed combat diving suit being slower than intended when using an underwater scooter.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.4.4.1
|
||||
v1.4.4.1 (Blood in the Water)
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed welding objective completing automatically in the basic tutorial due to the reduced flooding rates.
|
||||
@@ -1545,7 +1557,7 @@ v1.1.18.1
|
||||
- Fixed opening the "load game" menu crashing the game if you have any corrupted/unloadable saves in the save folder. In multiplayer, this would just prevent opening the campaign setup menu without any error messages.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.1.18.0
|
||||
v1.1.18.0 (Treacherous Tides)
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Updated translations.
|
||||
@@ -2247,7 +2259,7 @@ v1.0.8.0
|
||||
- Fixed healing your crewmates causing your karma to decrease.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v1.0.7.0
|
||||
v1.0.7.0
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed mechanic tutorial getting stuck at the point where you need to weld a leak.
|
||||
@@ -2330,7 +2342,7 @@ v1.0.1.0
|
||||
- Fixed ready checks not working.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v1.0.0.0
|
||||
v1.0.0.0 (Full Release)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Faction overhaul:
|
||||
@@ -2471,7 +2483,6 @@ v0.21.6.0
|
||||
- Minor localization fixes.
|
||||
- Fixed some occasional crashes in the character editor.
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.21.5.0
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
@@ -2958,7 +2969,7 @@ v0.19.8.0
|
||||
- Fixed "completed initialization before receiving content package order" error when trying to reconnect to a SteamP2P server.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.19.7.0
|
||||
v0.19.7.0 (Hoist the Sails)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Changes and additions:
|
||||
@@ -3339,7 +3350,7 @@ v0.18.9.0
|
||||
- Backwards compatibility: readded some mission events we'd removed since the previous update.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.18.8.0
|
||||
v0.18.8.0 (3rd Anniversary Update)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Balancing:
|
||||
@@ -3629,7 +3640,7 @@ Fixes:
|
||||
- Fixed occasional mission mismatch errors in multiplayer when there's a hunting grounds or beacon mission in the level.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.17.10.0
|
||||
v0.17.10.0 (Urban Expanses)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Changes and additions:
|
||||
@@ -3873,7 +3884,7 @@ v0.16.6.1
|
||||
- Fixed some of Spineling's spikes getting hidden for 30 seconds instead of 15.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.16.6.0
|
||||
v0.16.6.0 (Rising Tide)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Changes and additions:
|
||||
@@ -4523,7 +4534,7 @@ v0.15.10.0
|
||||
- Fixed harpoon rope sometimes being drawn when it's already snapped.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.15.9.0
|
||||
v0.15.9.0 (Among the Ancients)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Alien ruin overhaul:
|
||||
@@ -4855,7 +4866,7 @@ Modding:
|
||||
- Fixed crashing when trying to create a thalamus when there's no wreck AI configs available in the selected content packages.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.14.4.0
|
||||
v0.14.4.0 (Thunder Under the Ice)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Changes:
|
||||
@@ -5045,7 +5056,7 @@ Modding:
|
||||
- Fixed crashing if a mod's version number is incorrectly formatted in filelist.xml.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.13.0.11
|
||||
v0.13.0.11 (Embrace the Abyss)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Campaign changes:
|
||||
@@ -5334,7 +5345,7 @@ v0.12.0.1
|
||||
- Fixed ancient weapon being sometimes unable to damage ruin walls.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.12.0.0
|
||||
v0.12.0.0 (Cave Update)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Cave improvements:
|
||||
@@ -5600,7 +5611,7 @@ v0.11.0.8
|
||||
- Fixed dancing coilguns.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.11.0.7
|
||||
v0.11.0.7 (Uncharted Depths)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Environment overhaul:
|
||||
@@ -5808,7 +5819,7 @@ v0.10.6.1
|
||||
- Test changing the assignment logic for maintenance/operate orders: if the player doesn't specify the target character, use the bot who already is following the same order. The intention is to make it easier to change the target item of the order. The draw back is that ordering multiple bots to man the turrets now requires an extra step: specify the target character.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.10.6.0
|
||||
v0.10.6.0 (Halloween 2020: Creepy Creature Feature)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Changes and additions:
|
||||
@@ -6300,7 +6311,7 @@ v0.10.1.0
|
||||
- Fixed initial campaign cinematic being shown to clients who join mid-campaign.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.10.0.0
|
||||
v0.10.0.0 (New Frontiers)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Improved campaign mode:
|
||||
@@ -6369,7 +6380,7 @@ Bugfixes:
|
||||
- Fixed a bug where a waypoint lost all the references when it was selected and the user pressed over an UI element, like the save button.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
v0.9.10.0
|
||||
v0.9.10.0 (Moloch-sized Update)
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Additions and changes:
|
||||
|
||||
Reference in New Issue
Block a user