v1.12.6.2 (Spring Update 2026)
This commit is contained in:
@@ -66,6 +66,9 @@ namespace Barotrauma.Networking
|
||||
txt = msg.ReadString() ?? "";
|
||||
}
|
||||
|
||||
// Sanitize incoming text message from client so they can't use RichString features
|
||||
txt = txt.Replace('‖', ' ');
|
||||
|
||||
if (!NetIdUtils.IdMoreRecent(ID, c.LastSentChatMsgID)) { return; }
|
||||
|
||||
c.LastSentChatMsgID = ID;
|
||||
|
||||
@@ -244,6 +244,8 @@ namespace Barotrauma
|
||||
Character targetCharacter = inventory.Owner as Character;
|
||||
|
||||
if (yoinker == null || item == null || thiefCharacter == null || targetCharacter == null || thiefCharacter == targetCharacter) { return; }
|
||||
|
||||
if (thiefCharacter.TeamID != targetCharacter.TeamID) { return; }
|
||||
|
||||
if (targetClient == null && (!DangerousItemStealBots || targetCharacter.AIController == null)) { return; }
|
||||
|
||||
@@ -261,7 +263,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
Item foundItem = null;
|
||||
if (isValid(item))
|
||||
if (IsValid(item))
|
||||
{
|
||||
foundItem = item;
|
||||
}
|
||||
@@ -269,7 +271,7 @@ namespace Barotrauma
|
||||
{
|
||||
foreach (Item containedItem in item.ContainedItems)
|
||||
{
|
||||
if (isValid(containedItem))
|
||||
if (IsValid(containedItem))
|
||||
{
|
||||
foundItem = containedItem;
|
||||
break;
|
||||
@@ -277,16 +279,19 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
static bool isValid(Item item)
|
||||
static bool IsValid(Item item)
|
||||
{
|
||||
return item.GetComponent<IdCard>() != null || item.GetComponent<RangedWeapon>() != null || item.GetComponent<MeleeWeapon>() != null;
|
||||
return item.GetComponent<IdCard>() != null || IsWeapon(item);
|
||||
}
|
||||
static bool IsWeapon(Item item)
|
||||
{
|
||||
//a threshold of 10 excludes things like tools, all "proper weapons" seem to have a priority higher than that
|
||||
return item.Components.Max(c => c.CombatPriority) > 10.0f || item.HasTag(Tags.Weapon);
|
||||
}
|
||||
|
||||
if (foundItem == null) { return; }
|
||||
|
||||
bool isIdCard = foundItem.GetComponent<IdCard>() != null;
|
||||
bool isWeapon = foundItem.GetComponent<RangedWeapon>() != null || foundItem.GetComponent<MeleeWeapon>() != null;
|
||||
|
||||
if (isIdCard)
|
||||
{
|
||||
string name = string.Empty;
|
||||
@@ -325,7 +330,7 @@ namespace Barotrauma
|
||||
JobPrefab clientJob = yoinker.CharacterInfo?.Job?.Prefab;
|
||||
|
||||
// security officers receive less karma penalty
|
||||
if (clientJob != null && clientJob.Identifier == "securityofficer" && isWeapon)
|
||||
if (clientJob != null && clientJob.Identifier == "securityofficer" && IsWeapon(foundItem))
|
||||
{
|
||||
karmaDecrease *= 0.5f;
|
||||
}
|
||||
|
||||
+7
@@ -32,6 +32,13 @@ namespace Barotrauma.Networking
|
||||
Port = serverSettings.Port,
|
||||
DualStack = GameSettings.CurrentConfig.UseDualModeSockets
|
||||
};
|
||||
if (NetConfig.UseLenientHandshake)
|
||||
{
|
||||
// More lenient timeouts for local testing, so the server would start even without perfect conditions
|
||||
netPeerConfiguration.ConnectionTimeout = 60.0f;
|
||||
netPeerConfiguration.ResendHandshakeInterval = 5.0f;
|
||||
netPeerConfiguration.MaximumHandshakeAttempts = 20;
|
||||
}
|
||||
|
||||
netPeerConfiguration.DisableMessageType(
|
||||
NetIncomingMessageType.DebugMessage
|
||||
|
||||
@@ -582,6 +582,23 @@ namespace Barotrauma.Networking
|
||||
teamSpecificState.RespawnItems.AddRange(AutoItemPlacer.RegenerateLoot(respawnShuttle, respawnContainer));
|
||||
}
|
||||
}
|
||||
else if (character.InWater)
|
||||
{
|
||||
if (divingSuitPrefab != null)
|
||||
{
|
||||
var divingSuit = new Item(divingSuitPrefab, character.Position, respawnSub);
|
||||
Spawner.CreateNetworkEvent(new EntitySpawner.SpawnEntity(divingSuit));
|
||||
character.Inventory.TryPutItem(divingSuit, user: null, allowedSlots: divingSuit.AllowedSlots);
|
||||
teamSpecificState.RespawnItems.Add(divingSuit);
|
||||
if (oxyPrefab != null && divingSuit.GetComponent<ItemContainer>() != null)
|
||||
{
|
||||
var oxyTank = new Item(oxyPrefab, character.Position, respawnSub);
|
||||
Spawner.CreateNetworkEvent(new EntitySpawner.SpawnEntity(oxyTank));
|
||||
divingSuit.Combine(oxyTank, user: null);
|
||||
teamSpecificState.RespawnItems.Add(oxyTank);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var characterData = campaign?.GetClientCharacterData(clients[i]);
|
||||
// NOTE: This was where Reaper's tax got applied
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Barotrauma.Networking
|
||||
.Aggregate(NetFlags.None, (f1, f2) => f1 | f2);
|
||||
|
||||
private bool IsFlagRequired(Client c, NetFlags flag)
|
||||
=> NetIdUtils.IdMoreRecent(LastUpdateIdForFlag[flag], c.LastRecvLobbyUpdate);
|
||||
=> NetIdUtils.IdMoreRecent(LastUpdateIdForFlag[flag], c.LastRecvLobbyUpdate) || !c.InitialLobbyUpdateSent;
|
||||
|
||||
public NetFlags GetRequiredFlags(Client c)
|
||||
=> LastUpdateIdForFlag.Keys
|
||||
|
||||
Reference in New Issue
Block a user