Release 1.10.5.0 - Autumn Update 2025

This commit is contained in:
Regalis11
2025-09-17 13:44:21 +03:00
parent d13836ce87
commit caa0326cf8
120 changed files with 2584 additions and 635 deletions
@@ -7,7 +7,7 @@ namespace Barotrauma.Items.Components
const float NetworkUpdateInterval = 5.0f;
private float networkUpdateTimer;
partial void UpdateProjSpecific(float deltaTime)
partial void UpdateNetworking(float deltaTime)
{
networkUpdateTimer -= deltaTime;
if (networkUpdateTimer <= 0.0f)
@@ -51,6 +51,7 @@ namespace Barotrauma.Items.Components
msg.WriteRangedInteger((int)(flowPercentage / 10.0f), -10, 10);
msg.WriteBoolean(IsActive);
msg.WriteBoolean(Hijacked);
msg.WriteBoolean(Disabled);
if (TargetLevel != null)
{
msg.WriteBoolean(true);
@@ -4,6 +4,8 @@ namespace Barotrauma.Items.Components
{
partial class WifiComponent
{
private readonly int[] networkReceivedChannelMemory = new int[ChannelMemorySize];
public void ServerEventWrite(IWriteMessage msg, Client c, NetEntityEvent.IData extraData = null)
{
SharedEventWrite(msg);
@@ -11,8 +13,21 @@ namespace Barotrauma.Items.Components
public void ServerEventRead(IReadMessage msg, Client c)
{
SharedEventRead(msg);
int newChannel = msg.ReadRangedInteger(MinChannel, MaxChannel);
for (int i = 0; i < ChannelMemorySize; i++)
{
networkReceivedChannelMemory[i] = msg.ReadRangedInteger(MinChannel, MaxChannel);
}
if (item.CanClientAccess(c))
{
Channel = newChannel;
for (int i = 0; i < ChannelMemorySize; i++)
{
channelMemory[i] = networkReceivedChannelMemory[i];
}
}
// Create an event to notify other clients about the changes
item.CreateServerEvent(this);
}
@@ -59,7 +59,7 @@ namespace Barotrauma
ServerLogRemovedItems();
#region local functions
bool IsInventoryAccessible() => sender.Character.CanAccessInventory(this, IsDragAndDropGiveAllowed ? CharacterInventory.AccessLevel.Allowed : CharacterInventory.AccessLevel.Limited);
bool IsInventoryAccessible() => sender.Character.CanAccessInventory(this, IsDragAndDropGiveAllowed ? CharacterInventory.AccessLevel.AllowFriendly : CharacterInventory.AccessLevel.AllowBotsAndPets);
void CreateCorrectiveNetworkEvent()
{
@@ -177,7 +177,7 @@ namespace Barotrauma
if (item.GetComponent<Pickable>() is not Pickable pickable ||
(pickable.IsAttached && !pickable.PickingDone) || item.AllowedSlots.None() || !item.IsInteractable(sender.Character))
{
DebugConsole.AddWarning($"Client {sender.Name} tried to pick up a non-pickable item \"{item}\" (parent inventory: {item.ParentInventory?.Owner.ToString() ?? "null"})",
DebugConsole.AddWarning($"Client {sender.Name} failed to put \"{item}\" in the inventory of {Owner} (parent inventory: {item.ParentInventory?.Owner.ToString() ?? "null"})",
item.Prefab.ContentPackage);
continue;
}
@@ -187,13 +187,20 @@ namespace Barotrauma
var holdable = item.GetComponent<Holdable>();
if (holdable != null && !holdable.CanBeDeattached()) { continue; }
bool itemAccessDenied = !prevItems.Contains(item) && !itemAccessibility[item] &&
(sender.Character == null || item.PreviousParentInventory == null || !sender.Character.CanAccessInventory(item.PreviousParentInventory));
//more restricted "adding" of handcuffs: we can't allow putting handcuffs on a player just because dragging and dropping is allowed
if (item.HasTag(Tags.HandLockerItem) && !itemAccessDenied)
{
itemAccessDenied =
!sender.Character.CanAccessInventory(this, CharacterInventory.AccessLevel.AllowBotsAndPets);
}
if (itemAccessDenied)
{
#if DEBUG || UNSTABLE
DebugConsole.NewMessage($"Client {sender.Name} failed to pick up item \"{item}\" (parent inventory: {item.ParentInventory?.Owner.ToString() ?? "null"}). No access.", Color.Yellow);
DebugConsole.NewMessage($"Client {sender.Name} failed to put \"{item}\" in the inventory of {Owner} (parent inventory: {item.ParentInventory?.Owner.ToString() ?? "null"}). No access.", Color.Yellow);
#endif
if (item.body != null && !sender.PendingPositionUpdates.Contains(item))
{