LeviLamina
Loading...
Searching...
No Matches
ReplayStateComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/entity/components/ReplayCorrectionResult.h"
7#include "mc/entity/utilities/AdvanceFrameResult.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class ActorHistory;
13class EntityContext;
19// clang-format on
20
21class ReplayStateComponent {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<1, 1, bool> mForceCorrection;
26 ::ll::TypedStorage<1, 1, bool> mShouldReportNextCorrectionTelemetry;
27 ::ll::TypedStorage<1, 1, bool> mIsCorrectionTelemetryEnabled;
28 ::ll::TypedStorage<1, 1, uchar> mDivergenceCounter;
29 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ActorHistory>> mHistory;
30 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IReplayStatePolicy>> mPolicy;
31 ::ll::TypedStorage<8, 8, uint64> mCurrentTick;
32 // NOLINTEND
33
34public:
35 // prevent constructor by default
36 ReplayStateComponent& operator=(ReplayStateComponent const&);
37 ReplayStateComponent(ReplayStateComponent const&);
38 ReplayStateComponent();
39
40public:
41 // member functions
42 // NOLINTBEGIN
43 MCAPI ReplayStateComponent(::ReplayStateComponent&& rhs);
44
45 MCAPI
46 ReplayStateComponent(::std::unique_ptr<::ActorHistory> history, ::std::unique_ptr<::IReplayStatePolicy> policy);
47
48 MCAPI ::AdvanceFrameResult _applyCorrection(
49 ::std::shared_ptr<::IMovementCorrection> correction,
50 ::Actor& actor,
51 uint64 destinationTimestamp,
52 bool addInput
53 ) const;
54
55#ifdef LL_PLAT_C
56 MCFOLD ::ActorHistory const* _getHistory() const;
57
58 MCAPI bool _shouldReportCorrectionTelemetry() const;
59#endif
60
61 MCAPI void addCorrectionToCurrentFrame(::std::shared_ptr<::IMovementCorrection> correction) const;
62
63#ifdef LL_PLAT_C
64 MCAPI void advanceHistory(::EntityContext* entity);
65#endif
66
67 MCFOLD void advanceTick(uint64 currentTick);
68
69 MCAPI ::ReplayCorrectionResult
70 applyFrameCorrection(::Actor& actor, ::std::shared_ptr<::IMovementCorrection> correction, uint64 frame);
71
72 MCAPI void clearHistory();
73
74#ifdef LL_PLAT_C
75 MCAPI void disableNextCorrectionTelemetry();
76#endif
77
78 MCAPI ::IReplayableActorInput* getCurrentCapturedInput();
79
80 MCFOLD uint64 getCurrentTick() const;
81
82 MCAPI ::IReplayableActorInput* getOrCreateNextCapturedInput();
83
84#ifdef LL_PLAT_C
85 MCAPI ::std::optional<uint64> handleAdvanceAndRewind(::Actor& actor);
86#endif
87
88 MCAPI void notifyOfExternalCorrection() const;
89
90 MCAPI ::ReplayStateComponent& operator=(::ReplayStateComponent&&);
91
92 MCAPI ::MovementCorrection shouldSendCorrectionToClient(
93 ::EntityContext& entity,
94 ::PlayerAuthInputPacket const& packet,
95 bool isStrictMovement
96 ) const;
97
98 MCAPI ~ReplayStateComponent();
99 // NOLINTEND
100
101public:
102 // constructor thunks
103 // NOLINTBEGIN
104 MCAPI void* $ctor(::ReplayStateComponent&& rhs);
105
106 MCAPI void* $ctor(::std::unique_ptr<::ActorHistory> history, ::std::unique_ptr<::IReplayStatePolicy> policy);
107 // NOLINTEND
108
109public:
110 // destructor thunk
111 // NOLINTBEGIN
112 MCAPI void $dtor();
113 // NOLINTEND
114};
Definition ActorHistory.h:16
Definition Actor.h:125
Definition EntityContext.h:17
Definition PlayerAuthInputPacket.h:27
Definition IMovementCorrection.h:15
Definition IReplayStatePolicy.h:15
Definition IReplayableActorInput.h:29
Definition MovementCorrection.h:9