LeviLamina
Loading...
Searching...
No Matches
LegacyClientNetworkHandler.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/certificates/identity/PlayerAuthenticationType.h"
7#include "mc/certificates/identity/RawGameServerToken.h"
8#include "mc/client/network/ClientNetworkHandler.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10#include "mc/deps/core/utility/pub_sub/Subscription.h"
11#include "mc/network/NetworkIdentifier.h"
12#include "mc/network/connection/DisconnectFailReason.h"
13#include "mc/platform/brstd/move_only_function.h"
14#include "mc/world/actor/player/SkinMemThresholds.h"
15#include "mc/world/level/LevelListener.h"
16#include "mc/world/level/dimension/DimensionDefinitionGroup.h"
17
18// auto generated forward declare list
19// clang-format off
20class Actor;
21class AddActorPacket;
24class AddPlayerPacket;
25class AnimatePacket;
26class AppPlatform;
27class Block;
30class BlockPos;
40class EntityOverrides;
42class HurtArmorPacket;
43class IBlockSource;
44class ILevel;
52class MobEffectPacket;
63class Player;
77class SetHealthPacket;
78class SetHudPacket;
80class SetTimePacket;
82class StartGamePacket;
90namespace cereal { struct ReflectionCtx; }
91namespace mce { class UUID; }
92// clang-format on
93
95public:
96 // member variables
97 // NOLINTBEGIN
98 ::ll::TypedStorage<8, 16, ::DimensionDefinitionGroup> mDimensionDefinitionGroup;
99 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ILevel>> mMultiPlayerLevel;
100 ::ll::TypedStorage<4, 4, int> mPendingTime;
101 ::ll::TypedStorage<8, 32, ::std::string> mServerIdentifier;
102 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::NetworkChunkInserter>> mChunkInsertQueue;
103 ::ll::TypedStorage<8, 176, ::NetworkIdentifier> mServerGuid;
104 ::ll::TypedStorage<4, 4, ::PlayerAuthenticationType> mPlayerAuthenticationType;
105 ::ll::TypedStorage<8, 32, ::RawGameServerToken> mGameServerToken;
106 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPackSettingChangeSubscriber;
107 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNextChunkRequestDrainTime;
108 ::ll::TypedStorage<8, 16, ::std::shared_ptr<bool>> mExistanceTracker;
109 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IPersonaNetworkHandlerDelegate>> mPersonaNetworkHandlerDelegate;
110 ::ll::TypedStorage<8, 24, ::SkinMemThresholds> mSkinMemThresholds;
111 ::ll::TypedStorage<1, 1, bool> mIsConnectedToApplicationLayer;
112 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::cereal::ReflectionCtx>> mCtx;
113 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EntityOverrides>> mEntityOverrides;
114 ::ll::TypedStorage<
115 8,
116 64,
117 ::brstd::move_only_function<::std::unique_ptr<::MultiPlayerLevel>(::ClientCreateLevelArguments&&) const>>
118 mCreateLevel;
119 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::AppPlatform>> mAppPlatform;
120 // NOLINTEND
121
122public:
123 // prevent constructor by default
124 LegacyClientNetworkHandler();
125
126public:
127 // virtual functions
128 // NOLINTBEGIN
129 virtual ~LegacyClientNetworkHandler() /*override*/;
130
131 virtual void onPlayerReady(::Player& player) /*override*/;
132
133 virtual void onConnect(::NetworkIdentifier const& hostId) /*override*/;
134
135 virtual void onUnableToConnect(
136 ::Connection::DisconnectFailReason discoReason,
137 ::std::string const& messageFromServer,
138 ::std::string const& messageBodyOverride
139 ) /*override*/;
140
141 virtual bool getIsConnectedToApplicationLayer() const /*override*/;
142
143 virtual void handle(::NetworkIdentifier const& source, ::AddActorPacket const& packet) /*override*/;
144
145 virtual void handle(::NetworkIdentifier const& packet, ::AddItemActorPacket const&) /*override*/;
146
147 virtual void handle(::NetworkIdentifier const& packet, ::AddPaintingPacket const&) /*override*/;
148
149 virtual void handle(::NetworkIdentifier const& source, ::AddPlayerPacket const& packet) /*override*/;
150
151 virtual void handle(::NetworkIdentifier const& packet, ::AnimatePacket const&) /*override*/;
152
153 virtual void
154 handle(::NetworkIdentifier const& source, ::std::shared_ptr<::BlockActorDataPacket> packet) /*override*/;
155
156 virtual void handle(::NetworkIdentifier const& source, ::BlockEventPacket const& packet) /*override*/;
157
158 virtual void handle(::NetworkIdentifier const& packet, ::ChangeDimensionPacket const&) /*override*/;
159
160 virtual void handle(::NetworkIdentifier const& packet, ::ContainerClosePacket const&) /*override*/;
161
162 virtual void handle(::NetworkIdentifier const& source, ::ContainerOpenPacket const& packet) /*override*/;
163
164 virtual void handle(::NetworkIdentifier const& packet, ::ContainerRegistryCleanupPacket const&) /*override*/;
165
166 virtual void handle(::NetworkIdentifier const& packet, ::ContainerSetDataPacket const&) /*override*/;
167
168 virtual void handle(::NetworkIdentifier const& source, ::DisconnectPacket const& packet) /*override*/;
169
170 virtual void handle(::NetworkIdentifier const& source, ::std::shared_ptr<::LevelChunkPacket> packet) /*override*/;
171
172 virtual void
173 handle(::NetworkIdentifier const& source, ::std::shared_ptr<::ClientCacheMissResponsePacket> packet) /*override*/;
174
175 virtual void handle(::NetworkIdentifier const& packet, ::GameRulesChangedPacket const&) /*override*/;
176
177 virtual void handle(::NetworkIdentifier const& packet, ::HurtArmorPacket const&) /*override*/;
178
179 virtual void handle(::NetworkIdentifier const& packet, ::InventoryContentPacket const&) /*override*/;
180
181 virtual void handle(::NetworkIdentifier const& packet, ::InventorySlotPacket const&) /*override*/;
182
183 virtual void
184 handle(::NetworkIdentifier const& packet, ::std::shared_ptr<::InventoryTransactionPacket>) /*override*/;
185
186 virtual void handle(::NetworkIdentifier const& packet, ::MobArmorEquipmentPacket const&) /*override*/;
187
188 virtual void handle(::NetworkIdentifier const& packet, ::MobEffectPacket const&) /*override*/;
189
190 virtual void handle(::NetworkIdentifier const& packetPtr, ::std::shared_ptr<::MobEquipmentPacket>) /*override*/;
191
192 virtual void handle(::NetworkIdentifier const& packet, ::MoveActorAbsolutePacket const&) /*override*/;
193
194 virtual void handle(::NetworkIdentifier const& packet, ::MoveActorDeltaPacket const&) /*override*/;
195
196 virtual void handle(::NetworkIdentifier const& packet, ::MovementEffectPacket const&) /*override*/;
197
198 virtual void handle(::NetworkIdentifier const& packet, ::MovePlayerPacket const&) /*override*/;
199
200 virtual void handle(::NetworkIdentifier const& source, ::NetworkSettingsPacket const& packet) /*override*/;
201
202 virtual void handle(::NetworkIdentifier const& packet, ::NetworkStackLatencyPacket const&) /*override*/;
203
204 virtual void handle(::NetworkIdentifier const& packet, ::PlayerHotbarPacket const&) /*override*/;
205
206 virtual void handle(::NetworkIdentifier const& packet, ::PlayerListPacket const&) /*override*/;
207
208 virtual void handle(::NetworkIdentifier const& packet, ::PlayerSkinPacket const&) /*override*/;
209
210 virtual void handle(::NetworkIdentifier const& packet, ::PlayerUpdateEntityOverridesPacket const&) /*override*/;
211
212 virtual void handle(::NetworkIdentifier const& packet, ::RemoveActorPacket const&) /*override*/;
213
214 virtual void handle(::NetworkIdentifier const& packet, ::SetActorDataPacket const&) /*override*/;
215
216 virtual void handle(::NetworkIdentifier const& packet, ::SetActorLinkPacket const&) /*override*/;
217
218 virtual void handle(::NetworkIdentifier const& packet, ::SetActorMotionPacket const&) /*override*/;
219
220 virtual void handle(::NetworkIdentifier const& packet, ::MotionPredictionHintsPacket const&) /*override*/;
221
222 virtual void handle(::NetworkIdentifier const& packet, ::SetCommandsEnabledPacket const&) /*override*/;
223
224 virtual void handle(::NetworkIdentifier const& packet, ::SetDefaultGameTypePacket const&) /*override*/;
225
226 virtual void handle(::NetworkIdentifier const& packet, ::SetDifficultyPacket const&) /*override*/;
227
228 virtual void handle(::NetworkIdentifier const& packet, ::SetHealthPacket const&) /*override*/;
229
230 virtual void handle(::NetworkIdentifier const& packet, ::SetSpawnPositionPacket const&) /*override*/;
231
232 virtual void handle(::NetworkIdentifier const& packet, ::SetTimePacket const&) /*override*/;
233
234 virtual void handle(::NetworkIdentifier const& packet, ::SetHudPacket const&) /*override*/;
235
236 virtual void handle(::NetworkIdentifier const& packet, ::SpawnParticleEffectPacket const&) /*override*/;
237
238 virtual void handle(::NetworkIdentifier const& source, ::StartGamePacket const& packet) /*override*/;
239
240 virtual void handle(::NetworkIdentifier const& source, ::std::shared_ptr<::UpdateBlockPacket> packet) /*override*/;
241
242 virtual void
243 handle(::NetworkIdentifier const& source, ::std::shared_ptr<::UpdateBlockSyncedPacket> packet) /*override*/;
244
245 virtual void handle(::NetworkIdentifier const& packet, ::CreativeContentPacket const&) /*override*/;
246
247 virtual void handle(::NetworkIdentifier const& packet, ::ItemRegistryPacket const&) /*override*/;
248
249 virtual void handle(::NetworkIdentifier const& source, ::DimensionDataPacket const& packet) /*override*/;
250
251 virtual void handle(::NetworkIdentifier const& packet, ::UpdateAbilitiesPacket const&) /*override*/;
252
253 virtual void handle(::NetworkIdentifier const& packet, ::UpdateAdventureSettingsPacket const&) /*override*/;
254
255 virtual void handle(::NetworkIdentifier const& packet, ::ServerStatsPacket const&) /*override*/;
256
257 virtual void onTick() /*override*/;
258
259 virtual void onEntityRemoved(::Actor& entity) /*override*/;
260
261 virtual void onLevelDestruction(::std::string const&) /*override*/;
262 // NOLINTEND
263
264public:
265 // member functions
266 // NOLINTBEGIN
267 MCAPI explicit LegacyClientNetworkHandler(::LegacyClientNetworkHandlerArguments&& args);
268
269 MCAPI void _drainCacheMissesQueueAndSendPacket();
270
271 MCAPI ::std::string _getServerIdentifier() const;
272
273 MCAPI void _removePlayer(::mce::UUID const& playerEntryId);
274
275 MCAPI bool _shouldKeepSkinBasedOnMemory(::mce::UUID const& playerId, ::SerializedSkinRef const& skin) const;
276
277 MCAPI void _updateBlobCacheTrackingData();
278
279 MCAPI void onSubClientConnect();
280 // NOLINTEND
281
282public:
283 // static functions
284 // NOLINTBEGIN
285 MCAPI static void handleUpdateBlock(
286 ::IBlockSource& region,
287 ::BlockPos const& pos,
288 ::Block const& block,
289 int layer,
290 int updateFlags,
291 ::ActorBlockSyncMessage const* syncMsg
292 );
293 // NOLINTEND
294
295public:
296 // constructor thunks
297 // NOLINTBEGIN
298 MCAPI void* $ctor(::LegacyClientNetworkHandlerArguments&& args);
299 // NOLINTEND
300
301public:
302 // destructor thunk
303 // NOLINTBEGIN
304 MCAPI void $dtor();
305 // NOLINTEND
306
307public:
308 // virtual function thunks
309 // NOLINTBEGIN
310 MCAPI void $onPlayerReady(::Player& player);
311
312 MCAPI void $onConnect(::NetworkIdentifier const& hostId);
313
314 MCAPI void $onUnableToConnect(
315 ::Connection::DisconnectFailReason discoReason,
316 ::std::string const& messageFromServer,
317 ::std::string const& messageBodyOverride
318 );
319
320 MCAPI bool $getIsConnectedToApplicationLayer() const;
321
322 MCAPI void $handle(::NetworkIdentifier const& source, ::AddActorPacket const& packet);
323
324 MCAPI void $handle(::NetworkIdentifier const& packet, ::AddItemActorPacket const&);
325
326 MCAPI void $handle(::NetworkIdentifier const& packet, ::AddPaintingPacket const&);
327
328 MCAPI void $handle(::NetworkIdentifier const& source, ::AddPlayerPacket const& packet);
329
330 MCAPI void $handle(::NetworkIdentifier const& packet, ::AnimatePacket const&);
331
332 MCAPI void $handle(::NetworkIdentifier const& source, ::std::shared_ptr<::BlockActorDataPacket> packet);
333
334 MCAPI void $handle(::NetworkIdentifier const& source, ::BlockEventPacket const& packet);
335
336 MCAPI void $handle(::NetworkIdentifier const& packet, ::ChangeDimensionPacket const&);
337
338 MCAPI void $handle(::NetworkIdentifier const& packet, ::ContainerClosePacket const&);
339
340 MCAPI void $handle(::NetworkIdentifier const& source, ::ContainerOpenPacket const& packet);
341
342 MCAPI void $handle(::NetworkIdentifier const& packet, ::ContainerRegistryCleanupPacket const&);
343
344 MCAPI void $handle(::NetworkIdentifier const& packet, ::ContainerSetDataPacket const&);
345
346 MCAPI void $handle(::NetworkIdentifier const& source, ::DisconnectPacket const& packet);
347
348 MCAPI void $handle(::NetworkIdentifier const& source, ::std::shared_ptr<::LevelChunkPacket> packet);
349
350 MCAPI void $handle(::NetworkIdentifier const& source, ::std::shared_ptr<::ClientCacheMissResponsePacket> packet);
351
352 MCAPI void $handle(::NetworkIdentifier const& packet, ::GameRulesChangedPacket const&);
353
354 MCAPI void $handle(::NetworkIdentifier const& packet, ::HurtArmorPacket const&);
355
356 MCAPI void $handle(::NetworkIdentifier const& packet, ::InventoryContentPacket const&);
357
358 MCAPI void $handle(::NetworkIdentifier const& packet, ::InventorySlotPacket const&);
359
360 MCAPI void $handle(::NetworkIdentifier const& packet, ::std::shared_ptr<::InventoryTransactionPacket>);
361
362 MCAPI void $handle(::NetworkIdentifier const& packet, ::MobArmorEquipmentPacket const&);
363
364 MCAPI void $handle(::NetworkIdentifier const& packet, ::MobEffectPacket const&);
365
366 MCAPI void $handle(::NetworkIdentifier const& packetPtr, ::std::shared_ptr<::MobEquipmentPacket>);
367
368 MCAPI void $handle(::NetworkIdentifier const& packet, ::MoveActorAbsolutePacket const&);
369
370 MCAPI void $handle(::NetworkIdentifier const& packet, ::MoveActorDeltaPacket const&);
371
372 MCAPI void $handle(::NetworkIdentifier const& packet, ::MovementEffectPacket const&);
373
374 MCAPI void $handle(::NetworkIdentifier const& packet, ::MovePlayerPacket const&);
375
376 MCAPI void $handle(::NetworkIdentifier const& source, ::NetworkSettingsPacket const& packet);
377
378 MCAPI void $handle(::NetworkIdentifier const& packet, ::NetworkStackLatencyPacket const&);
379
380 MCAPI void $handle(::NetworkIdentifier const& packet, ::PlayerHotbarPacket const&);
381
382 MCAPI void $handle(::NetworkIdentifier const& packet, ::PlayerListPacket const&);
383
384 MCAPI void $handle(::NetworkIdentifier const& packet, ::PlayerSkinPacket const&);
385
386 MCAPI void $handle(::NetworkIdentifier const& packet, ::PlayerUpdateEntityOverridesPacket const&);
387
388 MCAPI void $handle(::NetworkIdentifier const& packet, ::RemoveActorPacket const&);
389
390 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetActorDataPacket const&);
391
392 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetActorLinkPacket const&);
393
394 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetActorMotionPacket const&);
395
396 MCAPI void $handle(::NetworkIdentifier const& packet, ::MotionPredictionHintsPacket const&);
397
398 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetCommandsEnabledPacket const&);
399
400 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetDefaultGameTypePacket const&);
401
402 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetDifficultyPacket const&);
403
404 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetHealthPacket const&);
405
406 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetSpawnPositionPacket const&);
407
408 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetTimePacket const&);
409
410 MCAPI void $handle(::NetworkIdentifier const& packet, ::SetHudPacket const&);
411
412 MCAPI void $handle(::NetworkIdentifier const& packet, ::SpawnParticleEffectPacket const&);
413
414 MCAPI void $handle(::NetworkIdentifier const& source, ::StartGamePacket const& packet);
415
416 MCAPI void $handle(::NetworkIdentifier const& source, ::std::shared_ptr<::UpdateBlockPacket> packet);
417
418 MCAPI void $handle(::NetworkIdentifier const& source, ::std::shared_ptr<::UpdateBlockSyncedPacket> packet);
419
420 MCAPI void $handle(::NetworkIdentifier const& packet, ::CreativeContentPacket const&);
421
422 MCAPI void $handle(::NetworkIdentifier const& packet, ::ItemRegistryPacket const&);
423
424 MCAPI void $handle(::NetworkIdentifier const& source, ::DimensionDataPacket const& packet);
425
426 MCAPI void $handle(::NetworkIdentifier const& packet, ::UpdateAbilitiesPacket const&);
427
428 MCAPI void $handle(::NetworkIdentifier const& packet, ::UpdateAdventureSettingsPacket const&);
429
430 MCAPI void $handle(::NetworkIdentifier const& packet, ::ServerStatsPacket const&);
431
432 MCAPI void $onTick();
433
434 MCAPI void $onEntityRemoved(::Actor& entity);
435
436 MCAPI void $onLevelDestruction(::std::string const&);
437 // NOLINTEND
438
439public:
440 // vftables
441 // NOLINTBEGIN
442 MCNAPI static void** $vftableForClientNetworkHandler();
443
444 MCNAPI static void** $vftableForLevelListener();
445 // NOLINTEND
446};
Definition Actor.h:125
Definition AddActorPacket.h:29
Definition AddItemActorPacket.h:23
Definition AddPaintingPacket.h:20
Definition AddPlayerPacket.h:32
Definition AnimatePacket.h:19
Definition AppPlatform.h:91
Definition BlockActorDataPacket.h:19
Definition BlockEventPacket.h:19
Definition BlockPos.h:21
Definition Block.h:69
Definition ChangeDimensionPacket.h:19
Definition ClientCacheMissResponsePacket.h:19
Definition ClientNetworkHandler.h:5
Definition ContainerClosePacket.h:19
Definition ContainerOpenPacket.h:19
Definition ContainerRegistryCleanupPacket.h:19
Definition ContainerSetDataPacket.h:19
Definition CreativeContentPacket.h:22
Definition DimensionDataPacket.h:17
Definition DisconnectPacket.h:19
Definition EntityOverrides.h:8
Definition GameRulesChangedPacket.h:19
Definition HurtArmorPacket.h:19
Definition IBlockSource.h:38
Definition ILevel.h:219
Definition IPersonaNetworkHandlerDelegate.h:5
Definition InventoryContentPacket.h:21
Definition InventorySlotPacket.h:19
Definition InventoryTransactionPacket.h:22
Definition ItemRegistryPacket.h:19
Definition LegacyClientNetworkHandler.h:5
static MCAPI void ** $vftableForClientNetworkHandler()
static MCAPI void ** $vftableForLevelListener()
Definition LevelChunkPacket.h:18
Definition LevelListener.h:28
Definition MobArmorEquipmentPacket.h:19
Definition MobEffectPacket.h:19
Definition MobEquipmentPacket.h:19
Definition MotionPredictionHintsPacket.h:19
Definition MoveActorAbsolutePacket.h:19
Definition MoveActorDeltaPacket.h:17
Definition MovePlayerPacket.h:22
Definition MovementEffectPacket.h:19
Definition MultiPlayerLevel.h:5
Definition NetworkChunkInserter.h:5
Definition NetworkSettingsPacket.h:19
Definition NetworkStackLatencyPacket.h:19
Definition PlayerHotbarPacket.h:19
Definition PlayerListPacket.h:18
Definition PlayerSkinPacket.h:19
Definition PlayerUpdateEntityOverridesPacket.h:18
Definition Player.h:137
Definition RemoveActorPacket.h:19
Definition SerializedSkinRef.h:31
Definition ServerStatsPacket.h:19
Definition SetActorDataPacket.h:26
Definition SetActorLinkPacket.h:19
Definition SetActorMotionPacket.h:19
Definition SetCommandsEnabledPacket.h:19
Definition SetDefaultGameTypePacket.h:19
Definition SetDifficultyPacket.h:19
Definition SetHealthPacket.h:19
Definition SetHudPacket.h:19
Definition SetSpawnPositionPacket.h:19
Definition SetTimePacket.h:19
Definition SpawnParticleEffectPacket.h:19
Definition StartGamePacket.h:31
Definition UpdateAbilitiesPacket.h:20
Definition UpdateAdventureSettingsPacket.h:19
Definition UpdateBlockPacket.h:19
Definition UpdateBlockSyncedPacket.h:19
Definition UUID.h:7
Definition ActorBlockSyncMessage.h:8
Definition ClientCreateLevelArguments.h:5
Definition LegacyClientNetworkHandlerArguments.h:5
Definition ReflectionCtx.h:11