LeviLamina
Loading...
Searching...
No Matches
ItemStackNetManagerServer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/util/CallbackToken.h"
8#include "mc/util/CallbackTokenContext.h"
9#include "mc/world/inventory/network/ItemStackNetManagerBase.h"
10#include "mc/world/inventory/network/TypedClientNetId.h"
11#include "mc/world/level/Tick.h"
12
13// auto generated forward declare list
14// clang-format off
20class ServerPlayer;
24struct LegacySetSlot;
25// clang-format on
26
27class ItemStackNetManagerServer : public ::ItemStackNetManagerBase {
28public:
29 // ItemStackNetManagerServer inner types define
30 enum class TextFilterState : int {
31 None = 0,
32 Waiting = 1,
33 Timedout = 2,
34 };
35
36 using RetainScope = ::gsl::final_action<::std::function<void()>>;
37
38public:
39 // member variables
40 // NOLINTBEGIN
41 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackRequestActionHandler>> mRequestActionHandler;
42 ::ll::TypedStorage<1, 1, bool> mRetainSetItemStackNetIdVariants;
43 ::ll::TypedStorage<4, 4, ::ItemStackNetManagerServer::TextFilterState> mTextFilterState;
44 ::ll::TypedStorage<
45 8,
46 40,
47 ::std::
48 queue<::std::unique_ptr<::ItemStackRequestData>, ::std::deque<::std::unique_ptr<::ItemStackRequestData>>>>
49 mRequestsQueue;
50 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::TextFilteringProcessor>> mTextFilteringProcessor;
51 ::ll::TypedStorage<8, 8, ::Tick> mTextFilterRequestTimer;
52 ::ll::TypedStorage<8, 8, ::Tick const> mTextFilterRequestTimeout;
53 ::ll::TypedStorage<8, 16, ::CallbackToken> mTextFilterRequestToken;
54 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CallbackTokenContext<::std::function<void()>>>>
55 mOnContainerScreenCloseCB;
56 // NOLINTEND
57
58public:
59 // prevent constructor by default
60 ItemStackNetManagerServer();
61
62public:
63 // virtual functions
64 // NOLINTBEGIN
65 virtual ~ItemStackNetManagerServer() /*override*/ = default;
66
67 virtual ::ItemStackRequestId getRequestId() const /*override*/;
68
69 virtual bool retainSetItemStackNetIdVariant() const /*override*/;
70
71 virtual bool allowInventoryTransactionManager() const /*override*/;
72
73 virtual void onContainerScreenOpen(::ContainerScreenContext const& screenContext) /*override*/;
74
75 virtual void _initScreen(::ItemStackNetManagerScreen& screen) /*override*/;
76 // NOLINTEND
77
78public:
79 // member functions
80 // NOLINTBEGIN
81 MCAPI ItemStackNetManagerServer(::ServerPlayer& serverPlayer, bool isEnabled);
82
83 MCAPI void _handleLegacyTransactionRequest(
84 ::ItemStackLegacyRequestId const& legacyClientRequestId,
85 ::std::vector<::LegacySetSlot> const& legacySetItemSlots
86 );
87
88 MCAPI void _processQueue();
89
90 MCAPI void _queueRequest(::std::unique_ptr<::ItemStackRequestData> request);
91
92#ifdef LL_PLAT_S
93 MCAPI void _setTextFilterState(::ItemStackNetManagerServer::TextFilterState state);
94#endif
95
96 MCAPI void handleRequest(
97 ::std::unique_ptr<::ItemStackRequestData> request,
99 );
100
101 MCAPI void handleRequestBatch(
102 ::ItemStackRequestBatch const& requestBatch,
104 );
105
106 MCAPI void normalTick();
107
108 MCAPI ::CallbackToken tryCloseContainerScreen(::std::function<void()> onContainerScreenCloseCB);
109 // NOLINTEND
110
111public:
112 // constructor thunks
113 // NOLINTBEGIN
114 MCAPI void* $ctor(::ServerPlayer& serverPlayer, bool isEnabled);
115 // NOLINTEND
116
117public:
118 // virtual function thunks
119 // NOLINTBEGIN
120 MCAPI ::ItemStackRequestId $getRequestId() const;
121
122 MCAPI bool $retainSetItemStackNetIdVariant() const;
123
124 MCAPI bool $allowInventoryTransactionManager() const;
125
126 MCAPI void $onContainerScreenOpen(::ContainerScreenContext const& screenContext);
127
128 MCAPI void $_initScreen(::ItemStackNetManagerScreen& screen);
129
130
131 // NOLINTEND
132
133public:
134 // vftables
135 // NOLINTBEGIN
136 MCAPI static void** $vftable();
137 // NOLINTEND
138};
Definition NonOwnerPointer.h:9
Definition CallbackTokenContext.h:6
Definition ContainerScreenContext.h:16
Definition ItemStackNetManagerScreen.h:9
Definition ItemStackRequestActionHandler.h:42
Definition ItemStackRequestBatch.h:11
Definition ItemStackRequestData.h:15
Definition ServerPlayer.h:73
Definition TextFilteringProcessor.h:19
Definition ItemStackLegacyRequestIdTag.h:5
Definition ItemStackRequestIdTag.h:5
Definition LegacySetSlot.h:8