Unstable 0.16.5.0

This commit is contained in:
Markus Isberg
2022-02-17 00:03:08 +09:00
parent 2190fe08ef
commit a0696ecb74
51 changed files with 197 additions and 96 deletions
@@ -406,6 +406,7 @@ namespace Barotrauma
if (npc.CampaignInteractionType == CampaignMode.InteractionType.None || npc.Submarine != character.Submarine || npc.IsDead || npc.IsIncapacitated) { continue; } if (npc.CampaignInteractionType == CampaignMode.InteractionType.None || npc.Submarine != character.Submarine || npc.IsDead || npc.IsIncapacitated) { continue; }
var iconStyle = GUI.Style.GetComponentStyle("CampaignInteractionIcon." + npc.CampaignInteractionType); var iconStyle = GUI.Style.GetComponentStyle("CampaignInteractionIcon." + npc.CampaignInteractionType);
if (iconStyle == null) { continue; }
Range<float> visibleRange = new Range<float>(npc.CurrentHull == Character.Controlled.CurrentHull ? 500.0f : 100.0f, float.PositiveInfinity); Range<float> visibleRange = new Range<float>(npc.CurrentHull == Character.Controlled.CurrentHull ? 500.0f : 100.0f, float.PositiveInfinity);
if (npc.CampaignInteractionType == CampaignMode.InteractionType.Examine) if (npc.CampaignInteractionType == CampaignMode.InteractionType.Examine)
{ {
@@ -956,7 +956,7 @@ namespace Barotrauma
public void DrawHUD(SpriteBatch spriteBatch) public void DrawHUD(SpriteBatch spriteBatch)
{ {
if (GUI.DisableHUD) { return; } if (GUI.DisableHUD || Character.Removed) { return; }
if (GameMain.GraphicsWidth != screenResolution.X || if (GameMain.GraphicsWidth != screenResolution.X ||
GameMain.GraphicsHeight != screenResolution.Y || GameMain.GraphicsHeight != screenResolution.Y ||
Math.Abs(inventoryScale - Inventory.UIScale) > 0.01f || Math.Abs(inventoryScale - Inventory.UIScale) > 0.01f ||
@@ -997,14 +997,16 @@ namespace Barotrauma
{ {
healthBar.RectTransform.ScreenSpaceOffset = healthBarShadow.RectTransform.ScreenSpaceOffset = Point.Zero; healthBar.RectTransform.ScreenSpaceOffset = healthBarShadow.RectTransform.ScreenSpaceOffset = Point.Zero;
} }
// If manning a turret the portrait doesn't get rendered so we push the health bar to remove the empty gap if (healthBarHolder != null)
healthBarHolder.RectTransform.ScreenSpaceOffset = Character.ShouldLockHud() ? new Point(0, HUDLayoutSettings.PortraitArea.Height) : Point.Zero; {
// If manning a turret the portrait doesn't get rendered so we push the health bar to remove the empty gap
healthBarHolder.RectTransform.ScreenSpaceOffset = Character.ShouldLockHud() ? new Point(0, HUDLayoutSettings.PortraitArea.Height) : Point.Zero;
}
DrawStatusHUD(spriteBatch); DrawStatusHUD(spriteBatch);
} }
private (Affliction affliction, string text)? highlightedAfflictionIcon; private (Affliction affliction, string text)? highlightedAfflictionIcon;
public void DrawStatusHUD(SpriteBatch spriteBatch) public void DrawStatusHUD(SpriteBatch spriteBatch)
{ {
@@ -21,8 +21,8 @@ namespace Barotrauma
} }
} }
public override bool IsAtCompletionState => State > 0 && requireRescue.None(); public override bool DisplayAsCompleted => State > 0 && requireRescue.None();
public override bool IsAtFailureState => State == HostagesKilledState; public override bool DisplayAsFailed => State == HostagesKilledState;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -4,8 +4,8 @@ namespace Barotrauma
{ {
partial class AlienRuinMission : Mission partial class AlienRuinMission : Mission
{ {
public override bool IsAtCompletionState => State > 0; public override bool DisplayAsCompleted => State > 0;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -2,7 +2,7 @@
{ {
partial class BeaconMission : Mission partial class BeaconMission : Mission
{ {
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => State > 0;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
} }
} }
@@ -5,8 +5,8 @@ namespace Barotrauma
{ {
partial class CargoMission : Mission partial class CargoMission : Mission
{ {
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => false;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override string GetMissionRewardText(Submarine sub) public override string GetMissionRewardText(Submarine sub)
{ {
@@ -21,7 +21,7 @@ namespace Barotrauma
} }
} }
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => false;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
} }
} }
@@ -4,8 +4,8 @@ namespace Barotrauma
{ {
partial class EscortMission : Mission partial class EscortMission : Mission
{ {
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => false;
public override bool IsAtFailureState => State == 1; public override bool DisplayAsFailed => State == 1;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -2,7 +2,7 @@
{ {
partial class GoToMission : Mission partial class GoToMission : Mission
{ {
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => false;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
} }
} }
@@ -6,8 +6,8 @@ namespace Barotrauma
{ {
partial class MineralMission : Mission partial class MineralMission : Mission
{ {
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => false;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -20,13 +20,13 @@ namespace Barotrauma
public virtual IEnumerable<Entity> HudIconTargets => Enumerable.Empty<Entity>(); public virtual IEnumerable<Entity> HudIconTargets => Enumerable.Empty<Entity>();
/// <summary> /// <summary>
/// State at which the only thing left to do is to reach the end of the level. Use for UI references. /// Is the mission at a state at which the only thing left to do is to reach the end of the level?
/// </summary> /// </summary>
public abstract bool IsAtCompletionState { get; } public abstract bool DisplayAsCompleted { get; }
/// <summary> /// <summary>
/// State at which the mission cannot be completed anymore. Use for UI references. /// Is the mission at a state at which the mission cannot be completed anymore?
/// </summary> /// </summary>
public abstract bool IsAtFailureState { get; } public abstract bool DisplayAsFailed { get; }
public Color GetDifficultyColor() public Color GetDifficultyColor()
{ {
@@ -4,8 +4,8 @@ namespace Barotrauma
{ {
partial class MonsterMission : Mission partial class MonsterMission : Mission
{ {
public override bool IsAtCompletionState => State > 0; public override bool DisplayAsCompleted => State > 0;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -6,8 +6,8 @@ namespace Barotrauma
{ {
partial class NestMission : Mission partial class NestMission : Mission
{ {
public override bool IsAtCompletionState => State > 0 && !requireDelivery; public override bool DisplayAsCompleted => State > 0 && !requireDelivery;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -4,8 +4,8 @@ namespace Barotrauma
{ {
partial class PirateMission : Mission partial class PirateMission : Mission
{ {
public override bool IsAtCompletionState => State > 1; public override bool DisplayAsCompleted => State > 1;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -5,8 +5,8 @@ namespace Barotrauma
{ {
partial class SalvageMission : Mission partial class SalvageMission : Mission
{ {
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => false;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -22,8 +22,8 @@ namespace Barotrauma
} }
} }
public override bool IsAtCompletionState => false; public override bool DisplayAsCompleted => false;
public override bool IsAtFailureState => false; public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg) public override void ClientReadInitial(IReadMessage msg)
{ {
@@ -629,7 +629,10 @@ namespace Barotrauma
CharacterInfo? healInfo = crewMember.FindCharacterInfo(MedicalClinic.GetCrewCharacters()); CharacterInfo? healInfo = crewMember.FindCharacterInfo(MedicalClinic.GetCrewCharacters());
if (healInfo is null) { return; } if (healInfo is null) { return; }
GUIFrame pendingHealBackground = new GUIFrame(new RectTransform(new Vector2(1f, 0.25f), parent.RectTransform)); GUIFrame pendingHealBackground = new GUIFrame(new RectTransform(new Vector2(1f, 0.25f), parent.RectTransform), style: "ListBoxElement")
{
CanBeFocused = false
};
GUILayoutGroup pendingHealLayout = new GUILayoutGroup(new RectTransform(new Vector2(0.95f), pendingHealBackground.RectTransform, Anchor.Center)); GUILayoutGroup pendingHealLayout = new GUILayoutGroup(new RectTransform(new Vector2(0.95f), pendingHealBackground.RectTransform, Anchor.Center));
GUILayoutGroup topHeaderLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.3f), pendingHealLayout.RectTransform), isHorizontal: true, Anchor.CenterLeft) { Stretch = true }; GUILayoutGroup topHeaderLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.3f), pendingHealLayout.RectTransform), isHorizontal: true, Anchor.CenterLeft) { Stretch = true };
@@ -658,7 +661,10 @@ namespace Barotrauma
private void CreatePendingAffliction(GUIListBox parent, MedicalClinic.NetCrewMember crewMember, MedicalClinic.NetAffliction affliction, PendingHealElement healElement) private void CreatePendingAffliction(GUIListBox parent, MedicalClinic.NetCrewMember crewMember, MedicalClinic.NetAffliction affliction, PendingHealElement healElement)
{ {
GUIFrame backgroundFrame = new GUIFrame(new RectTransform(new Vector2(1f, 0.33f), parent.Content.RectTransform), style: "ListBoxElement"); GUIFrame backgroundFrame = new GUIFrame(new RectTransform(new Vector2(1f, 0.33f), parent.Content.RectTransform), style: "ListBoxElement")
{
CanBeFocused = false
};
GUILayoutGroup parentLayout = new GUILayoutGroup(new RectTransform(Vector2.One, backgroundFrame.RectTransform), isHorizontal: true) { Stretch = true }; GUILayoutGroup parentLayout = new GUILayoutGroup(new RectTransform(Vector2.One, backgroundFrame.RectTransform), isHorizontal: true) { Stretch = true };
if (!(affliction.Prefab is { } prefab)) { return; } if (!(affliction.Prefab is { } prefab)) { return; }
@@ -760,7 +766,7 @@ namespace Barotrauma
mainFrame.RectTransform.ScreenSpaceOffset = new Point((int)location.X, GameMain.GraphicsHeight - mainFrame.Rect.Height); mainFrame.RectTransform.ScreenSpaceOffset = new Point((int)location.X, GameMain.GraphicsHeight - mainFrame.Rect.Height);
} }
GUITextBlock feedbackBlock = new GUITextBlock(new RectTransform(Vector2.One, mainFrame.RectTransform), TextManager.Get("pleasewaitupnp"), textAlignment: Alignment.Center, font: GUI.LargeFont) GUITextBlock feedbackBlock = new GUITextBlock(new RectTransform(Vector2.One, mainFrame.RectTransform), TextManager.Get("pleasewaitupnp"), textAlignment: Alignment.Center, font: GUI.LargeFont, wrap: true)
{ {
Visible = true Visible = true
}; };
@@ -1069,11 +1069,11 @@ namespace Barotrauma
{ {
if (mission == null || missionIcon == null) { return; } if (mission == null || missionIcon == null) { return; }
string style = string.Empty; string style = string.Empty;
if (mission.IsAtFailureState) if (mission.DisplayAsFailed)
{ {
style = "MissionFailedIcon"; style = "MissionFailedIcon";
} }
else if (mission.IsAtCompletionState) else if (mission.DisplayAsCompleted)
{ {
style = "MissionCompletedIcon"; style = "MissionCompletedIcon";
} }
@@ -1218,11 +1218,7 @@ namespace Barotrauma
new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), linkHolder.RectTransform), TextManager.Get("bugreportgithubform"), style: "MainMenuGUIButton", textAlignment: Alignment.Left) new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), linkHolder.RectTransform), TextManager.Get("bugreportgithubform"), style: "MainMenuGUIButton", textAlignment: Alignment.Left)
{ {
#if UNSTABLE
UserData = "https://barotraumagame.com/unstable-3rf3w5t4ter/",
#else
UserData = "https://github.com/Regalis11/Barotrauma/issues/new?template=bug_report.md", UserData = "https://github.com/Regalis11/Barotrauma/issues/new?template=bug_report.md",
#endif
OnClicked = (btn, userdata) => OnClicked = (btn, userdata) =>
{ {
ShowOpenUrlInWebBrowserPrompt(userdata as string); ShowOpenUrlInWebBrowserPrompt(userdata as string);
@@ -153,12 +153,6 @@ namespace Barotrauma
return container.Inventory; return container.Inventory;
} }
protected override void PutItem(Item item, int i, Character user, bool removeItem = true, bool createNetworkEvent = true)
{
base.PutItem(item, i, user, removeItem, createNetworkEvent);
CreateSlots();
}
public override void CreateSlots() public override void CreateSlots()
{ {
visualSlots ??= new VisualSlot[capacity]; visualSlots ??= new VisualSlot[capacity];
@@ -3557,6 +3557,11 @@ namespace Barotrauma.Networking
case ClientNetError.MISSING_ENTITY: case ClientNetError.MISSING_ENTITY:
outMsg.Write(eventID); outMsg.Write(eventID);
outMsg.Write(entityID); outMsg.Write(entityID);
outMsg.Write((byte)Submarine.Loaded.Count);
foreach (Submarine sub in Submarine.Loaded)
{
outMsg.Write(sub.Info.Name);
}
break; break;
} }
clientPeer.Send(outMsg, DeliveryMethod.Reliable); clientPeer.Send(outMsg, DeliveryMethod.Reliable);
@@ -1,20 +1,16 @@
using Barotrauma.Extensions; using Barotrauma.Extensions;
using Barotrauma.Networking; using Barotrauma.Networking;
using Barotrauma.Steam;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Barotrauma.IO;
using System.Linq; using System.Linq;
using System.Xml.Linq;
using Barotrauma.Steam;
namespace Barotrauma namespace Barotrauma
{ {
partial class NetLobbyScreen : Screen partial class NetLobbyScreen : Screen
{ {
//private readonly List<Sprite> jobPreferenceSprites = new List<Sprite>();
private readonly GUIFrame infoFrame, modeFrame; private readonly GUIFrame infoFrame, modeFrame;
private readonly GUILayoutGroup infoFrameContent; private readonly GUILayoutGroup infoFrameContent;
private readonly GUIFrame myCharacterFrame; private readonly GUIFrame myCharacterFrame;
@@ -1346,9 +1342,9 @@ namespace Barotrauma
StartButton.Visible = GameMain.Client.HasPermission(ClientPermissions.ManageRound) && !GameMain.Client.GameStarted && !CampaignSetupFrame.Visible && !CampaignFrame.Visible; StartButton.Visible = GameMain.Client.HasPermission(ClientPermissions.ManageRound) && !GameMain.Client.GameStarted && !CampaignSetupFrame.Visible && !CampaignFrame.Visible;
ServerName.Readonly = !GameMain.Client.HasPermission(ClientPermissions.ManageSettings); ServerName.Readonly = !GameMain.Client.HasPermission(ClientPermissions.ManageSettings);
ServerMessage.Readonly = !GameMain.Client.HasPermission(ClientPermissions.ManageSettings); ServerMessage.Readonly = !GameMain.Client.HasPermission(ClientPermissions.ManageSettings);
shuttleTickBox.Enabled = GameMain.Client.HasPermission(ClientPermissions.ManageSettings); shuttleTickBox.Enabled = GameMain.Client.HasPermission(ClientPermissions.ManageSettings) && !GameMain.Client.GameStarted;
SubList.Enabled = !CampaignFrame.Visible && (GameMain.Client.ServerSettings.Voting.AllowSubVoting || GameMain.Client.HasPermission(ClientPermissions.SelectSub)); SubList.Enabled = !CampaignFrame.Visible && (GameMain.Client.ServerSettings.Voting.AllowSubVoting || GameMain.Client.HasPermission(ClientPermissions.SelectSub));
ShuttleList.Enabled = ShuttleList.ButtonEnabled = GameMain.Client.HasPermission(ClientPermissions.SelectSub); ShuttleList.Enabled = ShuttleList.ButtonEnabled = GameMain.Client.HasPermission(ClientPermissions.SelectSub) && !GameMain.Client.GameStarted;
ModeList.Enabled = GameMain.Client.ServerSettings.Voting.AllowModeVoting || GameMain.Client.HasPermission(ClientPermissions.SelectMode); ModeList.Enabled = GameMain.Client.ServerSettings.Voting.AllowModeVoting || GameMain.Client.HasPermission(ClientPermissions.SelectMode);
LogButtons.Visible = GameMain.Client.HasPermission(ClientPermissions.ServerLog); LogButtons.Visible = GameMain.Client.HasPermission(ClientPermissions.ServerLog);
GameMain.Client.ShowLogButton.Visible = GameMain.Client.HasPermission(ClientPermissions.ServerLog); GameMain.Client.ShowLogButton.Visible = GameMain.Client.HasPermission(ClientPermissions.ServerLog);
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.16.3.0</Version> <Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
+1 -1
View File
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.16.3.0</Version> <Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product> <Product>Barotrauma</Product>
<Version>0.16.3.0</Version> <Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName> <AssemblyName>Barotrauma</AssemblyName>
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.16.3.0</Version> <Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
+1 -1
View File
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.16.3.0</Version> <Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -430,11 +430,14 @@ namespace Barotrauma
if (avgUpdateRate < Timing.FixedUpdateRate * 0.98 && GameSession != null && Timing.TotalTime > GameSession.RoundStartTime + 1.0) if (avgUpdateRate < Timing.FixedUpdateRate * 0.98 && GameSession != null && Timing.TotalTime > GameSession.RoundStartTime + 1.0)
{ {
DebugConsole.AddWarning($"Running slowly ({avgUpdateRate} updates/s)!"); DebugConsole.AddWarning($"Running slowly ({avgUpdateRate} updates/s)!");
foreach (Client c in Server.ConnectedClients) if (Server != null)
{ {
if (c.Connection == Server.OwnerConnection || c.Permissions != ClientPermissions.None) foreach (Client c in Server.ConnectedClients)
{ {
Server.SendConsoleMessage($"Server running slowly ({avgUpdateRate} updates/s)!", c, Color.Orange); if (c.Connection == Server.OwnerConnection || c.Permissions != ClientPermissions.None)
{
Server.SendConsoleMessage($"Server running slowly ({avgUpdateRate} updates/s)!", c, Color.Orange);
}
} }
} }
} }
@@ -212,7 +212,14 @@ namespace Barotrauma
} }
//use the info of the character the client is currently controlling //use the info of the character the client is currently controlling
// or the previously saved info if not (e.g. if the client has been spectating or died) // or the previously saved info if not (e.g. if the client has been spectating or died)
var characterInfo = c.Character?.Info ?? characterData.Find(d => d.MatchesClient(c))?.CharacterInfo; var characterInfo = c.Character?.Info;
var matchingCharacterData = characterData.Find(d => d.MatchesClient(c));
if (matchingCharacterData != null)
{
//hasn't spawned this round -> don't touch the data
if (!matchingCharacterData.HasSpawned) { continue; }
characterInfo ??= matchingCharacterData.CharacterInfo;
}
if (characterInfo == null) { continue; } if (characterInfo == null) { continue; }
//reduce skills if the character has died //reduce skills if the character has died
if (characterInfo.CauseOfDeath != null && characterInfo.CauseOfDeath.Type != CauseOfDeathType.Disconnected) if (characterInfo.CauseOfDeath != null && characterInfo.CauseOfDeath.Type != CauseOfDeathType.Disconnected)
@@ -117,8 +117,14 @@ namespace Barotrauma.Networking
{ {
GameMain.Server.VoipServer.UnregisterQueue(VoipQueue); GameMain.Server.VoipServer.UnregisterQueue(VoipQueue);
VoipQueue.Dispose(); VoipQueue.Dispose();
characterInfo?.Remove(); if (characterInfo != null)
characterInfo = null; {
if (characterInfo.Character == null || characterInfo.Character.Removed)
{
characterInfo?.Remove();
characterInfo = null;
}
}
} }
public void InitClientSync() public void InitClientSync()
@@ -857,6 +857,12 @@ namespace Barotrauma.Networking
case ClientNetError.MISSING_ENTITY: case ClientNetError.MISSING_ENTITY:
UInt16 eventID = inc.ReadUInt16(); UInt16 eventID = inc.ReadUInt16();
UInt16 entityID = inc.ReadUInt16(); UInt16 entityID = inc.ReadUInt16();
byte subCount = inc.ReadByte();
List<string> subNames = new List<string>();
for (int i = 0; i < subCount; i++)
{
subNames.Add(inc.ReadString());
}
Entity entity = Entity.FindEntityByID(entityID); Entity entity = Entity.FindEntityByID(entityID);
if (entity == null) if (entity == null)
{ {
@@ -875,6 +881,13 @@ namespace Barotrauma.Networking
{ {
errorStr = errorStrNoName = $"Missing entity {entity}, sub: {entity.Submarine?.Info?.Name ?? "none"} (event id {eventID}, entity id {entityID})."; errorStr = errorStrNoName = $"Missing entity {entity}, sub: {entity.Submarine?.Info?.Name ?? "none"} (event id {eventID}, entity id {entityID}).";
} }
var serverSubNames = Submarine.Loaded.Select(s => s.Info.Name);
if (subCount != Submarine.Loaded.Count || !subNames.SequenceEqual(serverSubNames))
{
string subErrorStr = $" Loaded submarines don't match (client: {string.Join(", ", subNames)}, server: {string.Join(", ", serverSubNames)}).";
errorStr += subErrorStr;
errorStrNoName += subErrorStr;
}
break; break;
} }
@@ -1850,9 +1863,10 @@ namespace Barotrauma.Networking
} }
outmsg.Write(GameMain.NetLobbyScreen.SelectedSub.Name); outmsg.Write(GameMain.NetLobbyScreen.SelectedSub.Name);
outmsg.Write(GameMain.NetLobbyScreen.SelectedSub.MD5Hash.ToString()); outmsg.Write(GameMain.NetLobbyScreen.SelectedSub.MD5Hash.ToString());
outmsg.Write(serverSettings.UseRespawnShuttle); outmsg.Write(serverSettings.UseRespawnShuttle || (gameStarted && respawnManager.UsingShuttle));
outmsg.Write(GameMain.NetLobbyScreen.SelectedShuttle.Name); var selectedShuttle = gameStarted && respawnManager.UsingShuttle ? respawnManager.RespawnShuttle.Info : GameMain.NetLobbyScreen.SelectedShuttle;
outmsg.Write(GameMain.NetLobbyScreen.SelectedShuttle.MD5Hash.ToString()); outmsg.Write(selectedShuttle.Name);
outmsg.Write(selectedShuttle.MD5Hash.ToString());
outmsg.Write(serverSettings.Voting.AllowSubVoting); outmsg.Write(serverSettings.Voting.AllowSubVoting);
outmsg.Write(serverSettings.Voting.AllowModeVoting); outmsg.Write(serverSettings.Voting.AllowModeVoting);
@@ -2031,7 +2045,7 @@ namespace Barotrauma.Networking
msg.Write(selectedSub.Name); msg.Write(selectedSub.Name);
msg.Write(selectedSub.MD5Hash.Hash); msg.Write(selectedSub.MD5Hash.Hash);
msg.Write(serverSettings.UseRespawnShuttle); msg.Write(serverSettings.UseRespawnShuttle || (gameStarted && respawnManager.UsingShuttle));
msg.Write(selectedShuttle.Name); msg.Write(selectedShuttle.Name);
msg.Write(selectedShuttle.MD5Hash.Hash); msg.Write(selectedShuttle.MD5Hash.Hash);
@@ -2468,8 +2482,9 @@ namespace Barotrauma.Networking
msg.Write(serverSettings.SelectedLevelDifficulty); msg.Write(serverSettings.SelectedLevelDifficulty);
msg.Write(gameSession.SubmarineInfo.Name); msg.Write(gameSession.SubmarineInfo.Name);
msg.Write(gameSession.SubmarineInfo.MD5Hash.Hash); msg.Write(gameSession.SubmarineInfo.MD5Hash.Hash);
msg.Write(GameMain.NetLobbyScreen.SelectedShuttle.Name); var selectedShuttle = gameStarted && respawnManager.UsingShuttle ? respawnManager.RespawnShuttle.Info : GameMain.NetLobbyScreen.SelectedShuttle;
msg.Write(GameMain.NetLobbyScreen.SelectedShuttle.MD5Hash.Hash); msg.Write(selectedShuttle.Name);
msg.Write(selectedShuttle.MD5Hash.Hash);
msg.Write((byte)GameMain.GameSession.GameMode.Missions.Count()); msg.Write((byte)GameMain.GameSession.GameMode.Missions.Count());
foreach (Mission mission in GameMain.GameSession.GameMode.Missions) foreach (Mission mission in GameMain.GameSession.GameMode.Missions)
{ {
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace> <RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors> <Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product> <Product>Barotrauma Dedicated Server</Product>
<Version>0.16.3.0</Version> <Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright> <Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName> <AssemblyName>DedicatedServer</AssemblyName>
@@ -632,6 +632,7 @@ namespace Barotrauma
{ {
divingSuit.Drop(Character); divingSuit.Drop(Character);
HandleRelocation(divingSuit); HandleRelocation(divingSuit);
ReequipUnequipped();
} }
else if (findItemState == FindItemState.None || findItemState == FindItemState.DivingSuit) else if (findItemState == FindItemState.None || findItemState == FindItemState.DivingSuit)
{ {
@@ -659,6 +660,7 @@ namespace Barotrauma
{ {
divingSuit.Drop(Character); divingSuit.Drop(Character);
HandleRelocation(divingSuit); HandleRelocation(divingSuit);
ReequipUnequipped();
} }
} }
} }
@@ -677,6 +679,7 @@ namespace Barotrauma
{ {
mask.Drop(Character); mask.Drop(Character);
HandleRelocation(mask); HandleRelocation(mask);
ReequipUnequipped();
} }
else if (findItemState == FindItemState.None || findItemState == FindItemState.DivingMask) else if (findItemState == FindItemState.None || findItemState == FindItemState.DivingMask)
{ {
@@ -701,6 +704,7 @@ namespace Barotrauma
{ {
mask.Drop(Character); mask.Drop(Character);
HandleRelocation(mask); HandleRelocation(mask);
ReequipUnequipped();
} }
} }
} }
@@ -2075,10 +2079,12 @@ namespace Barotrauma
public static bool IsItemTargetedBySomeone(ItemComponent target, CharacterTeamType team, out Character operatingCharacter) public static bool IsItemTargetedBySomeone(ItemComponent target, CharacterTeamType team, out Character operatingCharacter)
{ {
operatingCharacter = null; operatingCharacter = null;
if (target?.Item == null) { return false; }
float highestPriority = -1.0f; float highestPriority = -1.0f;
float highestPriorityModifier = -1.0f; float highestPriorityModifier = -1.0f;
foreach (Character c in Character.CharacterList) foreach (Character c in Character.CharacterList)
{ {
if (c == null) { continue; }
if (c.Removed) { continue; } if (c.Removed) { continue; }
if (c.TeamID != team) { continue; } if (c.TeamID != team) { continue; }
if (c.IsIncapacitated) { continue; } if (c.IsIncapacitated) { continue; }
@@ -2087,12 +2093,12 @@ namespace Barotrauma
operatingCharacter = c; operatingCharacter = c;
return true; return true;
} }
if (c.AIController is HumanAIController humanAI) if (c.AIController is HumanAIController humanAI && humanAI.ObjectiveManager is AIObjectiveManager objectiveManager)
{ {
foreach (var objective in humanAI.ObjectiveManager.Objectives) foreach (var objective in objectiveManager.Objectives)
{ {
if (!(objective is AIObjectiveOperateItem operateObjective)) { continue; } if (!(objective is AIObjectiveOperateItem operateObjective)) { continue; }
if (operateObjective.Component.Item != target.Item) { continue; } if (operateObjective.Component?.Item != target.Item) { continue; }
if (operateObjective.Priority < highestPriority) { continue; } if (operateObjective.Priority < highestPriority) { continue; }
if (operateObjective.PriorityModifier < highestPriorityModifier) { continue; } if (operateObjective.PriorityModifier < highestPriorityModifier) { continue; }
operatingCharacter = c; operatingCharacter = c;
@@ -457,12 +457,20 @@ namespace Barotrauma
// Cannot use the head position, because not all characters have head or it can be below the total height of the character // Cannot use the head position, because not all characters have head or it can be below the total height of the character
float characterHeight = Math.Max(colliderSize.Y + character.AnimController.ColliderHeightFromFloor, minHeight); float characterHeight = Math.Max(colliderSize.Y + character.AnimController.ColliderHeightFromFloor, minHeight);
float horizontalDistance = Math.Abs(collider.SimPosition.X - currentPath.CurrentNode.SimPosition.X); float horizontalDistance = Math.Abs(collider.SimPosition.X - currentPath.CurrentNode.SimPosition.X);
bool isAboveFeet = currentPath.CurrentNode.SimPosition.Y > colliderBottom.Y; bool isTargetTooHigh = currentPath.CurrentNode.SimPosition.Y > colliderBottom.Y + characterHeight;
bool isNotTooHigh = currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y + characterHeight; bool isTargetTooLow = currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y;
var door = currentPath.CurrentNode.ConnectedDoor; var door = currentPath.CurrentNode.ConnectedDoor;
float margin = MathHelper.Lerp(1, 10, MathHelper.Clamp(Math.Abs(velocity.X) / 5, 0, 1)); float margin = MathHelper.Lerp(1, 10, MathHelper.Clamp(Math.Abs(velocity.X) / 5, 0, 1));
if (currentPath.CurrentNode.Stairs != null && currentPath.NextNode?.Stairs == null)
{
margin = 1;
if (currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y + character.AnimController.ColliderHeightFromFloor * 0.25f)
{
isTargetTooLow = true;
}
}
float targetDistance = Math.Max(colliderSize.X / 2 * margin, minWidth / 2); float targetDistance = Math.Max(colliderSize.X / 2 * margin, minWidth / 2);
if (horizontalDistance < targetDistance && isAboveFeet && isNotTooHigh && (door == null || door.CanBeTraversed)) if (horizontalDistance < targetDistance && !isTargetTooHigh && !isTargetTooLow && (door == null || door.CanBeTraversed))
{ {
NextNode(!doorsChecked); NextNode(!doorsChecked);
} }
@@ -3759,10 +3759,6 @@ namespace Barotrauma
if (!wasDead) if (!wasDead)
{ {
TryAdjustAttackerSkill(attacker, CharacterHealth.Vitality - prevVitality); TryAdjustAttackerSkill(attacker, CharacterHealth.Vitality - prevVitality);
if (IsDead)
{
attacker?.RecordKill(this);
}
} }
}; };
if (attackResult.Damage > 0) if (attackResult.Damage > 0)
@@ -4027,6 +4023,7 @@ namespace Barotrauma
var abilityCharacterKiller = new AbilityCharacterKiller(CauseOfDeath.Killer); var abilityCharacterKiller = new AbilityCharacterKiller(CauseOfDeath.Killer);
CheckTalents(AbilityEffectType.OnDieToCharacter, abilityCharacterKiller); CheckTalents(AbilityEffectType.OnDieToCharacter, abilityCharacterKiller);
CauseOfDeath.Killer?.RecordKill(this);
if (GameMain.GameSession != null && Screen.Selected == GameMain.GameScreen) if (GameMain.GameSession != null && Screen.Selected == GameMain.GameScreen)
{ {
@@ -4035,7 +4032,7 @@ namespace Barotrauma
KillProjSpecific(causeOfDeath, causeOfDeathAffliction, log); KillProjSpecific(causeOfDeath, causeOfDeathAffliction, log);
if (info != null) if (info != null)
{ {
info.CauseOfDeath = CauseOfDeath; info.CauseOfDeath = CauseOfDeath;
info.MissionsCompletedSinceDeath = 0; info.MissionsCompletedSinceDeath = 0;
@@ -4549,6 +4546,8 @@ namespace Barotrauma
if (addingFirstTime) if (addingFirstTime)
{ {
OnTalentGiven(talentPrefab); OnTalentGiven(talentPrefab);
GameAnalyticsManager.AddDesignEvent("TalentUnlocked:" + (info.Job?.Prefab.Identifier ?? "None") + ":" + talentPrefab.Identifier,
GameMain.GameSession?.Campaign?.TotalPlayTime ?? 0.0);
} }
return true; return true;
} }
@@ -202,7 +202,7 @@ namespace Barotrauma
get { return pressureAffliction; } get { return pressureAffliction; }
} }
public Character Character { get; private set; } public readonly Character Character;
public CharacterHealth(Character character) public CharacterHealth(Character character)
{ {
@@ -478,5 +478,18 @@ namespace Barotrauma
return TryPutItem(item, user, new List<InvSlotType>() { placeToSlots }, createNetworkEvent, ignoreCondition); return TryPutItem(item, user, new List<InvSlotType>() { placeToSlots }, createNetworkEvent, ignoreCondition);
} }
protected override void PutItem(Item item, int i, Character user, bool removeItem = true, bool createNetworkEvent = true)
{
base.PutItem(item, i, user, removeItem, createNetworkEvent);
#if CLIENT
CreateSlots();
#endif
if (item.CampaignInteractionType == CampaignMode.InteractionType.Cargo)
{
item.CampaignInteractionType = CampaignMode.InteractionType.None;
}
}
} }
} }
@@ -130,11 +130,6 @@ namespace Barotrauma.Items.Components
} }
if (picker.Inventory.TryPutItemWithAutoEquipCheck(item, picker, allowedSlots)) if (picker.Inventory.TryPutItemWithAutoEquipCheck(item, picker, allowedSlots))
{ {
if (item.CampaignInteractionType == CampaignMode.InteractionType.Cargo)
{
item.CampaignInteractionType = CampaignMode.InteractionType.None;
}
if (!picker.HeldItems.Contains(item) && item.body != null) { item.body.Enabled = false; } if (!picker.HeldItems.Contains(item) && item.body != null) { item.body.Enabled = false; }
this.picker = picker; this.picker = picker;
@@ -541,7 +541,9 @@ namespace Barotrauma
} }
} }
} }
RemoveInActiveTriggerers(PhysicsBody, triggerers);
if (stayTriggeredDelay > 0.0f) if (stayTriggeredDelay > 0.0f)
{ {
if (triggerers.Count == 0) if (triggerers.Count == 0)
@@ -472,7 +472,7 @@ namespace Barotrauma
cloneWire.Connect((clones[itemIndex] as Item).Connections[connectionIndex], false); cloneWire.Connect((clones[itemIndex] as Item).Connections[connectionIndex], false);
} }
if (cloneWire.Connections[0] == null || cloneWire.Connections[1] == null) if ((cloneWire.Connections[0] == null || cloneWire.Connections[1] == null) && cloneItem.GetComponent<DockingPort>() == null)
{ {
if (!clones.Any(c => (c as Item)?.GetComponent<ConnectionPanel>()?.DisconnectedWires.Contains(cloneWire) ?? false)) if (!clones.Any(c => (c as Item)?.GetComponent<ConnectionPanel>()?.DisconnectedWires.Contains(cloneWire) ?? false))
{ {
@@ -1624,7 +1624,7 @@ namespace Barotrauma
DebugConsole.ShowError("Random rotation is not supported for Projectiles."); DebugConsole.ShowError("Random rotation is not supported for Projectiles.");
break; break;
default: default:
throw new NotImplementedException("Not implemented: " + chosenItemSpawnInfo.RotationType); throw new NotImplementedException("Projectile spawn rotation type not implemented: " + chosenItemSpawnInfo.RotationType);
} }
rotation += MathHelper.ToRadians(chosenItemSpawnInfo.Rotation * user.AnimController.Dir); rotation += MathHelper.ToRadians(chosenItemSpawnInfo.Rotation * user.AnimController.Dir);
projectile.Shoot(user, ConvertUnits.ToSimUnits(worldPos), ConvertUnits.ToSimUnits(worldPos), rotation + spread, ignoredBodies: user.AnimController.Limbs.Where(l => !l.IsSevered).Select(l => l.body.FarseerBody).ToList(), createNetworkEvent: true); projectile.Shoot(user, ConvertUnits.ToSimUnits(worldPos), ConvertUnits.ToSimUnits(worldPos), rotation + spread, ignoredBodies: user.AnimController.Limbs.Where(l => !l.IsSevered).Select(l => l.body.FarseerBody).ToList(), createNetworkEvent: true);
@@ -1664,8 +1664,10 @@ namespace Barotrauma
case ItemSpawnInfo.SpawnRotationType.Random: case ItemSpawnInfo.SpawnRotationType.Random:
rotation = Rand.Range(0f, MathHelper.TwoPi, Rand.RandSync.Unsynced); rotation = Rand.Range(0f, MathHelper.TwoPi, Rand.RandSync.Unsynced);
break; break;
case ItemSpawnInfo.SpawnRotationType.Target:
break;
default: default:
throw new NotImplementedException("Not implemented: " + chosenItemSpawnInfo.RotationType); throw new NotImplementedException("Spawn rotation type not implemented: " + chosenItemSpawnInfo.RotationType);
} }
body.SetTransform(newItem.SimPosition, rotation); body.SetTransform(newItem.SimPosition, rotation);
body.ApplyLinearImpulse(Rand.Vector(1) * chosenItemSpawnInfo.Speed); body.ApplyLinearImpulse(Rand.Vector(1) * chosenItemSpawnInfo.Speed);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+45
View File
@@ -1,3 +1,48 @@
---------------------------------------------------------------------------------------------------------
v0.16.5.0
---------------------------------------------------------------------------------------------------------
- Misc fixes to Herja, Winterhalter, and Barsuk (unstable only).
- Fixed certain talents (e.g. Bounty Hunter) not working if the target is killed "indirectly" (e.g. bloodloss caused by severing a limb).
- Increased bandit and pirate aim speeds (unstable only).
- Fixes character resetting in MP campaign if you join mid-round and don't get to spawn in before the next round in a campaign you've previously played in.
- Increased handcannon round's max stack size to 12 (unstable only).
- Fixed error in the medical clinic UI when trying to heal a character whose owner has disconnected (even if the character is still alive). Unstable only.
---------------------------------------------------------------------------------------------------------
v0.16.4.0
---------------------------------------------------------------------------------------------------------
Changes and additions:
- Sounds for the new monster variants.
- Adjusted animations ragdolls and animations for the variants.
- Decreased the initial recharge rate of Dugong's supercapacitors a bit and slightly increased the reactor output (the supercapacitors were a bit too much for the reactor to handle).
- Husked Crawler: Reduced the gunshotwound and stun resistances from 60% to 40%. Decreased the cooldown time when attacking walls.
- Crawler Broodmother is resistant to stuns, like all the other bigger monsters.
- Slightly adjusted the combat strengths of Hammerhead Matriarch, Mudraptor Hatchling and Mudraptor Veteran.
- Increased Crawler Broodmother's health from 800 to 1000.
- Increased Crawler's health from 65 to 80.
- Increased Crawler Hatchling's health from 32 to 40.
- Add vitality multipliers for all Crawlers: more damage at head, less at tail or legs/arms.
- Increased revolver dmg from 30 to 35 and decreased bleeding from 40 to 30.
- Handcannon: increase bleeding from 50 to 70 (unstable only).
Fixes:
- Fixed the Depleted Fuel SMG Magazine using the recycle recipe of the regular SMG Magazine.
- Fixed SMG magazine recyle recipes not requiring the talent.
- Fixed beacon missions not being displayed as completed mid-round in the tab menu after the beacon's been activated (unstable only).
- Fixed bots not re-equipping body armor/ballistic helmet/something else when they drop the diving gear.
- Waypoint fixes to Herja, Humpback, Orca, Orca2, R-29, and Remora.
- Fixes to Herja, Winterhalter, and Barsuk (unstable only).
- Fixed a nullref exception in CharacterHUD.Draw when an icon can't be found for a campaign interaction.
- Upgrade supercapacitor max recharge speed in subs saved prior to v0.16.3.0 (unstable only).
- Remove store icon from items when they're picked up by a bot (unstable only).
- Fixed colliders being off on clothing items and ballistic helmets having a different scale when not worn (unstable only).
- Fixed bots having issues with some stairs. Note: these changes might require alterations on stair waypoints. Currently the generator doesn't do perfect job there. Look for the examples on how to fix them manually in the vanilla subs.
- Fixed inability to clone docking ports in the sub editor (unstable only).
- Fixed LevelTriggers with multiple fixtures not deactivating when the triggerer leaves them (e.g. slowdown from spiky bushes not going away, unstable only).
- Fixed crashing when a status effect tries to spawn a non-projectile using the "Target" rotation type (e.g. when a watcher emits acid, unstable only).
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------
v0.16.3.0 v0.16.3.0
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------