Misc replay related changes (#13250)

This commit is contained in:
Leon Friedrich
2023-01-08 07:04:09 +13:00
committed by GitHub
parent a9adab88e5
commit f1cb0ca37a
11 changed files with 93 additions and 9 deletions

View File

@@ -1,3 +1,6 @@
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Administration;
public interface IGamePrototypeLoadManager
@@ -5,3 +8,12 @@ public interface IGamePrototypeLoadManager
public void Initialize();
public void SendGamePrototype(string prototype);
}
// TODO REPLAYS
// Figure out a way to just directly save NetMessage objects to replays. This just uses IRobustSerializer as a crutch.
[Serializable, NetSerializable]
public sealed class ReplayPrototypeUploadMsg
{
public string PrototypeData = default!;
}

View File

@@ -1,5 +1,6 @@
using Robust.Shared.ContentPack;
using Robust.Shared.Network;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Administration;
@@ -38,4 +39,14 @@ public abstract class SharedNetworkResourceManager : IDisposable
// MemoryContentRoot uses a ReaderWriterLockSlim, which we need to dispose of.
ContentRoot.Dispose();
}
// TODO REPLAYS
// Figure out a way to just directly save NetMessage objects to replays. This just uses IRobustSerializer as a crutch.
[Serializable, NetSerializable]
public sealed class ReplayResourceUploadMsg
{
public byte[] Data = default!;
public ResourcePath RelativePath = default!;
}
}

View File

@@ -77,6 +77,9 @@ public abstract partial class SharedHandsSystem : EntitySystem
if (!TryComp(session?.AttachedEntity, out SharedHandsComponent? component))
return;
if (!_actionBlocker.CanInteract(session.AttachedEntity.Value, null))
return;
if (component.ActiveHand == null || component.Hands.Count < 2)
return;

View File

@@ -32,7 +32,7 @@ namespace Content.Shared.Projectiles
}
[NetSerializable, Serializable]
protected sealed class ProjectileComponentState : ComponentState
public sealed class ProjectileComponentState : ComponentState
{
public ProjectileComponentState(EntityUid shooter, bool ignoreShooter)
{
@@ -45,7 +45,7 @@ namespace Content.Shared.Projectiles
}
[Serializable, NetSerializable]
protected sealed class ImpactEffectEvent : EntityEventArgs
public sealed class ImpactEffectEvent : EntityEventArgs
{
public string Prototype;
public EntityCoordinates Coordinates;

View File

@@ -7,6 +7,12 @@ public abstract class SharedTimedDespawnSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
public override void Initialize()
{
base.Initialize();
UpdatesOutsidePrediction = true;
}
public override void Update(float frameTime)
{
base.Update(frameTime);

View File

@@ -404,7 +404,7 @@ public abstract partial class SharedGunSystem : EntitySystem
/// Used for animated effects on the client.
/// </summary>
[Serializable, NetSerializable]
protected sealed class HitscanEvent : EntityEventArgs
public sealed class HitscanEvent : EntityEventArgs
{
public List<(EntityCoordinates coordinates, Angle angle, SpriteSpecifier Sprite, float Distance)> Sprites = new();
}