Merge remote-tracking branch 'upstream/master' into 20-11-19-sandboxing

This commit is contained in:
Pieter-Jan Briers
2020-11-24 08:39:05 +01:00
3195 changed files with 17920 additions and 17354 deletions

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<!-- Work around https://github.com/dotnet/project-system/issues/4314 -->
<TargetFramework>$(TargetFramework)</TargetFramework>
<LangVersion>8</LangVersion>
<LangVersion>9</LangVersion>
<IsPackable>false</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>../bin/Content.Shared</OutputPath>

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using Content.Shared.Objectives;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Actor
{
public class SharedCharacterInfoComponent : Component
{
public override string Name => "CharacterInfo";
public override uint? NetID => ContentNetIDs.CHARACTERINFO;
[Serializable, NetSerializable]
protected class RequestCharacterInfoMessage : ComponentMessage
{
public RequestCharacterInfoMessage()
{
Directed = true;
}
}
[Serializable, NetSerializable]
protected class CharacterInfoMessage : ComponentMessage
{
public readonly Dictionary<string, List<ConditionInfo>> Objectives;
public readonly string JobTitle;
public CharacterInfoMessage(string jobTitle, Dictionary<string, List<ConditionInfo>> objectives)
{
Directed = true;
JobTitle = jobTitle;
Objectives = objectives;
}
}
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
@@ -59,7 +59,9 @@ namespace Content.Shared.GameObjects.Components
public bool BreakOnTargetMove { get; }
public ClientDoAfter(byte id, EntityCoordinates userGrid, EntityCoordinates targetGrid, TimeSpan startTime, float delay, bool breakOnUserMove, bool breakOnTargetMove, EntityUid targetUid = default)
public float MovementThreshold { get; }
public ClientDoAfter(byte id, EntityCoordinates userGrid, EntityCoordinates targetGrid, TimeSpan startTime, float delay, bool breakOnUserMove, bool breakOnTargetMove, float movementThreshold, EntityUid targetUid = default)
{
ID = id;
UserGrid = userGrid;
@@ -68,6 +70,7 @@ namespace Content.Shared.GameObjects.Components
Delay = delay;
BreakOnUserMove = breakOnUserMove;
BreakOnTargetMove = breakOnTargetMove;
MovementThreshold = movementThreshold;
TargetUid = targetUid;
}
}

View File

@@ -84,6 +84,7 @@
public const uint PULLABLE = 1078;
public const uint GAS_TANK = 1079;
public const uint SINGULARITY = 1080;
public const uint CHARACTERINFO = 1081;
// Net IDs for integration tests.
public const uint PREDICTION_TEST = 10001;

View File

@@ -49,7 +49,8 @@ namespace Content.Shared.GameObjects.EntitySystems
base.Shutdown();
}
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, IPhysicsComponent physics)
//TODO: reorganize this to make more logical sense
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, IPhysicsComponent physics)
{
physics.EnsureController<MoverController>();
@@ -70,14 +71,14 @@ namespace Content.Shared.GameObjects.EntitySystems
// TODO: movement check.
var (walkDir, sprintDir) = mover.VelocityDir;
var combined = walkDir + sprintDir;
if (combined.LengthSquared < 0.001 || !ActionBlockerSystem.CanMove(mover.Owner) && !weightless)
if (combined.LengthSquared < 0.001 || !ActionBlockerSystem.CanMove(mover.Owner) && !weightless)
{
if (physics.TryGetController(out MoverController controller))
{
controller.StopMoving();
}
}
else
else if (ActionBlockerSystem.CanMove(mover.Owner))
{
if (weightless)
{

View File

@@ -0,0 +1,23 @@
using System;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Objectives
{
[Serializable, NetSerializable]
public class ConditionInfo
{
public string Title { get; }
public string Description { get; }
public SpriteSpecifier SpriteSpecifier { get; }
public float Progress { get; }
public ConditionInfo(string title, string description, SpriteSpecifier spriteSpecifier, float progress)
{
Title = title;
Description = description;
SpriteSpecifier = spriteSpecifier;
Progress = progress;
}
}
}