(60001519f) Fixed clients not being able to see other characters in spectator if they've died far away from the sub. + Increased position update interval for spectators. Closes #1421

+ Merge fix
This commit is contained in:
Joonas Rikkonen
2019-04-16 17:13:50 +03:00
parent 2b11c79a4c
commit e0fe737c3b
8 changed files with 4 additions and 189 deletions
@@ -292,7 +292,6 @@ namespace Barotrauma
if (!string.IsNullOrWhiteSpace(damageModifier.DamageSound)) if (!string.IsNullOrWhiteSpace(damageModifier.DamageSound))
{ {
damageSoundType = damageModifier.DamageSound; damageSoundType = damageModifier.DamageSound;
SoundPlayer.PlayDamageSound(damageSoundType, Math.Max(damage, bleedingDamage), WorldPosition);
break; break;
} }
} }
@@ -4,7 +4,6 @@ using Barotrauma.Networking;
using FarseerPhysics; using FarseerPhysics;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -607,20 +606,7 @@ namespace Barotrauma
characterListBox.BarScroll = roundedPos; characterListBox.BarScroll = roundedPos;
} }
#region Dialog return false;
/// <summary>
/// Adds the message to the single player chatbox.
/// </summary>
public void AddSinglePlayerChatMessage(string senderName, string text, ChatMessageType messageType, Character sender)
{
if (!isSinglePlayer)
{
DebugConsole.ThrowError("Cannot add messages to single player chat box in multiplayer mode!\n" + Environment.StackTrace);
return;
}
if (string.IsNullOrEmpty(text)) { return; }
ChatBox.AddMessage(ChatMessage.Create(senderName, text, messageType, sender));
} }
private IEnumerable<object> KillCharacterAnim(GUIComponent component) private IEnumerable<object> KillCharacterAnim(GUIComponent component)
@@ -633,12 +619,6 @@ namespace Barotrauma
{ {
comp.Color = Color.DarkRed; comp.Color = Color.DarkRed;
} }
List<Character> availableSpeakers = Character.CharacterList.FindAll(c =>
c.AIController is HumanAIController &&
!c.IsDead &&
c.SpeechImpediment <= 100.0f);
pendingConversationLines.AddRange(NPCConversation.CreateRandom(availableSpeakers));
}
yield return new WaitForSeconds(1.0f); yield return new WaitForSeconds(1.0f);
@@ -438,7 +438,6 @@ namespace Barotrauma
QuickUseItem(Items[i], true, false, true); QuickUseItem(Items[i], true, false, true);
} }
} }
}
//force personal slots open if an item is running out of battery/fuel/oxygen/etc //force personal slots open if an item is running out of battery/fuel/oxygen/etc
if (hidePersonalSlots) if (hidePersonalSlots)
@@ -463,16 +462,6 @@ namespace Barotrauma
{ {
UpdateSubInventory(deltaTime, highlightedSubInventorySlot.SlotIndex, cam); UpdateSubInventory(deltaTime, highlightedSubInventorySlot.SlotIndex, cam);
} }
}
List<SlotReference> hideSubInventories = new List<SlotReference>();
foreach (var highlightedSubInventorySlot in highlightedSubInventorySlots)
{
if (highlightedSubInventorySlot.ParentInventory == this)
{
UpdateSubInventory(deltaTime, highlightedSubInventorySlot.SlotIndex, cam);
}
}
Rectangle hoverArea = GetSubInventoryHoverArea(highlightedSubInventorySlot); Rectangle hoverArea = GetSubInventoryHoverArea(highlightedSubInventorySlot);
if (highlightedSubInventorySlot.Inventory?.slots == null || (!hoverArea.Contains(PlayerInput.MousePosition))) if (highlightedSubInventorySlot.Inventory?.slots == null || (!hoverArea.Contains(PlayerInput.MousePosition)))
@@ -80,20 +80,6 @@ namespace Barotrauma
sender.UserData = null; sender.UserData = null;
} }
}; };
clientNameBox.OnTextChanged += RefreshJoinButtonState;
var filterHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.5f), leftColumn.RectTransform)) { RelativeSpacing = 0.05f };
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), filterHolder.RectTransform), TextManager.Get("FilterServers"));
searchBox = new GUITextBox(new RectTransform(new Vector2(1.0f, 0.13f), filterHolder.RectTransform), "");
var tickBoxHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.5f), filterHolder.RectTransform));
searchBox.OnTextChanged += (txtBox, txt) => { FilterServers(); return true; };
filterPassword = new GUITickBox(new RectTransform(new Vector2(1.0f, 0.27f), tickBoxHolder.RectTransform), TextManager.Get("FilterPassword"));
filterPassword.OnSelected += (tickBox) => { FilterServers(); return true; };
filterIncompatible = new GUITickBox(new RectTransform(new Vector2(1.0f, 0.27f), tickBoxHolder.RectTransform), TextManager.Get("FilterIncompatibleServers"));
filterIncompatible.OnSelected += (tickBox) => { FilterServers(); return true; };
var filterHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.5f), leftColumn.RectTransform)) { RelativeSpacing = 0.05f }; var filterHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.5f), leftColumn.RectTransform)) { RelativeSpacing = 0.05f };
@@ -207,12 +193,6 @@ namespace Barotrauma
UserData = "noresults" UserData = "noresults"
}; };
} }
else
{
joinButton.Enabled = false;
}
return true;
} }
private bool RefreshJoinButtonState(GUIComponent component, object obj) private bool RefreshJoinButtonState(GUIComponent component, object obj)
@@ -21,9 +21,9 @@ namespace Barotrauma
{ {
if (!Enabled) { return 1000.0f; } if (!Enabled) { return 1000.0f; }
if (recipient.Character == null) if (recipient.Character == null || recipient.Character.IsDead)
{ {
return 0.1f; return 0.2f;
} }
else else
{ {
@@ -84,7 +84,7 @@ namespace Barotrauma
{ {
searchHullTimer -= deltaTime; searchHullTimer -= deltaTime;
} }
else if (currenthullSafety < HumanAIController.HULL_SAFETY_THRESHOLD) else
{ {
var bestHull = FindBestHull(); var bestHull = FindBestHull();
if (bestHull != null && bestHull != currentHull) if (bestHull != null && bestHull != currentHull)
@@ -449,18 +449,6 @@ namespace Barotrauma
DeconstructItems = new List<DeconstructItem>(); DeconstructItems = new List<DeconstructItem>();
FabricationRecipes = new List<FabricationRecipe>(); FabricationRecipes = new List<FabricationRecipe>();
DeconstructTime = 1.0f; DeconstructTime = 1.0f;
Tags = element.GetAttributeStringArray("tags", new string[0], convertToLowerInvariant: true).ToHashSet();
if (Tags.None())
{
Tags = element.GetAttributeStringArray("Tags", new string[0], convertToLowerInvariant: true).ToHashSet();
}
Tags = new HashSet<string>(element.GetAttributeStringArray("tags", new string[0], convertToLowerInvariant: true));
if (Tags.None())
{
Tags = new HashSet<string>(element.GetAttributeStringArray("Tags", new string[0], convertToLowerInvariant: true));
}
Tags = new HashSet<string>(element.GetAttributeStringArray("tags", new string[0], convertToLowerInvariant: true)); Tags = new HashSet<string>(element.GetAttributeStringArray("tags", new string[0], convertToLowerInvariant: true));
if (Tags.None()) if (Tags.None())
@@ -63,127 +63,6 @@ namespace Barotrauma
return "Hull"; return "Hull";
} }
} }
[Editable, Serialize("", true)]
public string RoomName
{
get;
set;
}
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public string DisplayName public string DisplayName
{ {