(eda627512) Fixed MonoKickStart files needed by the dedicated server not being copied to the output directory in release builds

This commit is contained in:
Joonas Rikkonen
2019-04-29 21:08:00 +03:00
parent 1f3c6349ab
commit b3b1d1851d
21 changed files with 61 additions and 121 deletions
@@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
./Barotrauma exec mono "./Barotrauma.exe" MONO_LOG_LEVEL=debug "$@"
@@ -186,18 +186,12 @@
<None Include="Content\Effects\watershader_opengl.xnb"> <None Include="Content\Effects\watershader_opengl.xnb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="lib64\libMonoPosixHelper.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="libopenal.so.1"> <None Include="libopenal.so.1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="libsteam_api64.so"> <None Include="libsteam_api64.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="libvlc.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Barotrauma"> <None Include="Barotrauma">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -98,7 +98,7 @@ namespace Barotrauma
if (distSqrd > 10.0f || !character.AllowInput) if (distSqrd > 10.0f || !character.AllowInput)
{ {
Collider.TargetRotation = newRotation; Collider.TargetRotation = newRotation;
SetPosition(newPosition, lerp: distSqrd < 5.0f, ignorePlatforms: false); SetPosition(newPosition, lerp: distSqrd < 5.0f);
} }
else else
{ {
@@ -149,62 +149,6 @@ namespace Barotrauma
character.MemLocalState[i].TransformOutToInside(currentHull.Submarine); character.MemLocalState[i].TransformOutToInside(currentHull.Submarine);
} }
} }
if (localPos.Animation != serverPos.Animation)
{
if (serverPos.Animation == AnimController.Animation.CPR)
{
character.AnimController.Anim = AnimController.Animation.CPR;
}
else if (character.AnimController.Anim == AnimController.Animation.CPR)
{
character.AnimController.Anim = AnimController.Animation.None;
}
}
Hull serverHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(serverPos.Position), character.CurrentHull, serverPos.Position.Y < lowestSubPos);
Hull clientHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(localPos.Position), serverHull, localPos.Position.Y < lowestSubPos);
if (serverHull != null && clientHull != null && serverHull.Submarine != clientHull.Submarine)
{
//hull subs don't match => teleport the camera to the other sub
character.Submarine = serverHull.Submarine;
character.CurrentHull = currentHull = serverHull;
SetPosition(serverPos.Position);
character.MemLocalState.Clear();
}
else
{
Vector2 positionError = serverPos.Position - localPos.Position;
float rotationError = serverPos.Rotation.HasValue && localPos.Rotation.HasValue ?
serverPos.Rotation.Value - localPos.Rotation.Value :
0.0f;
for (int i = localPosIndex; i < character.MemLocalState.Count; i++)
{
Hull pointHull = Hull.FindHull(ConvertUnits.ToDisplayUnits(character.MemLocalState[i].Position), clientHull, character.MemLocalState[i].Position.Y < lowestSubPos);
if (pointHull != clientHull && ((pointHull == null) || (clientHull == null) || (pointHull.Submarine == clientHull.Submarine))) break;
character.MemLocalState[i].Translate(positionError, rotationError);
}
float errorMagnitude = positionError.Length();
if (errorMagnitude > 0.01f)
{
Collider.TargetPosition = Collider.SimPosition + positionError;
Collider.TargetRotation = Collider.Rotation + rotationError;
Collider.MoveToTargetPosition(lerp: true);
if (errorMagnitude > 0.5f)
{
character.MemLocalState.Clear();
foreach (Limb limb in Limbs)
{
limb.body.TargetPosition = limb.body.SimPosition + positionError;
limb.body.MoveToTargetPosition(lerp: true);
}
}
}
}
} }
if (character.MemState.Count < 1) return; if (character.MemState.Count < 1) return;
@@ -294,20 +238,30 @@ namespace Barotrauma
} }
float errorMagnitude = positionError.Length(); float errorMagnitude = positionError.Length();
if (errorMagnitude > 0.5f) if (errorMagnitude > 0.01f)
{
character.MemLocalState.Clear();
SetPosition(serverPos.Position, lerp: true, ignorePlatforms: false);
}
else if (errorMagnitude > 0.01f)
{ {
Collider.TargetPosition = Collider.SimPosition + positionError; Collider.TargetPosition = Collider.SimPosition + positionError;
Collider.TargetRotation = Collider.Rotation + rotationError; Collider.TargetRotation = Collider.Rotation + rotationError;
Collider.MoveToTargetPosition(lerp: true); Collider.MoveToTargetPosition(lerp: true);
if (errorMagnitude > 0.5f)
{
character.MemLocalState.Clear();
foreach (Limb limb in Limbs)
{
limb.body.TargetPosition = limb.body.SimPosition + positionError;
limb.body.MoveToTargetPosition(lerp: true);
}
}
} }
} }
} }
}
if (Character.Controlled == character)
{
GameMain.GameScreen.Cam.Shake = Math.Min(Math.Max(strongestImpact, GameMain.GameScreen.Cam.Shake), 3.0f);
}
}
if (character.MemLocalState.Count > 120) character.MemLocalState.RemoveRange(0, character.MemLocalState.Count - 120); if (character.MemLocalState.Count > 120) character.MemLocalState.RemoveRange(0, character.MemLocalState.Count - 120);
character.MemState.Clear(); character.MemState.Clear();
@@ -46,7 +46,8 @@ namespace Barotrauma
if (controlled == value) return; if (controlled == value) return;
controlled = value; controlled = value;
if (controlled != null) controlled.Enabled = true; if (controlled != null) controlled.Enabled = true;
CharacterHealth.OpenHealthWindow = null; CharacterHealth.OpenHealthWindow = null;
} }
} }
@@ -85,8 +85,7 @@ namespace Barotrauma
{ {
if (character.Inventory != null) if (character.Inventory != null)
{ {
if (!character.LockHands && character.Stun < 0.1f && if (!character.LockHands && character.Stun < 0.1f)
(character.SelectedConstruction == null || character.SelectedConstruction.GetComponent<Controller>() == null))
{ {
character.Inventory.Update(deltaTime, cam); character.Inventory.Update(deltaTime, cam);
} }
@@ -321,7 +320,6 @@ namespace Barotrauma
} }
if (character.Inventory != null && !character.LockHands) if (character.Inventory != null && !character.LockHands)
{ {
character.Inventory.Locked = (character.SelectedConstruction != null && character.SelectedConstruction.GetComponent<Controller>() != null);
character.Inventory.DrawOwn(spriteBatch); character.Inventory.DrawOwn(spriteBatch);
character.Inventory.CurrentLayout = CharacterHealth.OpenHealthWindow == null && character.SelectedCharacter == null ? character.Inventory.CurrentLayout = CharacterHealth.OpenHealthWindow == null && character.SelectedCharacter == null ?
CharacterInventory.Layout.Default : CharacterInventory.Layout.Default :
@@ -793,7 +793,7 @@ namespace Barotrauma
base.Draw(spriteBatch); base.Draw(spriteBatch);
if (hideButton != null && hideButton.Visible && !Locked) if (hideButton != null && hideButton.Visible)
{ {
hideButton.DrawManually(spriteBatch, alsoChildren: true); hideButton.DrawManually(spriteBatch, alsoChildren: true);
} }
@@ -835,7 +835,6 @@ namespace Barotrauma
color = Color.White; color = Color.White;
highlightedQuickUseSlot = slots[i]; highlightedQuickUseSlot = slots[i];
} }
if (Locked) { color *= 0.3f; }
var quickUseIndicator = Items[i].AllowedSlots.Any(a => a == InvSlotType.Any) ? var quickUseIndicator = Items[i].AllowedSlots.Any(a => a == InvSlotType.Any) ?
EquipIndicator : DropIndicator; EquipIndicator : DropIndicator;
@@ -820,9 +820,8 @@ namespace Barotrauma
else else
{ {
Sprite slotSprite = slot.SlotSprite ?? slotSpriteSmall; Sprite slotSprite = slot.SlotSprite ?? slotSpriteSmall;
Color slotColor = slot.IsHighlighted ? Color.White : Color.White * 0.8f;
if (inventory != null && inventory.Locked) { slotColor = Color.Gray * 0.5f; } spriteBatch.Draw(slotSprite.Texture, rect, slotSprite.SourceRect, slot.IsHighlighted ? Color.White : Color.White * 0.8f);
spriteBatch.Draw(slotSprite.Texture, rect, slotSprite.SourceRect, slotColor);
if (item != null && drawItem) if (item != null && drawItem)
{ {
@@ -874,17 +873,14 @@ namespace Barotrauma
} }
indicatorSprite.Draw(spriteBatch, containedIndicatorArea.Center.ToVector2(), indicatorSprite.Draw(spriteBatch, containedIndicatorArea.Center.ToVector2(),
(inventory != null && inventory.Locked) ? Color.DarkGray * 0.5f : Color.DarkGray * 0.9f, Color.DarkGray * 0.9f,
origin: indicatorSprite.size / 2, origin: indicatorSprite.size / 2,
rotate: 0.0f, rotate: 0.0f,
scale: indicatorScale); scale: indicatorScale);
Color indicatorColor = ToolBox.GradientLerp(containedState, Color.Red, Color.Orange, Color.Green);
if (inventory != null && inventory.Locked) { indicatorColor *= 0.5f; }
spriteBatch.Draw(indicatorSprite.Texture, containedIndicatorArea.Center.ToVector2(), spriteBatch.Draw(indicatorSprite.Texture, containedIndicatorArea.Center.ToVector2(),
sourceRectangle: new Rectangle(indicatorSprite.SourceRect.Location, new Point((int)(indicatorSprite.SourceRect.Width * containedState), indicatorSprite.SourceRect.Height)), sourceRectangle: new Rectangle(indicatorSprite.SourceRect.Location, new Point((int)(indicatorSprite.SourceRect.Width * containedState), indicatorSprite.SourceRect.Height)),
color: indicatorColor, color: ToolBox.GradientLerp(containedState, Color.Red, Color.Orange, Color.Green),
rotation: 0.0f, rotation: 0.0f,
origin: indicatorSprite.size / 2, origin: indicatorSprite.size / 2,
scale: indicatorScale, scale: indicatorScale,
@@ -924,7 +920,6 @@ namespace Barotrauma
} }
Color spriteColor = sprite == item.Sprite ? item.GetSpriteColor() : item.GetInventoryIconColor(); Color spriteColor = sprite == item.Sprite ? item.GetSpriteColor() : item.GetInventoryIconColor();
if (inventory != null && inventory.Locked) { spriteColor *= 0.5f; }
if (CharacterHealth.OpenHealthWindow != null && !item.UseInHealthInterface) if (CharacterHealth.OpenHealthWindow != null && !item.UseInHealthInterface)
{ {
spriteColor = Color.Lerp(spriteColor, Color.TransparentBlack, 0.5f); spriteColor = Color.Lerp(spriteColor, Color.TransparentBlack, 0.5f);
@@ -936,10 +931,7 @@ namespace Barotrauma
sprite.Draw(spriteBatch, itemPos, spriteColor, rotation, scale); sprite.Draw(spriteBatch, itemPos, spriteColor, rotation, scale);
} }
if (inventory != null && if (inventory != null && Character.Controlled?.Inventory == inventory && slot.QuickUseKey != Keys.None)
!inventory.Locked &&
Character.Controlled?.Inventory == inventory &&
slot.QuickUseKey != Keys.None)
{ {
GUI.DrawString(spriteBatch, rect.Location.ToVector2(), GUI.DrawString(spriteBatch, rect.Location.ToVector2(),
slot.QuickUseKey.ToString().Substring(1, 1), slot.QuickUseKey.ToString().Substring(1, 1),
@@ -1,9 +1,6 @@
using Barotrauma.Extensions; using Barotrauma.Extensions;
using Barotrauma.Lights; using Barotrauma.Lights;
using Barotrauma.Networking; using Barotrauma.Networking;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Dynamics.Contacts;
using Lidgren.Network; using Lidgren.Network;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
@@ -168,20 +165,6 @@ namespace Barotrauma
{ {
Vector2 pos = ConvertUnits.ToDisplayUnits(f2.Body.Position); Vector2 pos = ConvertUnits.ToDisplayUnits(f2.Body.Position);
int section = FindSectionIndex(pos);
if (section > -1)
{
Vector2 normal = contact.Manifold.LocalNormal;
float impact = Vector2.Dot(f2.Body.LinearVelocity, -normal) * f2.Body.Mass * 0.1f;
if (impact > 10.0f)
{
SoundPlayer.PlayDamageSound("StructureBlunt", impact, SectionPosition(section, true), tags: Tags);
}
}
}
}
public override bool IsVisible(Rectangle worldView) public override bool IsVisible(Rectangle worldView)
{ {
Rectangle worldRect = WorldRect; Rectangle worldRect = WorldRect;
@@ -238,7 +238,7 @@ namespace Barotrauma
} }
float ambienceVolume = 0.8f; float ambienceVolume = 0.8f;
if (Character.Controlled != null && !Character.Controlled.Removed) if (Character.Controlled != null)
{ {
AnimController animController = Character.Controlled.AnimController; AnimController animController = Character.Controlled.AnimController;
if (animController.HeadInWater) if (animController.HeadInWater)
@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.8.10.0")] [assembly: AssemblyVersion("0.8.10.0")]
[assembly: AssemblyFileVersion("0.8.10.0")] [assembly: AssemblyFileVersion("0.8.0.0")]
+1 -1
View File
@@ -216,7 +216,7 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'DebugLinux|x64'"> <ItemGroup Condition="$(Configuration.EndsWith('Linux'))">
<None Include="Launch_BarotraumaServer"> <None Include="Launch_BarotraumaServer">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
@@ -1062,6 +1062,8 @@ namespace Barotrauma
private bool IsProperlyLatchedOnSub => LatchOntoAI != null && LatchOntoAI.IsAttachedToSub && SelectedAiTarget?.Entity == wallTarget?.Structure; private bool IsProperlyLatchedOnSub => LatchOntoAI != null && LatchOntoAI.IsAttachedToSub && SelectedAiTarget?.Entity == wallTarget?.Structure;
private bool IsProperlyLatchedOnSub => LatchOntoAI != null && LatchOntoAI.IsAttachedToSub && SelectedAiTarget?.Entity == wallTarget?.Structure;
//goes through all the AItargets, evaluates how preferable it is to attack the target, //goes through all the AItargets, evaluates how preferable it is to attack the target,
//whether the Character can see/hear the target and chooses the most preferable target within //whether the Character can see/hear the target and chooses the most preferable target within
//sight/hearing range //sight/hearing range
@@ -223,10 +223,8 @@ namespace Barotrauma
} }
} }
bool isDiving = character.AnimController.InWater && character.AnimController.HeadInWater;
//only humanoids can climb ladders //only humanoids can climb ladders
if (!isDiving && character.AnimController is HumanoidAnimController && IsNextLadderSameAsCurrent) if (!character.AnimController.InWater && character.AnimController is HumanoidAnimController && IsNextLadderSameAsCurrent)
{ {
if (character.SelectedConstruction != currentPath.CurrentNode.Ladders.Item && if (character.SelectedConstruction != currentPath.CurrentNode.Ladders.Item &&
currentPath.CurrentNode.Ladders.Item.IsInsideTrigger(character.WorldPosition)) currentPath.CurrentNode.Ladders.Item.IsInsideTrigger(character.WorldPosition))
@@ -236,7 +234,7 @@ namespace Barotrauma
} }
var collider = character.AnimController.Collider; var collider = character.AnimController.Collider;
if (character.IsClimbing && !isDiving) if (character.IsClimbing && !character.AnimController.InWater)
{ {
Vector2 diff = currentPath.CurrentNode.SimPosition - pos; Vector2 diff = currentPath.CurrentNode.SimPosition - pos;
bool nextLadderSameAsCurrent = IsNextLadderSameAsCurrent; bool nextLadderSameAsCurrent = IsNextLadderSameAsCurrent;
@@ -281,7 +279,7 @@ namespace Barotrauma
else if (character.AnimController.InWater) else if (character.AnimController.InWater)
{ {
// If the character is underwater, we don't need the ladders anymore // If the character is underwater, we don't need the ladders anymore
if (character.IsClimbing && isDiving) if (character.IsClimbing)
{ {
character.AnimController.Anim = AnimController.Animation.None; character.AnimController.Anim = AnimController.Animation.None;
character.SelectedConstruction = null; character.SelectedConstruction = null;
@@ -560,8 +560,7 @@ namespace Barotrauma
//TODO: take into account that the feet aren't necessarily in CurrentHull //TODO: take into account that the feet aren't necessarily in CurrentHull
//full slowdown (1.5f) when water is up to the torso //full slowdown (1.5f) when water is up to the torso
surfaceY = ConvertUnits.ToSimUnits(currentHull.Surface); surfaceY = ConvertUnits.ToSimUnits(currentHull.Surface);
float bottomPos = Math.Max(colliderPos.Y, currentHull.Rect.Y - currentHull.Rect.Height); slowdownAmount = MathHelper.Clamp((surfaceY - colliderPos.Y) / TorsoPosition.Value, 0.0f, 1.0f) * 1.5f;
slowdownAmount = MathHelper.Clamp((surfaceY - bottomPos) / TorsoPosition.Value, 0.0f, 1.0f) * 1.5f;
} }
float maxSpeed = Math.Max(TargetMovement.Length() - slowdownAmount, 1.0f); float maxSpeed = Math.Max(TargetMovement.Length() - slowdownAmount, 1.0f);
@@ -2555,9 +2555,11 @@ namespace Barotrauma
GameMain.GameSession?.CrewManager?.RemoveCharacter(this); GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
#endif #endif
CharacterList.Remove(this); #if CLIENT
GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
#endif
if (Controlled == this) { Controlled = null; } CharacterList.Remove(this);
if (Inventory != null) if (Inventory != null)
{ {
@@ -635,6 +635,24 @@ namespace Barotrauma
var character = ((Limb)f2.Body.UserData).character; var character = ((Limb)f2.Body.UserData).character;
if (character.DisableImpactDamageTimer > 0.0f || ((Limb)f2.Body.UserData).Mass < 100.0f) return true; if (character.DisableImpactDamageTimer > 0.0f || ((Limb)f2.Body.UserData).Mass < 100.0f) return true;
} }
if (!Prefab.Platform && Prefab.StairDirection == Direction.None)
{
Vector2 pos = ConvertUnits.ToDisplayUnits(f2.Body.Position);
int section = FindSectionIndex(pos);
if (section > -1)
{
Vector2 normal = contact.Manifold.LocalNormal;
float impact = Vector2.Dot(f2.Body.LinearVelocity, -normal) * f2.Body.Mass * 0.1f;
if (impact < 10.0f) return true;
#if CLIENT
SoundPlayer.PlayDamageSound("StructureBlunt", impact, SectionPosition(section, true), tags: Tags);
#endif
AddDamage(section, impact);
}
}
OnImpactProjSpecific(f1, f2, contact); OnImpactProjSpecific(f1, f2, contact);
@@ -102,7 +102,7 @@ namespace Barotrauma
{ {
string errorMsg = "Attempted to add a null item to entity spawn queue.\n" + Environment.StackTrace; string errorMsg = "Attempted to add a null item to entity spawn queue.\n" + Environment.StackTrace;
DebugConsole.ThrowError(errorMsg); DebugConsole.ThrowError(errorMsg);
GameAnalyticsManager.AddErrorEventOnce("EntitySpawner.AddToSpawnQueue1:ItemPrefabNull", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg); GameAnalyticsManager.AddErrorEventOnce("EntitySpawner.AddToSpawnQueue3:ItemPrefabNull", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
return; return;
} }
spawnQueue.Enqueue(new ItemSpawnInfo(itemPrefab, worldPosition, condition)); spawnQueue.Enqueue(new ItemSpawnInfo(itemPrefab, worldPosition, condition));
@@ -115,7 +115,7 @@ namespace Barotrauma
{ {
string errorMsg = "Attempted to add a null item to entity spawn queue.\n" + Environment.StackTrace; string errorMsg = "Attempted to add a null item to entity spawn queue.\n" + Environment.StackTrace;
DebugConsole.ThrowError(errorMsg); DebugConsole.ThrowError(errorMsg);
GameAnalyticsManager.AddErrorEventOnce("EntitySpawner.AddToSpawnQueue2:ItemPrefabNull", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg); GameAnalyticsManager.AddErrorEventOnce("EntitySpawner.AddToSpawnQueue3:ItemPrefabNull", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
return; return;
} }
spawnQueue.Enqueue(new ItemSpawnInfo(itemPrefab, position, sub, condition)); spawnQueue.Enqueue(new ItemSpawnInfo(itemPrefab, position, sub, condition));
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.