Add support for client-side replays (#17168)
This commit is contained in:
@@ -65,7 +65,6 @@ public sealed class PlayGlobalSoundCommand : IConsoleCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO REPLAYS uhhh.. what to do with this?
|
||||
replay = false;
|
||||
|
||||
filter = Filter.Empty();
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace Content.Server.Chat.Managers
|
||||
if ((channel & ChatChannel.AdminRelated) == 0 ||
|
||||
_configurationManager.GetCVar(CCVars.ReplayRecordAdminChat))
|
||||
{
|
||||
_replay.QueueReplayMessage(msg);
|
||||
_replay.RecordServerMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace Content.Server.Chat.Managers
|
||||
if ((channel & ChatChannel.AdminRelated) == 0 ||
|
||||
_configurationManager.GetCVar(CCVars.ReplayRecordAdminChat))
|
||||
{
|
||||
_replay.QueueReplayMessage(msg);
|
||||
_replay.RecordServerMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace Content.Server.Chat.Managers
|
||||
if ((channel & ChatChannel.AdminRelated) == 0 ||
|
||||
_configurationManager.GetCVar(CCVars.ReplayRecordAdminChat))
|
||||
{
|
||||
_replay.QueueReplayMessage(msg);
|
||||
_replay.RecordServerMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
_chatManager.ChatMessageToOne(ChatChannel.Whisper, obfuscatedMessage, wrappedobfuscatedMessage, source, false, session.ConnectedClient);
|
||||
}
|
||||
|
||||
_replay.QueueReplayMessage(new ChatMessage(ChatChannel.Whisper, message, wrappedMessage, source, MessageRangeHideChatForReplay(range)));
|
||||
_replay.RecordServerMessage(new ChatMessage(ChatChannel.Whisper, message, wrappedMessage, source, MessageRangeHideChatForReplay(range)));
|
||||
|
||||
var ev = new EntitySpokeEvent(source, message, channel, obfuscatedMessage);
|
||||
RaiseLocalEvent(source, ev, true);
|
||||
@@ -548,7 +548,7 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
_chatManager.ChatMessageToOne(channel, message, wrappedMessage, source, entHideChat, session.ConnectedClient);
|
||||
}
|
||||
|
||||
_replay.QueueReplayMessage(new ChatMessage(channel, message, wrappedMessage, source, MessageRangeHideChatForReplay(range)));
|
||||
_replay.RecordServerMessage(new ChatMessage(channel, message, wrappedMessage, source, MessageRangeHideChatForReplay(range)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -25,7 +25,7 @@ public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem
|
||||
// when player poses entity we want to make sure that there is typing indicator
|
||||
EnsureComp<TypingIndicatorComponent>(ev.Entity);
|
||||
// we also need appearance component to sync visual state
|
||||
EnsureComp<ServerAppearanceComponent>(ev.Entity);
|
||||
EnsureComp<AppearanceComponent>(ev.Entity);
|
||||
}
|
||||
|
||||
private void OnPlayerDetached(EntityUid uid, TypingIndicatorComponent component, PlayerDetachedEvent args)
|
||||
|
||||
@@ -50,7 +50,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
// restricted to something like the same map, but whatever.
|
||||
_pvsSys.AddGlobalOverride(explosionEntity);
|
||||
|
||||
var appearance = AddComp<ServerAppearanceComponent>(explosionEntity);
|
||||
var appearance = AddComp<AppearanceComponent>(explosionEntity);
|
||||
_appearance.SetData(explosionEntity, ExplosionAppearanceData.Progress, 1, appearance);
|
||||
|
||||
return explosionEntity;
|
||||
|
||||
@@ -4,7 +4,6 @@ using Content.Server.Ghost;
|
||||
using Content.Server.Maps;
|
||||
using Content.Server.Mind;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Preferences;
|
||||
using JetBrains.Annotations;
|
||||
@@ -18,7 +17,6 @@ using Robust.Shared.Player;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Shared.Database;
|
||||
using Robust.Shared.Asynchronous;
|
||||
|
||||
@@ -66,9 +64,6 @@ namespace Content.Server.GameTicking
|
||||
}
|
||||
}
|
||||
|
||||
[ViewVariables]
|
||||
public int RoundId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the round's map is eligible to be updated.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Chat;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Database;
|
||||
@@ -14,23 +13,17 @@ using Content.Server.Station.Systems;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Roles;
|
||||
using Robust.Server;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
#if EXCEPTION_TOLERANCE
|
||||
using Robust.Shared.Exceptions;
|
||||
#endif
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Replays;
|
||||
using Robust.Shared.Serialization.Markdown.Mapping;
|
||||
using Robust.Shared.Serialization.Markdown.Value;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -68,7 +61,6 @@ namespace Content.Server.GameTicking
|
||||
DebugTools.Assert(_prototypeManager.Index<JobPrototype>(FallbackOverflowJob).Name == FallbackOverflowJobName,
|
||||
"Overflow role does not have the correct name!");
|
||||
InitializeGameRules();
|
||||
_replay.OnRecordingStarted += OnRecordingStart;
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
@@ -88,12 +80,6 @@ namespace Content.Server.GameTicking
|
||||
base.Shutdown();
|
||||
|
||||
ShutdownGameRules();
|
||||
_replay.OnRecordingStarted -= OnRecordingStart;
|
||||
}
|
||||
|
||||
private void OnRecordingStart((MappingDataNode, List<object>) data)
|
||||
{
|
||||
data.Item1["roundId"] = new ValueDataNode(RoundId.ToString());
|
||||
}
|
||||
|
||||
private void SendServerMessage(string message)
|
||||
@@ -123,7 +109,6 @@ namespace Content.Server.GameTicking
|
||||
#if EXCEPTION_TOLERANCE
|
||||
[Dependency] private readonly IRuntimeLog _runtimeLog = default!;
|
||||
#endif
|
||||
[Dependency] private readonly StationSystem _stationSystem = default!;
|
||||
[Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
|
||||
[Dependency] private readonly StationJobsSystem _stationJobs = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
@@ -133,6 +118,5 @@ namespace Content.Server.GameTicking
|
||||
[Dependency] private readonly ServerUpdateManager _serverUpdates = default!;
|
||||
[Dependency] private readonly PlayTimeTrackingSystem _playTimeTrackings = default!;
|
||||
[Dependency] private readonly UserDbDataManager _userDb = default!;
|
||||
[Dependency] private readonly IReplayRecordingManager _replay = default!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Content.Server.Pointing.EntitySystems
|
||||
RaiseNetworkEvent(new PopupEntityEvent(message, PopupType.Small, source), viewerEntity);
|
||||
}
|
||||
|
||||
_replay.QueueReplayMessage(new PopupEntityEvent(viewerMessage, PopupType.Small, source));
|
||||
_replay.RecordServerMessage(new PopupEntityEvent(viewerMessage, PopupType.Small, source));
|
||||
}
|
||||
|
||||
public bool InRange(EntityUid pointer, EntityCoordinates coordinates)
|
||||
|
||||
@@ -122,7 +122,7 @@ public sealed class RadioSystem : EntitySystem
|
||||
else
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Radio message from {ToPrettyString(messageSource):user} on {channel.LocalizedName}: {message}");
|
||||
|
||||
_replay.QueueReplayMessage(chat);
|
||||
_replay.RecordServerMessage(chat);
|
||||
_messages.Remove(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user