mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Add support for client-side replays (#4122)
This commit is contained in:
@@ -10,6 +10,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Network.Messages;
|
||||
using Robust.Shared.Replays;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Client.GameObjects
|
||||
@@ -24,6 +25,7 @@ namespace Robust.Client.GameObjects
|
||||
[Dependency] private readonly IClientGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IClientGameStateManager _stateMan = default!;
|
||||
[Dependency] private readonly IBaseClient _client = default!;
|
||||
[Dependency] private readonly IReplayRecordingManager _replayRecording = default!;
|
||||
|
||||
protected override int NextEntityUid { get; set; } = EntityUid.ClientUid + 1;
|
||||
|
||||
@@ -184,6 +186,12 @@ namespace Robust.Client.GameObjects
|
||||
switch (message.Type)
|
||||
{
|
||||
case EntityMessageType.SystemMessage:
|
||||
|
||||
// TODO REPLAYS handle late messages.
|
||||
// If a message was received late, it will be recorded late here.
|
||||
// Maybe process the replay to prevent late messages when playing back?
|
||||
_replayRecording.RecordReplayMessage(message.SystemMessage);
|
||||
|
||||
DispatchReceivedNetworkMsg(message.SystemMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user