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 sendPacket(::std::string const&, ::NetworkPeer::Reliability, ::Compressibility) = 0;
70
71 virtual ::NetworkPeer::NetworkStatus getNetworkStatus() const = 0;
72
73 virtual void update();
74
75 virtual void flush(::std::function<void()>&& callback);
76
77 virtual bool isLocal() const;
78
79 virtual bool isEncrypted() const;
80
81 virtual ::NetworkPeer::DataStatus
82 _receivePacket(::std::string&, ::std::shared_ptr<::std::chrono::steady_clock::time_point> const&) = 0;
83 // NOLINTEND
84
85public:
86 // destructor thunk
87 // NOLINTBEGIN
88 MCAPI void $dtor();
89 // NOLINTEND
90
91public:
92 // virtual function thunks
93 // NOLINTBEGIN
94 MCAPI void $update();
95
96 MCAPI void $flush(::std::function<void()>&& callback);
97
98 MCAPI bool $isLocal() const;
99
100 MCAPI bool $isEncrypted() const;
101
102
103 // NOLINTEND
104
105public:
106 // vftables
107 // NOLINTBEGIN
108 MCNAPI static void** $vftable();
109 // NOLINTEND
110};
Definition NetworkPeer.h:8
static MCAPI void ** $vftable()
Definition NetworkPeer.h:36