LeviLamina
Loading...
Searching...
No Matches
LanThreadManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/nether_net/ContextProxy.h"
7#include "mc/deps/nether_net/ILanDiscovery.h"
8#include "mc/deps/nether_net/lan/Controller.h"
9#include "mc/external/rtc/Thread.h"
10#include "mc/external/sigslot/has_slots.h"
11#include "mc/external/sigslot/single_threaded.h"
12
13// auto generated forward declare list
14// clang-format off
16namespace Bedrock::PubSub { class Subscription; }
17namespace NetherNet { struct ILanEventHandler; }
18namespace NetherNet { struct NetworkID; }
19namespace rtc { class AsyncPacketSocket; }
20namespace rtc { class ReceivedPacket; }
21namespace rtc { class SocketAddress; }
22// clang-format on
23
24namespace NetherNet {
25
26class LanThreadManager : public ::NetherNet::ContextProxy,
27 public ::rtc::Thread,
28 public ::sigslot::has_slots<::sigslot::single_threaded>,
31public:
32 // member variables
33 // NOLINTBEGIN
46 // NOLINTEND
47
48public:
49 // prevent constructor by default
50 LanThreadManager& operator=(LanThreadManager const&);
51 LanThreadManager(LanThreadManager const&);
52 LanThreadManager();
53
54public:
55 // virtual functions
56 // NOLINTBEGIN
57 virtual ~LanThreadManager() /*override*/;
58
59 virtual ::Bedrock::PubSub::Subscription RegisterEventHandler(::NetherNet::ILanEventHandler* handler) /*override*/;
60
61 virtual bool IsBroadcastDiscoveryEnabled(::NetherNet::NetworkID id) /*override*/;
62
63 virtual void EnableBroadcastDiscovery(::NetherNet::NetworkID id) /*override*/;
64
65 virtual void DisableBroadcastDiscovery(::NetherNet::NetworkID id) /*override*/;
66
67 virtual void AddLanHost(::NetherNet::NetworkID remote, ::std::string const& ipStr, int port) /*override*/;
68
69 virtual void RemoveLanHost(::NetherNet::NetworkID remote) /*override*/;
70
71 virtual void SendLanBroadcastResponse(
72 ::rtc::SocketAddress const& destination,
74 ::std::vector<::std::byte> data
75 ) /*override*/;
76
77 virtual void SendSignalingMessageTo(
78 ::NetherNet::NetworkID networkIdFrom,
79 ::NetherNet::NetworkID networkIdTo,
80 ::std::vector<::std::byte> data
81 ) /*override*/;
82
83 virtual bool IsNetworkIdOnLan(::NetherNet::NetworkID networkId) /*override*/;
84
85 virtual void Suspend() /*override*/;
86
87 virtual void Resume() /*override*/;
88 // NOLINTEND
89
90public:
91 // member functions
92 // NOLINTBEGIN
93 MCNAPI void BeginNetworkDiscovery();
94
95 MCNAPI void BroadcastTask();
96
98
99 MCNAPI void DestroyLanResources();
100
101 MCNAPI void Initialize(
102 char const* threadName,
103 ::ThreadConfiguration const& threadConfiguration,
104 uint64 applicationId,
105 ushort port,
106 ::std::chrono::milliseconds interval
107 );
108
110
112
114
115 MCNAPI void SendLanBroadcastRequest(::std::unique_ptr<::rtc::AsyncPacketSocket>& socket, ::NetherNet::NetworkID id);
116
118 ::std::unique_ptr<::rtc::AsyncPacketSocket>& socket,
119 ::NetherNet::NetworkID networkIdFrom,
120 ::NetherNet::NetworkID networkIdTo,
121 ::std::vector<::std::byte> data
122 );
123
124 MCNAPI ::std::error_code SendToHelper(
125 ::std::unique_ptr<::rtc::AsyncPacketSocket>& socket,
126 void const* data,
127 uint64 size,
128 ::rtc::SocketAddress const& addr
129 );
130
131 MCNAPI void Shutdown();
132 // NOLINTEND
133
134public:
135 // constructor thunks
136 // NOLINTBEGIN
137 MCNAPI void* $ctor(::NetherNet::ContextProxy const& ctx);
138 // NOLINTEND
139
140public:
141 // destructor thunk
142 // NOLINTBEGIN
143 MCNAPI void $dtor();
144 // NOLINTEND
145
146public:
147 // virtual function thunks
148 // NOLINTBEGIN
149 MCNAPI ::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ILanEventHandler* handler);
150
152
154
156
157 MCNAPI void $AddLanHost(::NetherNet::NetworkID remote, ::std::string const& ipStr, int port);
158
160
162 ::rtc::SocketAddress const& destination,
164 ::std::vector<::std::byte> data
165 );
166
168 ::NetherNet::NetworkID networkIdFrom,
169 ::NetherNet::NetworkID networkIdTo,
170 ::std::vector<::std::byte> data
171 );
172
174
175 MCNAPI void $Suspend();
176
177 MCNAPI void $Resume();
178
179
180 // NOLINTEND
181
182public:
183 // vftables
184 // NOLINTBEGIN
185 MCNAPI static void** $vftableForHasSlots();
186
187 MCNAPI static void** $vftableForILanDiscovery();
188
189 MCNAPI static void** $vftableForThread();
190
191 MCNAPI static void** $vftableForContextProxy();
192 // NOLINTEND
193};
194
195} // namespace NetherNet
Definition Subscription.h:10
Definition ContextProxy.h:18
Definition ILanDiscovery.h:15
MCAPI void * $ctor(::NetherNet::ContextProxy const &ctx)
MCAPI void BeginNetworkDiscovery()
MCAPI void DestroyLanResources()
static MCAPI void ** $vftableForILanDiscovery()
MCAPI void $SendLanBroadcastResponse(::rtc::SocketAddress const &destination, ::NetherNet::NetworkID from, ::std::vector<::std::byte > data)
MCAPI void OnNetworkDiscoveryComplete()
MCAPI void Initialize(char const *threadName, ::ThreadConfiguration const &threadConfiguration, uint64 applicationId, ushort port, ::std::chrono::milliseconds interval)
static MCAPI void ** $vftableForThread()
MCAPI bool $IsBroadcastDiscoveryEnabled(::NetherNet::NetworkID id)
MCAPI void $DisableBroadcastDiscovery(::NetherNet::NetworkID id)
static MCAPI void ** $vftableForContextProxy()
MCAPI void SendSignalingMessageTo(::std::unique_ptr<::rtc::AsyncPacketSocket > &socket, ::NetherNet::NetworkID networkIdFrom, ::NetherNet::NetworkID networkIdTo, ::std::vector<::std::byte > data)
MCAPI void $AddLanHost(::NetherNet::NetworkID remote, ::std::string const &ipStr, int port)
MCAPI void $SendSignalingMessageTo(::NetherNet::NetworkID networkIdFrom, ::NetherNet::NetworkID networkIdTo, ::std::vector<::std::byte > data)
MCAPI::std::error_code SendToHelper(::std::unique_ptr<::rtc::AsyncPacketSocket > &socket, void const *data, uint64 size, ::rtc::SocketAddress const &addr)
MCAPI::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ILanEventHandler *handler)
MCAPI void $EnableBroadcastDiscovery(::NetherNet::NetworkID id)
MCAPI LanThreadManager(::NetherNet::ContextProxy const &ctx)
MCAPI void OnPacket(::rtc::AsyncPacketSocket *, ::rtc::ReceivedPacket const &packet)
MCAPI void SendLanBroadcastRequest(::std::unique_ptr<::rtc::AsyncPacketSocket > &socket, ::NetherNet::NetworkID id)
static MCAPI void ** $vftableForHasSlots()
MCAPI void $RemoveLanHost(::NetherNet::NetworkID remote)
MCAPI bool $IsNetworkIdOnLan(::NetherNet::NetworkID networkId)
MCAPI void CreateEncryptedBroadcastSocket()
Definition Controller.h:7
Definition AsyncPacketSocket.h:20
Definition ReceivedPacket.h:16
Definition SocketAddress.h:12
Definition Thread.h:20
Definition has_slots.h:8
Definition ILanEventHandler.h:15
Definition NetworkID.h:17
Definition ThreadConfiguration.h:5
Definition ctx.h:5
Definition Alias.h:14