LeviLamina
Loading...
Searching...
No Matches
ItemStackNetManagerClient.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/game_refs/WeakRef.h"
7#include "mc/deps/shared_types/legacy/ContainerType.h"
8#include "mc/world/containers/ContainerEnumName.h"
9#include "mc/world/inventory/ContainerWeakRef.h"
10#include "mc/world/inventory/network/ItemStackNetManagerBase.h"
11#include "mc/world/inventory/network/ItemStackRequestScreen.h"
12#include "mc/world/inventory/network/TypedClientNetId.h"
13#include "mc/world/inventory/simulation/SparseContainerBackingSetType.h"
14
15// auto generated forward declare list
16// clang-format off
17class BlockSource;
19class Container;
20class ContainerModel;
21class EntityContext;
24class ItemStack;
29class SparseContainer;
36// clang-format on
37
38class ItemStackNetManagerClient : public ::ItemStackNetManagerBase {
39public:
40 // ItemStackNetManagerClient inner types declare
41 // clang-format off
44 struct ClientScreenData;
46 // clang-format on
47
48 // ItemStackNetManagerClient inner types define
49 struct PredictiveContainer {
50 public:
51 // member variables
52 // NOLINTBEGIN
53 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::SparseContainerClient>> mSparseContainer;
54 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ItemStackRequestId, ::std::vector<::HistoricPredictionData>>>
55 mHistoricPredictions;
56 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ItemStackRequestId, ::std::vector<::HistoricPredictionData>>>
57 mZeroedOutItems;
58 // NOLINTEND
59
60#ifdef LL_PLAT_S
61#else // LL_PLAT_C
62 public:
63 // prevent constructor by default
64 PredictiveContainer();
65
66#endif
67 public:
68 // virtual functions
69 // NOLINTBEGIN
70 virtual ~PredictiveContainer() = default;
71 // NOLINTEND
72
73 public:
74 // member functions
75 // NOLINTBEGIN
76#ifdef LL_PLAT_C
77 MCNAPI PredictiveContainer(
78 ::Container& backingContainer,
79 ::SparseContainerBackingSetType backingSetType,
80 bool isItemStackNetManagerEnabled,
81 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
82 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
83 );
84#endif
85 // NOLINTEND
86
87 public:
88 // constructor thunks
89 // NOLINTBEGIN
90#ifdef LL_PLAT_C
91 MCNAPI void* $ctor(
92 ::Container& backingContainer,
93 ::SparseContainerBackingSetType backingSetType,
94 bool isItemStackNetManagerEnabled,
95 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
96 ::std::unique_ptr<::IPlayerContainerSetter> playerContainerSetter
97 );
98#endif
99 // NOLINTEND
100
101 public:
102 // vftables
103 // NOLINTBEGIN
104 MCNAPI static void** $vftable();
105 // NOLINTEND
106 };
107
109 public:
110 // member variables
111 // NOLINTBEGIN
112 ::ll::TypedStorage<8, 48, ::ContainerWeakRef> mContainerWeakRef;
113 ::ll::TypedStorage<8, 8, ::ItemStackNetManagerClient::PredictiveContainer*> mContainer;
114 // NOLINTEND
115
116 public:
117 // member functions
118 // NOLINTBEGIN
119#ifdef LL_PLAT_C
121#endif
122 // NOLINTEND
123
124 public:
125 // destructor thunk
126 // NOLINTBEGIN
127#ifdef LL_PLAT_C
128 MCNAPI void $dtor();
129#endif
130 // NOLINTEND
131 };
132
133 struct ClientScreenData {
134 public:
135 // member variables
136 // NOLINTBEGIN
137 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContainerEnumName, ::std::unordered_set<uchar>>>
138 mLegacyTransactionSetItemSlots;
139 ::ll::TypedStorage<
140 8,
141 64,
142 ::std::
143 unordered_map<::ItemStackRequestId, ::std::vector<::ItemStackNetManagerClient::PredictiveContainer*>>>
144 mRequestContainers;
145 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ClientScratchContainer>>> mClientScratchContainers;
146 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ItemStackNetManagerClient::PredictiveContainer>>>
147 mPlayerOwnedPredictiveContainers;
148 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::ItemStackNetManagerClient::PredictiveContainer>>>
149 mOpenSessionPredictiveContainers;
150 ::ll::TypedStorage<
151 8,
152 64,
153 ::std::unordered_map<::FullContainerName, ::ItemStackNetManagerClient::OpenSessionContainerData>>
154 mOpenSessionContainerMap;
155 ::ll::TypedStorage<
156 8,
157 64,
158 ::std::unordered_map<::FullContainerName, ::ItemStackNetManagerClient::OpenSessionContainerData>>
159 mHudContainerMap;
160 // NOLINTEND
161
162#ifdef LL_PLAT_S
163#else // LL_PLAT_C
164 public:
165 // prevent constructor by default
166 ClientScreenData& operator=(ClientScreenData const&);
167 ClientScreenData(ClientScreenData const&);
168
169#endif
170 public:
171 // member functions
172 // NOLINTBEGIN
173#ifdef LL_PLAT_C
174 MCNAPI ClientScreenData();
175
176 MCNAPI ClientScreenData(::ItemStackNetManagerClient::ClientScreenData&&);
177
178 MCNAPI ::ItemStackNetManagerClient::ClientScreenData&
180
181 MCNAPI ~ClientScreenData();
182#endif
183 // NOLINTEND
184
185 public:
186 // constructor thunks
187 // NOLINTBEGIN
188#ifdef LL_PLAT_C
189 MCNAPI void* $ctor();
190
192#endif
193 // NOLINTEND
194
195 public:
196 // destructor thunk
197 // NOLINTBEGIN
198#ifdef LL_PLAT_C
199 MCNAPI void $dtor();
200#endif
201 // NOLINTEND
202 };
203
205 public:
206 // member variables
207 // NOLINTBEGIN
208 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerModel>> mOwnedContainer;
209 // NOLINTEND
210
211 public:
212 // virtual functions
213 // NOLINTBEGIN
214 virtual ~OwningPredictiveContainer() /*override*/ = default;
215 // NOLINTEND
216
217 public:
218 // vftables
219 // NOLINTBEGIN
220 MCNAPI static void** $vftable();
221 // NOLINTEND
222 };
223
224public:
225 // member variables
226 // NOLINTBEGIN
227 ::ll::TypedStorage<1, 1, bool> mIsHandlingResponse;
228 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackRequestData>> mRequest;
229 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackRequestBatch>> mRequestBatch;
230 ::ll::TypedStorage<8, 24, ::WeakRef<::EntityContext>> mRequestScreen;
231 // NOLINTEND
232
233public:
234 // virtual functions
235 // NOLINTBEGIN
236 virtual ~ItemStackNetManagerClient() /*override*/ = default;
237
238 virtual ::SparseContainer* initOpenContainer(
239 ::BlockSource& region,
240 ::FullContainerName const& openContainerId,
241 ::ContainerWeakRef const& containerWeakRef
242 ) /*override*/;
243
244 virtual ::ItemStackRequestId getRequestId() const /*override*/;
245
246 virtual bool allowInventoryTransactionManager() const /*override*/;
247
248 virtual ::gsl::final_action<::std::function<void()>> _tryBeginClientLegacyTransactionRequest() /*override*/;
249
250 virtual void _addLegacyTransactionRequestSetItemSlot(
252 ::SharedTypes::Legacy::ContainerType containerType,
253 int slot
254 ) /*override*/;
255
256 virtual void _initScreen(::ItemStackNetManagerScreen& screen) /*override*/;
257 // NOLINTEND
258
259public:
260 // member functions
261 // NOLINTBEGIN
262#ifdef LL_PLAT_C
263 MCNAPI void _beginRequest(::ItemStackRequestScreen screen);
264
265 MCNAPI void _clearPredictiveContainerRequest(
266 ::ItemStackRequestId const& requestId,
268 bool shouldBeEmpty
269 );
270
271 MCNAPI void _endRequest();
272
273 MCNAPI ::std::unique_ptr<::ItemStackRequestData> _endTakeRequest();
274
275 MCNAPI ::std::unordered_map<::ContainerEnumName, ::std::unordered_set<uchar>>
276 _getLegacyTransactionSetItemSlots() const;
277
278 MCNAPI ::ItemStackNetManagerClient::PredictiveContainer* _getPredictiveContainer(::Container* sparseContainer);
279
280 MCNAPI void _initPlayerContainers();
281
282 MCNAPI void _processResponseSlot(
283 ::ItemStackRequestId const& requestId,
285 ::ItemStackResponseSlotInfo const& responseInfo
286 );
287
288 MCNAPI ::ItemStackNetManagerClient::ClientScreenData* _tryGetCurrentClientScreen();
289
290 MCNAPI void addContainerToRequest(::ItemStackRequestId requestId, ::Container* container);
291
292 MCNAPI void addRequestAction(::std::unique_ptr<::ItemStackRequestAction> requestAction);
293
294 MCNAPI void cacheHistoricPrediction(
295 ::Container* container,
296 ::ItemStackRequestId const& requestId,
297 int slot,
298 ::ItemStack&& item
299 );
300
301 MCNAPI void
302 cacheZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot, ::ItemStack&& item);
303
304 MCNAPI void clearZeroedOutItem(::Container* container, ::ItemStackRequestId const& requestId, int slot);
305
306 MCNAPI ::std::unordered_map<::FullContainerName, ::std::shared_ptr<::Container>> getPredictiveContainers();
307
308 MCNAPI void handleItemStackResponse(::std::vector<::ItemStackResponseInfo> const& responses);
309
310 MCNAPI void trySendBatch();
311#endif
312 // NOLINTEND
313
314public:
315 // virtual function thunks
316 // NOLINTBEGIN
317#ifdef LL_PLAT_C
318 MCNAPI ::SparseContainer* $initOpenContainer(
319 ::BlockSource& region,
320 ::FullContainerName const& openContainerId,
321 ::ContainerWeakRef const& containerWeakRef
322 );
323
324 MCNAPI ::ItemStackRequestId $getRequestId() const;
325
326 MCNAPI bool $allowInventoryTransactionManager() const;
327
328 MCNAPI ::gsl::final_action<::std::function<void()>> $_tryBeginClientLegacyTransactionRequest();
329
330 MCNAPI void $_addLegacyTransactionRequestSetItemSlot(
332 ::SharedTypes::Legacy::ContainerType containerType,
333 int slot
334 );
335
336 MCNAPI void $_initScreen(::ItemStackNetManagerScreen& screen);
337#endif
338
339
340 // NOLINTEND
341
342public:
343 // vftables
344 // NOLINTBEGIN
345 MCNAPI static void** $vftable();
346 // NOLINTEND
347};
Definition BlockSource.h:71
Definition ClientScratchContainer.h:13
Definition ContainerModel.h:27
Definition ContainerWeakRef.h:20
Definition Container.h:33
Definition EntityContext.h:16
Definition IPlayerContainerSetter.h:10
Definition ISparseContainerSetListener.h:11
Definition ItemStackNetManagerClient.h:38
static MCAPI void ** $vftable()
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestAction.h:18
Definition ItemStackRequestBatch.h:14
Definition ItemStackRequestData.h:18
Definition ItemStack.h:26
Definition SparseContainerClient.h:24
Definition SparseContainer.h:24
STL namespace.
Definition FullContainerName.h:8
Definition HistoricPredictionData.h:8
Definition ItemStackNetManagerClient.h:133
Definition ItemStackNetManagerClient.h:108
Definition ItemStackNetManagerClient.h:204
Definition ItemStackNetManagerClient.h:49
Definition ItemStackRequestIdTag.h:5
Definition ItemStackResponseInfo.h:15
Definition ItemStackResponseSlotInfo.h:14