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/NetworkID.h"
9#include "mc/deps/nether_net/lan/Controller.h"
10#include "mc/external/rtc/IPAddress.h"
11#include "mc/external/rtc/Thread.h"
12#include "mc/external/sigslot/has_slots.h"
13#include "mc/external/sigslot/single_threaded.h"
14
15// auto generated forward declare list
16// clang-format off
17namespace Bedrock::PubSub { class Subscription; }
18namespace NetherNet { struct DiscoveryResponsePacket; }
19namespace NetherNet { struct ILanEventHandler; }
20namespace NetherNet { struct ThreadInit; }
21namespace rtc { class AsyncPacketSocket; }
22namespace rtc { class ReceivedPacket; }
23namespace rtc { class SocketAddress; }
24// clang-format on
25
26namespace NetherNet {
27
28class LanThreadManager : public ::NetherNet::ContextProxy,
29 public ::rtc::Thread,
30 public ::sigslot::has_slots<::sigslot::single_threaded>,
33public:
34 // member variables
35 // NOLINTBEGIN
48 // NOLINTEND
49
50public:
51 // prevent constructor by default
52 LanThreadManager& operator=(LanThreadManager const&);
53 LanThreadManager(LanThreadManager const&);
54 LanThreadManager();
55
56public:
57 // virtual functions
58 // NOLINTBEGIN
59 virtual ~LanThreadManager() /*override*/;
60
61 virtual ::Bedrock::PubSub::Subscription RegisterEventHandler(::NetherNet::ILanEventHandler* handler) /*override*/;
62
63 virtual bool IsBroadcastDiscoveryEnabled(::NetherNet::NetworkID id) /*override*/;
64
65 virtual void EnableBroadcastDiscovery(::NetherNet::NetworkID id) /*override*/;
66
67 virtual void DisableBroadcastDiscovery(::NetherNet::NetworkID id) /*override*/;
68
69 virtual void SendLanBroadcastResponse(
70 ::rtc::SocketAddress const& destination,
72 ) /*override*/;
73
74 virtual void SendSignalingMessageTo(
75 ::NetherNet::NetworkID networkIdFrom,
76 ::NetherNet::NetworkID networkIdTo,
77 ::std::string const& message
78 ) /*override*/;
79
80 virtual bool IsNetworkIdOnLan(::NetherNet::NetworkID networkId) /*override*/;
81
82 virtual void Suspend() /*override*/;
83
84 virtual void Resume() /*override*/;
85 // NOLINTEND
86
87public:
88 // member functions
89 // NOLINTBEGIN
90 MCNAPI void BeginNetworkDiscovery();
91
92 MCNAPI void BroadcastTask();
93
95
96 MCNAPI void DestroyLanResources();
97
98 MCNAPI void Initialize(
99 char const* threadName,
100 ::NetherNet::ThreadInit const& threadInit,
101 uint64 applicationId,
102 ushort port,
103 ::std::chrono::milliseconds interval
104 );
105
107
109
111
112 MCNAPI void SendLanBroadcastRequest(::std::unique_ptr<::rtc::AsyncPacketSocket>& socket, ::NetherNet::NetworkID id);
113
115 ::std::unique_ptr<::rtc::AsyncPacketSocket>& socket,
116 ::NetherNet::NetworkID networkIdFrom,
117 ::NetherNet::NetworkID networkIdTo,
118 ::std::string const& message
119 );
120
121 MCNAPI ::std::error_code SendToHelper(
122 ::std::unique_ptr<::rtc::AsyncPacketSocket>& socket,
123 void const* data,
124 uint64 size,
125 ::rtc::SocketAddress const& addr
126 );
127
128 MCNAPI void Shutdown();
129 // NOLINTEND
130
131public:
132 // constructor thunks
133 // NOLINTBEGIN
134 MCNAPI void* $ctor(::NetherNet::ContextProxy const& ctx);
135 // NOLINTEND
136
137public:
138 // destructor thunk
139 // NOLINTBEGIN
140 MCNAPI void $dtor();
141 // NOLINTEND
142
143public:
144 // virtual function thunks
145 // NOLINTBEGIN
146 MCNAPI ::Bedrock::PubSub::Subscription $RegisterEventHandler(::NetherNet::ILanEventHandler* handler);
147
149
151
153
155 ::rtc::SocketAddress const& destination,
157 );
158
160 ::NetherNet::NetworkID networkIdFrom,
161 ::NetherNet::NetworkID networkIdTo,
162 ::std::string const& message
163 );
164
166
167 MCNAPI void $Suspend();
168
169 MCNAPI void $Resume();
170
171
172 // NOLINTEND
173
174public:
175 // vftables
176 // NOLINTBEGIN
177 MCNAPI static void** $vftableForHasSlots();
178
179 MCNAPI static void** $vftableForILanDiscovery();
180
181 MCNAPI static void** $vftableForThread();
182
183 MCNAPI static void** $vftableForContextProxy();
184 // NOLINTEND
185};
186
187} // namespace NetherNet
Definition Subscription.h:10
Definition ContextProxy.h:18
Definition ILanDiscovery.h:16
MCAPI void $SendLanBroadcastResponse(::rtc::SocketAddress const &destination, ::NetherNet::DiscoveryResponsePacket const &packet)
MCAPI void * $ctor(::NetherNet::ContextProxy const &ctx)
MCAPI void BeginNetworkDiscovery()
MCAPI void DestroyLanResources()
static MCAPI void ** $vftableForILanDiscovery()
MCAPI void $SendSignalingMessageTo(::NetherNet::NetworkID networkIdFrom, ::NetherNet::NetworkID networkIdTo, ::std::string const &message)
MCAPI void OnNetworkDiscoveryComplete()
static MCAPI void ** $vftableForThread()
MCAPI bool $IsBroadcastDiscoveryEnabled(::NetherNet::NetworkID id)
MCAPI void $DisableBroadcastDiscovery(::NetherNet::NetworkID id)
static MCAPI void ** $vftableForContextProxy()
MCAPI void Initialize(char const *threadName, ::NetherNet::ThreadInit const &threadInit, uint64 applicationId, ushort port, ::std::chrono::milliseconds interval)
MCAPI void SendSignalingMessageTo(::std::unique_ptr<::rtc::AsyncPacketSocket > &socket, ::NetherNet::NetworkID networkIdFrom, ::NetherNet::NetworkID networkIdTo, ::std::string const &message)
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 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 DiscoveryResponsePacket.h:10
Definition ILanEventHandler.h:15
Definition NetworkID.h:17
Definition ThreadInit.h:7
Definition ctx.h:5
Definition Alias.h:14