LeviLamina
Loading...
Searching...
No Matches
NetworkPeer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/network/Compressibility.h"
7
9public:
10 // NetworkPeer inner types declare
11 // clang-format off
12 struct NetworkStatus;
13 // clang-format on
14
15 // NetworkPeer inner types define
16 enum class DataStatus : int {
17 HasData = 0,
18 NoData = 1,
19 BrokenData = 2,
20 };
21
22 enum class NetworkLoad : int {
23 Unrestricted = 0,
24 Low = 1,
25 Medium = 2,
26 High = 3,
27 };
28
29 enum class Reliability : int {
30 Reliable = 0,
31 ReliableOrdered = 1,
32 Unreliable = 2,
33 UnreliableSequenced = 3,
34 };
35
37 public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<4, 4, ::NetworkPeer::NetworkLoad> mLoad;
41 ::ll::TypedStorage<4, 4, int> mCurrentPing;
42 ::ll::TypedStorage<4, 4, int> mAveragePing;
43 ::ll::TypedStorage<4, 4, int> mApproximateMaxBps;
44 ::ll::TypedStorage<4, 4, float> mCurrentPacketLoss;
45 ::ll::TypedStorage<4, 4, float> mAveragePacketLoss;
46 ::ll::TypedStorage<8, 8, uint64> mTotalBytesReceived;
47 ::ll::TypedStorage<8, 8, uint64> mTotalBytesSent;
48 ::ll::TypedStorage<8, 8, uint64> mCurrentBytesSendBuffer;
49 ::ll::TypedStorage<4, 4, int> mICEState;
50 ::ll::TypedStorage<1, 1, bool> mUsingRelays;
51 // NOLINTEND
52 };
53
54 using PacketRecvTimepoint = ::std::chrono::steady_clock::time_point;
55
56 using PacketRecvTimepointPtr = ::std::shared_ptr<::std::chrono::steady_clock::time_point>;
57
58public:
59 // member variables
60 // NOLINTBEGIN
61 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::NetworkPeer>> mPeer;
62 // NOLINTEND
63
64public:
65 // virtual functions
66 // NOLINTBEGIN
67 virtual ~NetworkPeer();
68
69 virtual void
70 sendPacket(::std::string const& data, ::NetworkPeer::Reliability reliability, ::Compressibility compressible) = 0;
71
72 virtual ::NetworkPeer::NetworkStatus getNetworkStatus() const = 0;
73
74 virtual void update();
75
76 virtual void flush(::std::function<void()>&& callback);
77
78 virtual bool isLocal() const;
79
80 virtual bool isEncrypted() const;
81
82 virtual ::NetworkPeer::DataStatus _receivePacket(
83 ::std::string& outData,
84 ::std::shared_ptr<::std::chrono::steady_clock::time_point> const& timepointPtr
85 ) = 0;
86 // NOLINTEND
87
88public:
89 // destructor thunk
90 // NOLINTBEGIN
91 MCAPI void $dtor();
92 // NOLINTEND
93
94public:
95 // virtual function thunks
96 // NOLINTBEGIN
97 MCAPI void $update();
98
99 MCAPI void $flush(::std::function<void()>&& callback);
100
101 MCAPI bool $isLocal() const;
102
103 MCAPI bool $isEncrypted() const;
104
105
106 // NOLINTEND
107
108public:
109 // vftables
110 // NOLINTBEGIN
111 MCNAPI static void** $vftable();
112 // NOLINTEND
113};
Definition NetworkPeer.h:8
static MCAPI void ** $vftable()
Definition NetworkPeer.h:36