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<8, 8, ::std::chrono::milliseconds> mCurrentPing;
42 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> 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 bool isLan() const;
83
84 virtual ::NetworkPeer::DataStatus _receivePacket(
85 ::std::string& outData,
86 ::std::shared_ptr<::std::chrono::steady_clock::time_point> const& timepointPtr
87 ) = 0;
88 // NOLINTEND
89
90public:
91 // destructor thunk
92 // NOLINTBEGIN
93 MCAPI void $dtor();
94 // NOLINTEND
95
96public:
97 // virtual function thunks
98 // NOLINTBEGIN
99 MCAPI void $update();
100
101 MCAPI void $flush(::std::function<void()>&& callback);
102
103 MCAPI bool $isLocal() const;
104
105 MCAPI bool $isEncrypted() const;
106
107 MCAPI bool $isLan() const;
108
109
110 // NOLINTEND
111
112public:
113 // vftables
114 // NOLINTBEGIN
115 MCNAPI static void** $vftable();
116 // NOLINTEND
117};
Definition NetworkPeer.h:8
static MCAPI void ** $vftable()
Definition NetworkPeer.h:36