LeviLamina
Loading...
Searching...
No Matches
RakPeer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/raknet/AddressOrGUID.h"
7#include "mc/deps/raknet/BitStream.h"
8#include "mc/deps/raknet/ConnectionAttemptResult.h"
9#include "mc/deps/raknet/ConnectionState.h"
10#include "mc/deps/raknet/NetworkAdapter.h"
11#include "mc/deps/raknet/PacketPriority.h"
12#include "mc/deps/raknet/PacketReliability.h"
13#include "mc/deps/raknet/PublicKeyMode.h"
14#include "mc/deps/raknet/RNS2EventHandler.h"
15#include "mc/deps/raknet/RakNetGUID.h"
16#include "mc/deps/raknet/RakPeerInterface.h"
17#include "mc/deps/raknet/ReliabilityLayer.h"
18#include "mc/deps/raknet/SignaledEvent.h"
19#include "mc/deps/raknet/SimpleMutex.h"
20#include "mc/deps/raknet/StartupResult.h"
21#include "mc/deps/raknet/SystemAddress.h"
22#include "mc/deps/raknet/data_structures/List.h"
23#include "mc/deps/raknet/data_structures/MemoryPool.h"
24#include "mc/deps/raknet/data_structures/Queue.h"
25#include "mc/deps/raknet/data_structures/ThreadsafeAllocatingQueue.h"
26
27// auto generated forward declare list
28// clang-format off
29namespace RakNet { class PluginInterface2; }
30namespace RakNet { class RakNetSocket2; }
31namespace RakNet { class RakString; }
32namespace RakNet { class ShadowBanList; }
33namespace RakNet { struct Packet; }
34namespace RakNet { struct PublicKey; }
35namespace RakNet { struct RNS2RecvStruct; }
36namespace RakNet { struct RakNetStatistics; }
37namespace RakNet { struct RemoteSystemIndex; }
38namespace RakNet { struct SocketDescriptor; }
39// clang-format on
40
41namespace RakNet {
42
44public:
45 // RakPeer inner types declare
46 // clang-format off
47 struct BanStruct;
49 struct RemoteSystemStruct;
52 struct SocketQueryOutput;
53 // clang-format on
54
55 // RakPeer inner types define
56 enum : int {
57 RequestedConnectionListMutex = 0,
58 OfflinePingResponseMutex = 1,
59 NumberOfRakpeerMutexes = 2,
60 };
61
62 struct BanStruct {
63 public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 8, char*> IP;
67 ::ll::TypedStorage<4, 4, uint> timeout;
68 // NOLINTEND
69 };
70
72 public:
73 // member variables
74 // NOLINTBEGIN
75 ::ll::TypedStorage<2, 2, ushort> pingTime;
76 ::ll::TypedStorage<8, 8, uint64> clockDifferential;
77 // NOLINTEND
78 };
79
81 public:
82 // RemoteSystemStruct inner types define
83 enum class ConnectMode : int {
84 NoAction = 0,
85 DisconnectAsap = 1,
86 DisconnectAsapSilently = 2,
87 DisconnectOnNoAck = 3,
88 RequestedConnection = 4,
89 HandlingConnectionRequest = 5,
90 UnverifiedSender = 6,
91 Connected = 7,
92 };
93
94 public:
95 // member variables
96 // NOLINTBEGIN
97 ::ll::TypedStorage<1, 1, bool> isActive;
98 ::ll::TypedStorage<8, 136, ::RakNet::SystemAddress> systemAddress;
99 ::ll::TypedStorage<8, 136, ::RakNet::SystemAddress> myExternalSystemAddress;
100 ::ll::TypedStorage<8, 2720, ::RakNet::SystemAddress[20]> theirInternalSystemAddress;
101 ::ll::TypedStorage<8, 6704, ::RakNet::ReliabilityLayer> reliabilityLayer;
102 ::ll::TypedStorage<1, 1, bool> weInitiatedTheConnection;
103 ::ll::TypedStorage<8, 80, ::RakNet::RakPeer::PingAndClockDifferential[5]> pingAndClockDifferential;
104 ::ll::TypedStorage<8, 8, uint64> pingAndClockDifferentialWriteIndex;
105 ::ll::TypedStorage<2, 2, ushort> lowestPing;
106 ::ll::TypedStorage<8, 8, uint64> nextPingTime;
107 ::ll::TypedStorage<8, 8, uint64> lastReliableSend;
108 ::ll::TypedStorage<8, 8, uint64> connectionTime;
109 ::ll::TypedStorage<8, 16, ::RakNet::RakNetGUID> guid;
110 ::ll::TypedStorage<4, 4, int> MTUSize;
111 ::ll::TypedStorage<8, 8, ::RakNet::RakNetSocket2*> rakNetSocket;
112 ::ll::TypedStorage<2, 2, ushort> remoteSystemIndex;
113 ::ll::TypedStorage<4, 4, ::RakNet::RakPeer::RemoteSystemStruct::ConnectMode> connectMode;
114 ::ll::TypedStorage<1, 1, bool> applicationHandshakeCompleted;
115 // NOLINTEND
116 };
117
119 public:
120 // member variables
121 // NOLINTBEGIN
122 ::ll::TypedStorage<4, 4, uint> numberOfBitsToSend;
123 ::ll::TypedStorage<4, 4, ::PacketPriority> priority;
124 ::ll::TypedStorage<4, 4, ::PacketReliability> reliability;
125 ::ll::TypedStorage<1, 1, char> orderingChannel;
126 ::ll::TypedStorage<8, 152, ::RakNet::AddressOrGUID> systemIdentifier;
127 ::ll::TypedStorage<1, 1, bool> broadcast;
128 ::ll::TypedStorage<4, 4, ::RakNet::RakPeer::RemoteSystemStruct::ConnectMode> connectionMode;
129 ::ll::TypedStorage<8, 8, uint64> networkID;
130 ::ll::TypedStorage<1, 1, bool> blockingCommand;
131 ::ll::TypedStorage<8, 8, char*> data;
132 ::ll::TypedStorage<1, 1, bool> haveRakNetCloseSocket;
133 ::ll::TypedStorage<4, 4, uint> connectionSocketIndex;
134 ::ll::TypedStorage<2, 2, ushort> remotePortRakNetWasStartedOn_PS3;
135 ::ll::TypedStorage<4, 4, uint> extraSocketOptions;
136 ::ll::TypedStorage<8, 8, ::RakNet::RakNetSocket2*> socket;
137 ::ll::TypedStorage<2, 2, ushort> port;
138 ::ll::TypedStorage<4, 4, uint> receipt;
139 enum : int {
140 Send = 0,
141 CloseConnection = 1,
142 GetSocket = 2,
143 ChangeSystemAddress = 3,
144 DoNothing = 4,
145 } command;
146 // NOLINTEND
147 };
148
150 public:
151 // member variables
152 // NOLINTBEGIN
153 ::ll::TypedStorage<8, 136, ::RakNet::SystemAddress> systemAddress;
154 ::ll::TypedStorage<8, 8, uint64> nextRequestTime;
155 ::ll::TypedStorage<1, 1, uchar> requestsMade;
156 ::ll::TypedStorage<8, 8, char*> data;
157 ::ll::TypedStorage<2, 2, ushort> dataLength;
158 ::ll::TypedStorage<1, 256, char[256]> outgoingPassword;
159 ::ll::TypedStorage<1, 1, uchar> outgoingPasswordLength;
160 ::ll::TypedStorage<4, 4, uint> socketIndex;
161 ::ll::TypedStorage<4, 4, uint> extraData;
162 ::ll::TypedStorage<4, 4, uint> sendConnectionAttemptCount;
163 ::ll::TypedStorage<4, 4, uint> timeBetweenSendConnectionAttemptsMS;
164 ::ll::TypedStorage<4, 4, uint> timeoutTime;
165 ::ll::TypedStorage<4, 4, ::RakNet::PublicKeyMode> publicKeyMode;
166 ::ll::TypedStorage<8, 8, ::RakNet::RakNetSocket2*> socket;
167 enum : int {
168 Connect = 1,
169 } actionToTake;
170 // NOLINTEND
171 };
172
174 public:
175 // member variables
176 // NOLINTBEGIN
177 ::ll::TypedStorage<8, 16, ::DataStructures::List<::RakNet::RakNetSocket2*>> sockets;
178 // NOLINTEND
179 };
180
181public:
182 // member variables
183 // NOLINTBEGIN
184 ::ll::TypedStorage<1, 1, bool volatile> endThreads;
185 ::ll::TypedStorage<1, 1, bool volatile> isMainLoopThreadActive;
186 ::ll::TypedStorage<1, 1, bool> occasionalPing;
187 ::ll::TypedStorage<4, 4, uint> maximumNumberOfPeers;
188 ::ll::TypedStorage<4, 4, uint> maximumIncomingConnections;
189 ::ll::TypedStorage<8, 288, ::RakNet::BitStream> offlinePingResponse;
190 ::ll::TypedStorage<1, 256, char[256]> incomingPassword;
191 ::ll::TypedStorage<1, 1, uchar> incomingPasswordLength;
192 ::ll::TypedStorage<8, 8, ::RakNet::RakPeer::RemoteSystemStruct*> remoteSystemList;
193 ::ll::TypedStorage<8, 8, ::RakNet::RakPeer::RemoteSystemStruct**> activeSystemList;
194 ::ll::TypedStorage<4, 4, uint> activeSystemListSize;
195 ::ll::TypedStorage<8, 8, ::RakNet::RemoteSystemIndex**> remoteSystemLookup;
196 ::ll::TypedStorage<8, 32, ::DataStructures::MemoryPool<::RakNet::RemoteSystemIndex>> remoteSystemIndexPool;
197 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RakNet::ShadowBanList>> shadowBanList;
198 ::ll::TypedStorage<8, 80, ::RakNet::SimpleMutex[2]> rakPeerMutexes;
199 ::ll::TypedStorage<1, 1, bool> updateCycleIsRunning;
200 ::ll::TypedStorage<4, 4, uint> bytesSentPerSecond;
201 ::ll::TypedStorage<4, 4, uint> bytesReceivedPerSecond;
202 ::ll::TypedStorage<4, 4, uint> validationInteger;
203 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> incomingQueueMutex;
204 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> banListMutex;
205 ::ll::TypedStorage<8, 16, ::DataStructures::List<::RakNet::RakPeer::BanStruct*>> banList;
206 ::ll::TypedStorage<8, 16, ::DataStructures::List<::RakNet::PluginInterface2*>> pluginListTS;
207 ::ll::TypedStorage<8, 16, ::DataStructures::List<::RakNet::PluginInterface2*>> pluginListNTS;
208 ::ll::TypedStorage<8, 24, ::DataStructures::Queue<::RakNet::RakPeer::RequestedConnectionStruct*>>
209 requestedConnectionQueue;
210 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> requestedConnectionQueueMutex;
211 ::ll::TypedStorage<8, 136, ::DataStructures::ThreadsafeAllocatingQueue<::RakNet::RakPeer::BufferedCommandStruct>>
212 bufferedCommands;
213 ::ll::TypedStorage<8, 24, ::DataStructures::Queue<::RakNet::RNS2RecvStruct*>> bufferedPacketsFreePool;
214 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> bufferedPacketsFreePoolMutex;
215 ::ll::TypedStorage<8, 24, ::DataStructures::Queue<::RakNet::RNS2RecvStruct*>> bufferedPacketsQueue;
216 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> bufferedPacketsQueueMutex;
217 ::ll::TypedStorage<8, 136, ::DataStructures::ThreadsafeAllocatingQueue<::RakNet::RakPeer::SocketQueryOutput>>
218 socketQueryOutput;
219 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> securityExceptionMutex;
220 ::ll::TypedStorage<4, 4, int> defaultMTUSize;
221 ::ll::TypedStorage<1, 1, bool> trackFrequencyTable;
222 ::ll::TypedStorage<8, 16, ::DataStructures::List<::std::shared_ptr<::RakNet::RakNetSocket2>>> socketList;
223 ::ll::TypedStorage<8, 8, ::RakNet::BitStream*> replyFromTargetBS;
224 ::ll::TypedStorage<8, 136, ::RakNet::SystemAddress> replyFromTargetPlayer;
225 ::ll::TypedStorage<1, 1, bool> replyFromTargetBroadcast;
226 ::ll::TypedStorage<4, 4, uint> defaultTimeoutTime;
227 ::ll::TypedStorage<8, 16, ::RakNet::RakNetGUID> myGuid;
228 ::ll::TypedStorage<4, 4, uint> maxOutgoingBPS;
229 ::ll::TypedStorage<1, 1, bool> allowConnectionResponseIPMigration;
230 ::ll::TypedStorage<8, 136, ::RakNet::SystemAddress> firstExternalID;
231 ::ll::TypedStorage<4, 4, int> splitMessageProgressInterval;
232 ::ll::TypedStorage<4, 4, uint> unreliableTimeout;
233 ::ll::TypedStorage<8, 8, bool (*)(::RakNet::RNS2RecvStruct*)> incomingDatagramEventHandler;
234 ::ll::TypedStorage<8, 16, ::DataStructures::List<::RakNet::RakString>> securityExceptionList;
235 ::ll::TypedStorage<8, 2856, ::RakNet::SystemAddress[21]> ipList;
236 ::ll::TypedStorage<8, 31592, ::RakNet::NetworkAdapter[11]> adapterList;
237 ::ll::TypedStorage<1, 1, bool> allowInternalRouting;
238 ::ll::TypedStorage<1, 1, bool> allowUnconnectedPings;
239 ::ll::TypedStorage<8, 8, void (*)(::RakNet::RakPeerInterface*, void*)> userUpdateThreadPtr;
240 ::ll::TypedStorage<8, 8, void*> userUpdateThreadData;
241 ::ll::TypedStorage<8, 8, ::RakNet::SignaledEvent> quitAndDataEvents;
242 ::ll::TypedStorage<1, 1, bool> limitConnectionFrequencyFromTheSameIP;
243 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> packetAllocationPoolMutex;
244 ::ll::TypedStorage<8, 32, ::DataStructures::MemoryPool<::RakNet::Packet>> packetAllocationPool;
245 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> packetReturnMutex;
246 ::ll::TypedStorage<8, 24, ::DataStructures::Queue<::RakNet::Packet*>> packetReturnQueue;
247 ::ll::TypedStorage<8, 40, ::RakNet::SimpleMutex> sendReceiptSerialMutex;
248 ::ll::TypedStorage<4, 4, uint> sendReceiptSerial;
249 // NOLINTEND
250
251public:
252 // virtual functions
253 // NOLINTBEGIN
254 virtual ~RakPeer() /*override*/ = default;
255
256 virtual void InitializeConfiguration(::std::unique_ptr<::RakNet::ShadowBanList> banList) /*override*/;
257
258 virtual ::RakNet::StartupResult Startup(
259 uint maxConnections,
260 ::RakNet::SocketDescriptor* socketDescriptors,
261 uint socketDescriptorCount,
262 int threadPriority
263 ) /*override*/;
264
265 virtual bool
266 InitializeSecurity(char const* public_key, char const* private_key, bool bRequireClientKey) /*override*/;
267
268 virtual void DisableSecurity() /*override*/;
269
270 virtual void AddToSecurityExceptionList(char const* ip) /*override*/;
271
272 virtual void RemoveFromSecurityExceptionList(char const* ip) /*override*/;
273
274 virtual bool IsInSecurityExceptionList(char const* ip) /*override*/;
275
276 virtual void SetMaximumIncomingConnections(ushort numberAllowed) /*override*/;
277
278 virtual uint GetMaximumIncomingConnections() const /*override*/;
279
280 virtual ushort NumberOfConnections() const /*override*/;
281
282 virtual void SetIncomingPassword(char const* passwordData, int passwordDataLength) /*override*/;
283
284 virtual void GetIncomingPassword(char* passwordData, int* passwordDataLength) /*override*/;
285
286 virtual ::RakNet::ConnectionAttemptResult Connect(
287 char const* host,
288 ushort remotePort,
289 char const* passwordData,
290 int passwordDataLength,
291 ::RakNet::PublicKey* publicKey,
292 uint connectionSocketIndex,
293 uint sendConnectionAttemptCount,
294 uint timeBetweenSendConnectionAttemptsMS,
295 uint timeoutTime
296 ) /*override*/;
297
298 virtual ::RakNet::ConnectionAttemptResult ConnectWithSocket(
299 char const* host,
300 ushort remotePort,
301 char const* passwordData,
302 int passwordDataLength,
303 ::RakNet::RakNetSocket2* socket,
304 ::RakNet::PublicKey* publicKey,
305 uint sendConnectionAttemptCount,
306 uint timeBetweenSendConnectionAttemptsMS,
307 uint timeoutTime
308 ) /*override*/;
309
310 virtual void Shutdown(
311 uint blockDuration,
312 uchar orderingChannel,
313 ::PacketPriority disconnectionNotificationPriority
314 ) /*override*/;
315
316 virtual bool SetApplicationHandshakeCompleted(::RakNet::AddressOrGUID systemIdentifier) /*override*/;
317
318 virtual bool IsActive() const /*override*/;
319
320 virtual bool GetConnectionList(::RakNet::SystemAddress* remoteSystems, ushort* numberOfSystems) const /*override*/;
321
322 virtual uint GetNextSendReceipt() /*override*/;
323
324 virtual uint IncrementNextSendReceipt() /*override*/;
325
326 virtual uint Send(
327 char const* data,
328 int const length,
329 ::PacketPriority priority,
330 ::PacketReliability reliability,
331 char orderingChannel,
332 ::RakNet::AddressOrGUID const systemIdentifier,
333 bool broadcast,
334 uint forceReceiptNumber
335 ) /*override*/;
336
337 virtual uint Send(
338 ::RakNet::BitStream const* bitStream,
339 ::PacketPriority priority,
340 ::PacketReliability reliability,
341 char orderingChannel,
342 ::RakNet::AddressOrGUID const systemIdentifier,
343 bool broadcast,
344 uint forceReceiptNumber
345 ) /*override*/;
346
347 virtual void SendLoopback(char const* data, int const length) /*override*/;
348
349 virtual uint SendList(
350 char const** data,
351 int const* lengths,
352 int const numParameters,
353 ::PacketPriority priority,
354 ::PacketReliability reliability,
355 char orderingChannel,
356 ::RakNet::AddressOrGUID const systemIdentifier,
357 bool broadcast,
358 uint forceReceiptNumber
359 ) /*override*/;
360
361 virtual ::RakNet::Packet* Receive() /*override*/;
362
363 virtual void DeallocatePacket(::RakNet::Packet* packet) /*override*/;
364
365 virtual uint GetMaximumNumberOfPeers() const /*override*/;
366
367 virtual void CloseConnection(
368 ::RakNet::AddressOrGUID const target,
369 bool sendDisconnectionNotification,
370 uchar orderingChannel,
371 ::PacketPriority disconnectionNotificationPriority
372 ) /*override*/;
373
374 virtual ::RakNet::ConnectionState GetConnectionState(::RakNet::AddressOrGUID const systemIdentifier) /*override*/;
375
376 virtual int GetIndexFromSystemAddress(::RakNet::SystemAddress const systemAddress) const /*override*/;
377
378 virtual ::RakNet::RakNetGUID GetGUIDFromIndex(uint index) /*override*/;
379
380 virtual void GetSystemList(
381 ::DataStructures::List<::RakNet::SystemAddress>& addresses,
382 ::DataStructures::List<::RakNet::RakNetGUID>& guids
383 ) const /*override*/;
384
385 virtual void AddToBanList(char const* IP, uint milliseconds) /*override*/;
386
387 virtual void RemoveFromBanList(char const* IP) /*override*/;
388
389 virtual void ClearBanList() /*override*/;
390
391 virtual bool IsBanned(char const* IP) /*override*/;
392
393 virtual void Ping(::RakNet::SystemAddress const target) /*override*/;
394
395 virtual bool Ping(
396 char const* host,
397 ushort remotePort,
398 bool onlyReplyOnAcceptingConnections,
399 uint connectionSocketIndex
400 ) /*override*/;
401
402 virtual int GetAveragePing(::RakNet::AddressOrGUID const systemIdentifier) /*override*/;
403
404 virtual int GetLastPing(::RakNet::AddressOrGUID const systemIdentifier) const /*override*/;
405
406 virtual int GetLowestPing(::RakNet::AddressOrGUID const systemIdentifier) const /*override*/;
407
408 virtual void SetOccasionalPing(bool doPing) /*override*/;
409
410 virtual uint64 GetClockDifferential(::RakNet::AddressOrGUID const systemIdentifier) /*override*/;
411
412 virtual void SetOfflinePingResponse(char const* data, uint const length) /*override*/;
413
414 virtual ::RakNet::SystemAddress GetInternalID(::RakNet::SystemAddress const systemAddress, int const index) const
415 /*override*/;
416
417 virtual ::RakNet::SystemAddress GetExternalID(::RakNet::SystemAddress const target) const /*override*/;
418
419 virtual ::RakNet::RakNetGUID const GetMyGUID() const /*override*/;
420
421 virtual void resetMyGUID() /*override*/;
422
423 virtual ::RakNet::SystemAddress GetMyBoundAddress(int const socketIndex) /*override*/;
424
425 virtual void SetAllowUnconnectedPings(bool unconnectedPings) /*override*/;
426
427 virtual bool GetAllowUnconnectedPings() const /*override*/;
428
429 virtual ::RakNet::RakNetGUID const& GetGuidFromSystemAddress(::RakNet::SystemAddress const input) const
430 /*override*/;
431
432 virtual ::RakNet::SystemAddress GetSystemAddressFromGuid(::RakNet::RakNetGUID const input) const /*override*/;
433
434 virtual void SetTimeoutTime(uint timeMS, ::RakNet::SystemAddress const target) /*override*/;
435
436 virtual uint GetTimeoutTime(::RakNet::SystemAddress const target) /*override*/;
437
438 virtual int GetMTUSize(::RakNet::SystemAddress const target) const /*override*/;
439
440 virtual uint GetNumberOfAdapters() /*override*/;
441
442 virtual ::RakNet::NetworkAdapter& GetLocalAdapter(uint index) /*override*/;
443
444 virtual uint GetNumberOfAddresses() /*override*/;
445
446 virtual char const* GetLocalIP(uint index) /*override*/;
447
448 virtual bool IsLocalIP(char const* ip) /*override*/;
449
450 virtual void AllowConnectionResponseIPMigration(bool allow) /*override*/;
451
452 virtual bool AdvertiseSystem(
453 char const* host,
454 ushort remotePort,
455 char const* data,
456 int dataLength,
457 uint connectionSocketIndex
458 ) /*override*/;
459
460 virtual void SetSplitMessageProgressInterval(int interval) /*override*/;
461
462 virtual int GetSplitMessageProgressInterval() const /*override*/;
463
464 virtual void SetUnreliableTimeout(uint timeoutMS) /*override*/;
465
466 virtual void SendTTL(char const* host, ushort remotePort, int ttl, uint connectionSocketIndex) /*override*/;
467
468 virtual void AttachPlugin(::RakNet::PluginInterface2* plugin) /*override*/;
469
470 virtual void DetachPlugin(::RakNet::PluginInterface2* plugin) /*override*/;
471
472 virtual void PushBackPacket(::RakNet::Packet* packet, bool pushAtHead) /*override*/;
473
474 virtual void
475 ChangeSystemAddress(::RakNet::RakNetGUID guid, ::RakNet::SystemAddress const& systemAddress) /*override*/;
476
477 virtual ::RakNet::Packet* AllocatePacket(uint dataSize) /*override*/;
478
479 virtual ::RakNet::RakNetSocket2* GetSocket(::RakNet::SystemAddress const target) /*override*/;
480
481 virtual void GetSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets) /*override*/;
482
483 virtual void ReleaseSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets) /*override*/;
484
485 virtual void WriteOutOfBandHeader(::RakNet::BitStream* bitStream) /*override*/;
486
487 virtual void SetUserUpdateThread(
488 void (*_userUpdateThreadPtr)(::RakNet::RakPeerInterface*, void*),
489 void* _userUpdateThreadData
490 ) /*override*/;
491
492 virtual void
493 SetIncomingDatagramEventHandler(bool (*_incomingDatagramEventHandler)(::RakNet::RNS2RecvStruct*)) /*override*/;
494
495 virtual void ApplyNetworkSimulator(float packetloss, ushort minExtraPing, ushort extraPingVariance) /*override*/;
496
497 virtual void SetPerConnectionOutgoingBandwidthLimit(uint maxBitsPerSecond) /*override*/;
498
499 virtual bool IsNetworkSimulatorActive() /*override*/;
500
501 virtual ::RakNet::RakNetStatistics*
502 GetStatistics(::RakNet::SystemAddress const systemAddress, ::RakNet::RakNetStatistics* rns) /*override*/;
503
504 virtual bool GetStatistics(uint const index, ::RakNet::RakNetStatistics* rns) /*override*/;
505
506 virtual void GetStatisticsList(
507 ::DataStructures::List<::RakNet::SystemAddress>& addresses,
508 ::DataStructures::List<::RakNet::RakNetGUID>& guids,
509 ::DataStructures::List<::RakNet::RakNetStatistics>& statistics
510 ) /*override*/;
511
512 virtual uint GetReceiveBufferSize() /*override*/;
513
514 virtual bool RunUpdateCycle(::RakNet::BitStream& updateBitStream) /*override*/;
515
516 virtual bool SendOutOfBand(
517 char const* host,
518 ushort remotePort,
519 char const* data,
520 uint dataLength,
521 uint connectionSocketIndex
522 ) /*override*/;
523
524 virtual void DeallocRNS2RecvStruct(::RakNet::RNS2RecvStruct* s, char const* file, uint line) /*override*/;
525
526 virtual ::RakNet::RNS2RecvStruct* AllocRNS2RecvStruct(char const* file, uint line) /*override*/;
527
528 virtual void OnRNS2Recv(::RakNet::RNS2RecvStruct* recvStruct) /*override*/;
529 // NOLINTEND
530
531public:
532 // member functions
533 // NOLINTBEGIN
534 MCAPI void AddPacketToProducer(::RakNet::Packet* p);
535
536 MCAPI ::RakNet::Packet* AllocPacket(uint dataSize, char const* file, uint line);
537
538 MCAPI bool AllowIncomingConnections() const;
539
540 MCAPI ::RakNet::RakPeer::RemoteSystemStruct* AssignSystemAddressToRemoteSystemList(
541 ::RakNet::SystemAddress const systemAddress,
542 ::RakNet::RakPeer::RemoteSystemStruct::ConnectMode connectionMode,
543 ::RakNet::RakNetSocket2* incomingRakNetSocket,
544 bool* thisIPConnectedRecently,
545 ::RakNet::SystemAddress bindingAddress,
546 int incomingMTU,
547 ::RakNet::RakNetGUID guid,
548 bool useSecurity
549 );
550
551 MCAPI void ClearBufferedCommands();
552
553 MCAPI void ClearBufferedPackets();
554
555 MCAPI void CloseConnectionInternal(
556 ::RakNet::AddressOrGUID const& systemIdentifier,
557 bool sendDisconnectionNotification,
558 bool performImmediate,
559 uchar orderingChannel,
560 ::PacketPriority disconnectionNotificationPriority
561 );
562
563 MCAPI void DereferenceRemoteSystem(::RakNet::SystemAddress const& sa);
564
565 MCAPI void FillIPList();
566
567 MCAPI int
568 GetIndexFromSystemAddress(::RakNet::SystemAddress const systemAddress, bool calledFromNetworkThread) const;
569
570 MCAPI ::RakNet::RakPeer::RemoteSystemStruct* GetRemoteSystemFromSystemAddress(
571 ::RakNet::SystemAddress const systemAddress,
572 bool calledFromNetworkThread,
573 bool onlyActive
574 ) const;
575
576 MCAPI uint GetRemoteSystemIndex(::RakNet::SystemAddress const& sa) const;
577
578 MCAPI bool IsLoopbackAddress(::RakNet::AddressOrGUID const& systemIdentifier, bool matchPort) const;
579
580 MCAPI void NotifyAndFlagForShutdown(
581 ::RakNet::SystemAddress const systemAddress,
582 bool performImmediate,
583 uchar orderingChannel,
584 ::PacketPriority disconnectionNotificationPriority
585 );
586
587 MCAPI void OnConnectionRequest(::RakNet::RakPeer::RemoteSystemStruct* remoteSystem, uint64 incomingTimestamp);
588
589 MCAPI void ParseConnectionRequestPacket(
590 ::RakNet::RakPeer::RemoteSystemStruct* remoteSystem,
591 ::RakNet::SystemAddress const& systemAddress,
592 char const* data,
593 int byteSize
594 );
595
596 MCAPI void
597 PingInternal(::RakNet::SystemAddress const target, bool performImmediate, ::PacketReliability reliability);
598
599 MCAPI RakPeer();
600
601 MCAPI void ReferenceRemoteSystem(::RakNet::SystemAddress const& sa, uint remoteSystemListIndex);
602
603 MCAPI void SendBuffered(
604 char const* data,
605 uint numberOfBitsToSend,
606 ::PacketPriority priority,
607 ::PacketReliability reliability,
608 char orderingChannel,
609 ::RakNet::AddressOrGUID const systemIdentifier,
610 bool broadcast,
611 ::RakNet::RakPeer::RemoteSystemStruct::ConnectMode connectionMode,
612 uint receipt
613 );
614
615 MCAPI bool SendImmediate(
616 char* data,
617 uint numberOfBitsToSend,
618 ::PacketPriority priority,
619 ::PacketReliability reliability,
620 char orderingChannel,
621 ::RakNet::AddressOrGUID const systemIdentifier,
622 bool broadcast,
623 bool useCallerDataAllocation,
624 uint64 currentTime,
625 uint receipt
626 );
627 // NOLINTEND
628
629public:
630 // static functions
631 // NOLINTBEGIN
632 MCAPI static void
633 CallPluginCallbacks(::DataStructures::List<::RakNet::PluginInterface2*>& pluginList, ::RakNet::Packet* packet);
634 // NOLINTEND
635
636public:
637 // constructor thunks
638 // NOLINTBEGIN
639 MCAPI void* $ctor();
640 // NOLINTEND
641
642public:
643 // virtual function thunks
644 // NOLINTBEGIN
645 MCAPI void $InitializeConfiguration(::std::unique_ptr<::RakNet::ShadowBanList> banList);
646
647 MCAPI ::RakNet::StartupResult $Startup(
648 uint maxConnections,
649 ::RakNet::SocketDescriptor* socketDescriptors,
650 uint socketDescriptorCount,
651 int threadPriority
652 );
653
654 MCFOLD bool $InitializeSecurity(char const* public_key, char const* private_key, bool bRequireClientKey);
655
656 MCFOLD void $DisableSecurity();
657
658 MCAPI void $AddToSecurityExceptionList(char const* ip);
659
660 MCAPI void $RemoveFromSecurityExceptionList(char const* ip);
661
662 MCAPI bool $IsInSecurityExceptionList(char const* ip);
663
664 MCAPI void $SetMaximumIncomingConnections(ushort numberAllowed);
665
666 MCFOLD uint $GetMaximumIncomingConnections() const;
667
668 MCAPI ushort $NumberOfConnections() const;
669
670 MCAPI void $SetIncomingPassword(char const* passwordData, int passwordDataLength);
671
672 MCAPI void $GetIncomingPassword(char* passwordData, int* passwordDataLength);
673
674 MCAPI ::RakNet::ConnectionAttemptResult $Connect(
675 char const* host,
676 ushort remotePort,
677 char const* passwordData,
678 int passwordDataLength,
679 ::RakNet::PublicKey* publicKey,
680 uint connectionSocketIndex,
681 uint sendConnectionAttemptCount,
682 uint timeBetweenSendConnectionAttemptsMS,
683 uint timeoutTime
684 );
685
686 MCAPI ::RakNet::ConnectionAttemptResult $ConnectWithSocket(
687 char const* host,
688 ushort remotePort,
689 char const* passwordData,
690 int passwordDataLength,
691 ::RakNet::RakNetSocket2* socket,
692 ::RakNet::PublicKey* publicKey,
693 uint sendConnectionAttemptCount,
694 uint timeBetweenSendConnectionAttemptsMS,
695 uint timeoutTime
696 );
697
698 MCAPI void $Shutdown(uint blockDuration, uchar orderingChannel, ::PacketPriority disconnectionNotificationPriority);
699
700 MCAPI bool $SetApplicationHandshakeCompleted(::RakNet::AddressOrGUID systemIdentifier);
701
702 MCAPI bool $IsActive() const;
703
704 MCAPI bool $GetConnectionList(::RakNet::SystemAddress* remoteSystems, ushort* numberOfSystems) const;
705
706 MCAPI uint $GetNextSendReceipt();
707
708 MCAPI uint $IncrementNextSendReceipt();
709
710 MCAPI uint $Send(
711 char const* data,
712 int const length,
713 ::PacketPriority priority,
714 ::PacketReliability reliability,
715 char orderingChannel,
716 ::RakNet::AddressOrGUID const systemIdentifier,
717 bool broadcast,
718 uint forceReceiptNumber
719 );
720
721 MCAPI uint $Send(
722 ::RakNet::BitStream const* bitStream,
723 ::PacketPriority priority,
724 ::PacketReliability reliability,
725 char orderingChannel,
726 ::RakNet::AddressOrGUID const systemIdentifier,
727 bool broadcast,
728 uint forceReceiptNumber
729 );
730
731 MCAPI void $SendLoopback(char const* data, int const length);
732
733 MCAPI uint $SendList(
734 char const** data,
735 int const* lengths,
736 int const numParameters,
737 ::PacketPriority priority,
738 ::PacketReliability reliability,
739 char orderingChannel,
740 ::RakNet::AddressOrGUID const systemIdentifier,
741 bool broadcast,
742 uint forceReceiptNumber
743 );
744
745 MCAPI ::RakNet::Packet* $Receive();
746
747 MCAPI void $DeallocatePacket(::RakNet::Packet* packet);
748
749#ifdef LL_PLAT_S
750 MCAPI uint $GetMaximumNumberOfPeers() const;
751#else // LL_PLAT_C
752 MCFOLD uint $GetMaximumNumberOfPeers() const;
753#endif
754
755 MCAPI void $CloseConnection(
756 ::RakNet::AddressOrGUID const target,
757 bool sendDisconnectionNotification,
758 uchar orderingChannel,
759 ::PacketPriority disconnectionNotificationPriority
760 );
761
762 MCAPI ::RakNet::ConnectionState $GetConnectionState(::RakNet::AddressOrGUID const systemIdentifier);
763
764 MCAPI int $GetIndexFromSystemAddress(::RakNet::SystemAddress const systemAddress) const;
765
766 MCAPI ::RakNet::RakNetGUID $GetGUIDFromIndex(uint index);
767
768 MCAPI void $GetSystemList(
771 ) const;
772
773 MCAPI void $AddToBanList(char const* IP, uint milliseconds);
774
775 MCAPI void $RemoveFromBanList(char const* IP);
776
777 MCAPI void $ClearBanList();
778
779 MCAPI bool $IsBanned(char const* IP);
780
781 MCAPI void $Ping(::RakNet::SystemAddress const target);
782
783 MCAPI bool
784 $Ping(char const* host, ushort remotePort, bool onlyReplyOnAcceptingConnections, uint connectionSocketIndex);
785
786 MCAPI int $GetAveragePing(::RakNet::AddressOrGUID const systemIdentifier);
787
788 MCAPI int $GetLastPing(::RakNet::AddressOrGUID const systemIdentifier) const;
789
790 MCAPI int $GetLowestPing(::RakNet::AddressOrGUID const systemIdentifier) const;
791
792 MCAPI void $SetOccasionalPing(bool doPing);
793
794 MCAPI uint64 $GetClockDifferential(::RakNet::AddressOrGUID const systemIdentifier);
795
796 MCAPI void $SetOfflinePingResponse(char const* data, uint const length);
797
798 MCAPI ::RakNet::SystemAddress $GetInternalID(::RakNet::SystemAddress const systemAddress, int const index) const;
799
800 MCAPI ::RakNet::SystemAddress $GetExternalID(::RakNet::SystemAddress const target) const;
801
802 MCAPI ::RakNet::RakNetGUID const $GetMyGUID() const;
803
804 MCAPI void $resetMyGUID();
805
806 MCAPI ::RakNet::SystemAddress $GetMyBoundAddress(int const socketIndex);
807
808 MCAPI void $SetAllowUnconnectedPings(bool unconnectedPings);
809
810 MCAPI bool $GetAllowUnconnectedPings() const;
811
812 MCAPI ::RakNet::RakNetGUID const& $GetGuidFromSystemAddress(::RakNet::SystemAddress const input) const;
813
814 MCAPI ::RakNet::SystemAddress $GetSystemAddressFromGuid(::RakNet::RakNetGUID const input) const;
815
816 MCAPI void $SetTimeoutTime(uint timeMS, ::RakNet::SystemAddress const target);
817
818 MCAPI uint $GetTimeoutTime(::RakNet::SystemAddress const target);
819
820 MCAPI int $GetMTUSize(::RakNet::SystemAddress const target) const;
821
822 MCAPI uint $GetNumberOfAdapters();
823
824 MCAPI ::RakNet::NetworkAdapter& $GetLocalAdapter(uint index);
825
826 MCAPI uint $GetNumberOfAddresses();
827
828 MCAPI char const* $GetLocalIP(uint index);
829
830 MCAPI bool $IsLocalIP(char const* ip);
831
832 MCAPI void $AllowConnectionResponseIPMigration(bool allow);
833
834 MCAPI bool
835 $AdvertiseSystem(char const* host, ushort remotePort, char const* data, int dataLength, uint connectionSocketIndex);
836
837 MCAPI void $SetSplitMessageProgressInterval(int interval);
838
839 MCAPI int $GetSplitMessageProgressInterval() const;
840
841 MCAPI void $SetUnreliableTimeout(uint timeoutMS);
842
843 MCAPI void $SendTTL(char const* host, ushort remotePort, int ttl, uint connectionSocketIndex);
844
845 MCAPI void $AttachPlugin(::RakNet::PluginInterface2* plugin);
846
847 MCAPI void $DetachPlugin(::RakNet::PluginInterface2* plugin);
848
849 MCAPI void $PushBackPacket(::RakNet::Packet* packet, bool pushAtHead);
850
851 MCAPI void $ChangeSystemAddress(::RakNet::RakNetGUID guid, ::RakNet::SystemAddress const& systemAddress);
852
853 MCAPI ::RakNet::Packet* $AllocatePacket(uint dataSize);
854
855 MCAPI ::RakNet::RakNetSocket2* $GetSocket(::RakNet::SystemAddress const target);
856
857 MCAPI void $GetSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets);
858
859 MCAPI void $ReleaseSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets);
860
861 MCAPI void $WriteOutOfBandHeader(::RakNet::BitStream* bitStream);
862
863 MCAPI void
864 $SetUserUpdateThread(void (*_userUpdateThreadPtr)(::RakNet::RakPeerInterface*, void*), void* _userUpdateThreadData);
865
866 MCAPI void $SetIncomingDatagramEventHandler(bool (*_incomingDatagramEventHandler)(::RakNet::RNS2RecvStruct*));
867
868 MCFOLD void $ApplyNetworkSimulator(float packetloss, ushort minExtraPing, ushort extraPingVariance);
869
870 MCAPI void $SetPerConnectionOutgoingBandwidthLimit(uint maxBitsPerSecond);
871
872 MCFOLD bool $IsNetworkSimulatorActive();
873
874 MCAPI ::RakNet::RakNetStatistics*
875 $GetStatistics(::RakNet::SystemAddress const systemAddress, ::RakNet::RakNetStatistics* rns);
876
877 MCAPI bool $GetStatistics(uint const index, ::RakNet::RakNetStatistics* rns);
878
879 MCAPI void $GetStatisticsList(
883 );
884
885 MCAPI uint $GetReceiveBufferSize();
886
887 MCAPI bool $RunUpdateCycle(::RakNet::BitStream& updateBitStream);
888
889 MCAPI bool
890 $SendOutOfBand(char const* host, ushort remotePort, char const* data, uint dataLength, uint connectionSocketIndex);
891
892 MCAPI void $DeallocRNS2RecvStruct(::RakNet::RNS2RecvStruct* s, char const* file, uint line);
893
894 MCAPI ::RakNet::RNS2RecvStruct* $AllocRNS2RecvStruct(char const* file, uint line);
895
896 MCAPI void $OnRNS2Recv(::RakNet::RNS2RecvStruct* recvStruct);
897
898
899 // NOLINTEND
900};
901
902} // namespace RakNet
Definition List.h:8
Definition BitStream.h:7
Definition PluginInterface2.h:20
Definition RNS2EventHandler.h:12
Definition RakNetSocket2.h:12
Definition RakPeerInterface.h:32
Definition RakString.h:15
Definition ShadowBanList.h:15
STL namespace.
Definition AddressOrGUID.h:10
Definition NetworkAdapter.h:7
Definition Packet.h:7
Definition PublicKey.h:7
Definition RNS2RecvStruct.h:15
Definition RakNetGUID.h:7
Definition RakNetStatistics.h:7
Definition RakPeer.h:62
Definition RakPeer.h:173
Definition RemoteSystemIndex.h:7
Definition SocketDescriptor.h:7
Definition SystemAddress.h:7