mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-06-09 10:06:34 +02:00
83c2a1be11
* [Dependency] source generator No more reflection, no more codegen at runtime Also various changes to Roslyn helpers to make this easier to write. Requires all types with dependencies to be partial and not have readonly dependency fields. An analyzer enforces this at warning level, the previous injection strategies have remained in the code *for now* as a fallback. No fallback is available for [field: Dependency] properties, due to a Roslyn bug. Code Fixes exist. We love Roslyn * Apply dependencies generator changes to all code * Release notes * Preprocessor got hands * Handle nullable dependencies These are bad but gotta deal with it. * Apply suggestions from code review Co-authored-by: Moony <moony@hellomouse.net> * Fine, let's not use collection expressions --------- Co-authored-by: Moony <moony@hellomouse.net>
57 lines
2.3 KiB
C#
57 lines
2.3 KiB
C#
using Robust.Client.GameStates;
|
|
using Robust.Client.Replays.Playback;
|
|
using Robust.Client.Serialization;
|
|
using Robust.Client.Timing;
|
|
using Robust.Client.Upload;
|
|
using Robust.Shared;
|
|
using Robust.Shared.Network;
|
|
using Robust.Shared.Configuration;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Localization;
|
|
using Robust.Shared.Log;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Replays;
|
|
|
|
namespace Robust.Client.Replays.Loading;
|
|
|
|
public sealed partial class ReplayLoadManager : IReplayLoadManager
|
|
{
|
|
[Dependency] private ILogManager _logMan = default!;
|
|
[Dependency] private IBaseClient _client = default!;
|
|
[Dependency] private EntityManager _entMan = default!;
|
|
[Dependency] private IClientGameTiming _timing = default!;
|
|
[Dependency] private IComponentFactory _factory = default!;
|
|
[Dependency] private IPrototypeManager _protoMan = default!;
|
|
[Dependency] private ILocalizationManager _locMan = default!;
|
|
[Dependency] private IConfigurationManager _confMan = default!;
|
|
[Dependency] private NetworkResourceManager _netResMan = default!;
|
|
[Dependency] private IClientGameStateManager _gameState = default!;
|
|
[Dependency] private IClientRobustSerializer _serializer = default!;
|
|
[Dependency] private IReplayPlaybackManager _replayPlayback = default!;
|
|
|
|
private ushort _metaId;
|
|
private bool _initialized;
|
|
private int _checkpointInterval;
|
|
private int _checkpointMinInterval;
|
|
private int _checkpointEntitySpawnThreshold;
|
|
private int _checkpointEntityStateThreshold;
|
|
private ISawmill _sawmill = default!;
|
|
|
|
public void Initialize()
|
|
{
|
|
if (_initialized)
|
|
return;
|
|
|
|
_initialized = true;
|
|
_confMan.OnValueChanged(CVars.CheckpointInterval, value => _checkpointInterval = value, true);
|
|
_confMan.OnValueChanged(CVars.CheckpointMinInterval, value => _checkpointMinInterval = value, true);
|
|
_confMan.OnValueChanged(CVars.CheckpointEntitySpawnThreshold, value => _checkpointEntitySpawnThreshold = value,
|
|
true);
|
|
_confMan.OnValueChanged(CVars.CheckpointEntityStateThreshold, value => _checkpointEntityStateThreshold = value,
|
|
true);
|
|
_metaId = _factory.GetRegistration(typeof(MetaDataComponent)).NetID!.Value;
|
|
_sawmill = _logMan.GetSawmill("replay");
|
|
}
|
|
}
|