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*/;
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 InitializeSecurity(char const*, char const*, bool) /*override*/;
266
267 virtual void DisableSecurity() /*override*/;
268
269 virtual void AddToSecurityExceptionList(char const* ip) /*override*/;
270
271 virtual void RemoveFromSecurityExceptionList(char const* ip) /*override*/;
272
273 virtual bool IsInSecurityExceptionList(char const* ip) /*override*/;
274
275 virtual void SetMaximumIncomingConnections(ushort numberAllowed) /*override*/;
276
277 virtual uint GetMaximumIncomingConnections() const /*override*/;
278
279 virtual ushort NumberOfConnections() const /*override*/;
280
281 virtual void SetIncomingPassword(char const* passwordData, int passwordDataLength) /*override*/;
282
283 virtual void GetIncomingPassword(char* passwordData, int* passwordDataLength) /*override*/;
284
285 virtual ::RakNet::ConnectionAttemptResult Connect(
286 char const* host,
287 ushort remotePort,
288 char const* passwordData,
289 int passwordDataLength,
290 ::RakNet::PublicKey* publicKey,
291 uint connectionSocketIndex,
292 uint sendConnectionAttemptCount,
293 uint timeBetweenSendConnectionAttemptsMS,
294 uint timeoutTime
295 ) /*override*/;
296
297 virtual ::RakNet::ConnectionAttemptResult ConnectWithSocket(
298 char const* host,
299 ushort remotePort,
300 char const* passwordData,
301 int passwordDataLength,
302 ::RakNet::RakNetSocket2* socket,
303 ::RakNet::PublicKey* publicKey,
304 uint sendConnectionAttemptCount,
305 uint timeBetweenSendConnectionAttemptsMS,
306 uint timeoutTime
307 ) /*override*/;
308
309 virtual void Shutdown(
310 uint blockDuration,
311 uchar orderingChannel,
312 ::PacketPriority disconnectionNotificationPriority
313 ) /*override*/;
314
315 virtual bool SetApplicationHandshakeCompleted(::RakNet::AddressOrGUID systemIdentifier) /*override*/;
316
317 virtual bool IsActive() const /*override*/;
318
319 virtual bool GetConnectionList(::RakNet::SystemAddress* remoteSystems, ushort* numberOfSystems) const /*override*/;
320
321 virtual uint GetNextSendReceipt() /*override*/;
322
323 virtual uint IncrementNextSendReceipt() /*override*/;
324
325 virtual uint Send(
326 char const* data,
327 int const length,
328 ::PacketPriority priority,
329 ::PacketReliability reliability,
330 char orderingChannel,
331 ::RakNet::AddressOrGUID const systemIdentifier,
332 bool broadcast,
333 uint forceReceiptNumber
334 ) /*override*/;
335
336 virtual uint Send(
337 ::RakNet::BitStream const* bitStream,
338 ::PacketPriority priority,
339 ::PacketReliability reliability,
340 char orderingChannel,
341 ::RakNet::AddressOrGUID const systemIdentifier,
342 bool broadcast,
343 uint forceReceiptNumber
344 ) /*override*/;
345
346 virtual void SendLoopback(char const* data, int const length) /*override*/;
347
348 virtual uint SendList(
349 char const** data,
350 int const* lengths,
351 int const numParameters,
352 ::PacketPriority priority,
353 ::PacketReliability reliability,
354 char orderingChannel,
355 ::RakNet::AddressOrGUID const systemIdentifier,
356 bool broadcast,
357 uint forceReceiptNumber
358 ) /*override*/;
359
360 virtual ::RakNet::Packet* Receive() /*override*/;
361
362 virtual void DeallocatePacket(::RakNet::Packet* packet) /*override*/;
363
364 virtual uint GetMaximumNumberOfPeers() const /*override*/;
365
366 virtual void CloseConnection(
367 ::RakNet::AddressOrGUID const target,
368 bool sendDisconnectionNotification,
369 uchar orderingChannel,
370 ::PacketPriority disconnectionNotificationPriority
371 ) /*override*/;
372
373 virtual void CancelConnectionAttempt(::RakNet::SystemAddress const target) /*override*/;
374
375 virtual ::RakNet::ConnectionState GetConnectionState(::RakNet::AddressOrGUID const systemIdentifier) /*override*/;
376
377 virtual int GetIndexFromSystemAddress(::RakNet::SystemAddress const systemAddress) const /*override*/;
378
379 virtual ::RakNet::SystemAddress GetSystemAddressFromIndex(uint index) /*override*/;
380
381 virtual ::RakNet::RakNetGUID GetGUIDFromIndex(uint index) /*override*/;
382
383 virtual void GetSystemList(
384 ::DataStructures::List<::RakNet::SystemAddress>& addresses,
385 ::DataStructures::List<::RakNet::RakNetGUID>& guids
386 ) const /*override*/;
387
388 virtual void AddToBanList(char const* IP, uint milliseconds) /*override*/;
389
390 virtual void RemoveFromBanList(char const* IP) /*override*/;
391
392 virtual void ClearBanList() /*override*/;
393
394 virtual bool IsBanned(char const* IP) /*override*/;
395
396 virtual void SetLimitIPConnectionFrequency(bool b) /*override*/;
397
398 virtual void Ping(::RakNet::SystemAddress const target) /*override*/;
399
400 virtual bool Ping(
401 char const* host,
402 ushort remotePort,
403 bool onlyReplyOnAcceptingConnections,
404 uint connectionSocketIndex
405 ) /*override*/;
406
407 virtual void SendNatTraversalMessage(::RakNet::SystemAddress const target) /*override*/;
408
409 virtual int GetAveragePing(::RakNet::AddressOrGUID const systemIdentifier) /*override*/;
410
411 virtual int GetLastPing(::RakNet::AddressOrGUID const systemIdentifier) const /*override*/;
412
413 virtual int GetLowestPing(::RakNet::AddressOrGUID const systemIdentifier) const /*override*/;
414
415 virtual void SetOccasionalPing(bool doPing) /*override*/;
416
417 virtual uint64 GetClockDifferential(::RakNet::AddressOrGUID const systemIdentifier) /*override*/;
418
419 virtual void SetOfflinePingResponse(char const* data, uint const length) /*override*/;
420
421 virtual void GetOfflinePingResponse(char** data, uint* length) /*override*/;
422
423 virtual ::RakNet::SystemAddress GetInternalID(::RakNet::SystemAddress const systemAddress, int const index) const
424 /*override*/;
425
426 virtual void SetInternalID(::RakNet::SystemAddress systemAddress, int index) /*override*/;
427
428 virtual ::RakNet::SystemAddress GetExternalID(::RakNet::SystemAddress const target) const /*override*/;
429
430 virtual ::RakNet::RakNetGUID const GetMyGUID() const /*override*/;
431
432 virtual void resetMyGUID() /*override*/;
433
434 virtual ::RakNet::SystemAddress GetMyBoundAddress(int const socketIndex) /*override*/;
435
436 virtual void SetAllowUnconnectedPings(bool unconnectedPings) /*override*/;
437
438 virtual bool GetAllowUnconnectedPings() const /*override*/;
439
440 virtual ::RakNet::RakNetGUID const& GetGuidFromSystemAddress(::RakNet::SystemAddress const input) const
441 /*override*/;
442
443 virtual ::RakNet::SystemAddress GetSystemAddressFromGuid(::RakNet::RakNetGUID const input) const /*override*/;
444
445 virtual bool GetClientPublicKeyFromSystemAddress(::RakNet::SystemAddress const, char*) const /*override*/;
446
447 virtual void SetTimeoutTime(uint timeMS, ::RakNet::SystemAddress const target) /*override*/;
448
449 virtual uint GetTimeoutTime(::RakNet::SystemAddress const target) /*override*/;
450
451 virtual int GetMTUSize(::RakNet::SystemAddress const target) const /*override*/;
452
453 virtual uint GetNumberOfAdapters() /*override*/;
454
455 virtual ::RakNet::NetworkAdapter& GetLocalAdapter(uint index) /*override*/;
456
457 virtual uint GetNumberOfAddresses() /*override*/;
458
459 virtual char const* GetLocalIP(uint index) /*override*/;
460
461 virtual bool IsLocalIP(char const* ip) /*override*/;
462
463 virtual void AllowConnectionResponseIPMigration(bool allow) /*override*/;
464
465 virtual bool AdvertiseSystem(
466 char const* host,
467 ushort remotePort,
468 char const* data,
469 int dataLength,
470 uint connectionSocketIndex
471 ) /*override*/;
472
473 virtual void SetSplitMessageProgressInterval(int interval) /*override*/;
474
475 virtual int GetSplitMessageProgressInterval() const /*override*/;
476
477 virtual void SetUnreliableTimeout(uint timeoutMS) /*override*/;
478
479 virtual void SendTTL(char const* host, ushort remotePort, int ttl, uint connectionSocketIndex) /*override*/;
480
481 virtual void AttachPlugin(::RakNet::PluginInterface2* plugin) /*override*/;
482
483 virtual void DetachPlugin(::RakNet::PluginInterface2* plugin) /*override*/;
484
485 virtual void PushBackPacket(::RakNet::Packet* packet, bool pushAtHead) /*override*/;
486
487 virtual void
488 ChangeSystemAddress(::RakNet::RakNetGUID guid, ::RakNet::SystemAddress const& systemAddress) /*override*/;
489
490 virtual ::RakNet::Packet* AllocatePacket(uint dataSize) /*override*/;
491
492 virtual ::RakNet::RakNetSocket2* GetSocket(::RakNet::SystemAddress const target) /*override*/;
493
494 virtual void GetSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets) /*override*/;
495
496 virtual void ReleaseSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets) /*override*/;
497
498 virtual void WriteOutOfBandHeader(::RakNet::BitStream* bitStream) /*override*/;
499
500 virtual void SetUserUpdateThread(
501 void (*_userUpdateThreadPtr)(::RakNet::RakPeerInterface*, void*),
502 void* _userUpdateThreadData
503 ) /*override*/;
504
505 virtual void
506 SetIncomingDatagramEventHandler(bool (*_incomingDatagramEventHandler)(::RakNet::RNS2RecvStruct*)) /*override*/;
507
508 virtual void ApplyNetworkSimulator(float, ushort, ushort) /*override*/;
509
510 virtual void SetPerConnectionOutgoingBandwidthLimit(uint maxBitsPerSecond) /*override*/;
511
512 virtual bool IsNetworkSimulatorActive() /*override*/;
513
514 virtual ::RakNet::RakNetStatistics*
515 GetStatistics(::RakNet::SystemAddress const systemAddress, ::RakNet::RakNetStatistics* rns) /*override*/;
516
517 virtual bool GetStatistics(uint const index, ::RakNet::RakNetStatistics* rns) /*override*/;
518
519 virtual void GetStatisticsList(
520 ::DataStructures::List<::RakNet::SystemAddress>& addresses,
521 ::DataStructures::List<::RakNet::RakNetGUID>& guids,
522 ::DataStructures::List<::RakNet::RakNetStatistics>& statistics
523 ) /*override*/;
524
525 virtual uint GetReceiveBufferSize() /*override*/;
526
527 virtual bool RunUpdateCycle(::RakNet::BitStream& updateBitStream) /*override*/;
528
529 virtual bool SendOutOfBand(
530 char const* host,
531 ushort remotePort,
532 char const* data,
533 uint dataLength,
534 uint connectionSocketIndex
535 ) /*override*/;
536
537 virtual void DeallocRNS2RecvStruct(::RakNet::RNS2RecvStruct* s, char const* file, uint line) /*override*/;
538
539 virtual ::RakNet::RNS2RecvStruct* AllocRNS2RecvStruct(char const*, uint) /*override*/;
540
541 virtual void OnRNS2Recv(::RakNet::RNS2RecvStruct* recvStruct) /*override*/;
542 // NOLINTEND
543
544public:
545 // member functions
546 // NOLINTBEGIN
547 MCAPI void AddPacketToProducer(::RakNet::Packet* p);
548
549 MCAPI ::RakNet::Packet* AllocPacket(uint dataSize, char const* file, uint line);
550
551 MCAPI bool AllowIncomingConnections() const;
552
553 MCAPI ::RakNet::RakPeer::RemoteSystemStruct* AssignSystemAddressToRemoteSystemList(
554 ::RakNet::SystemAddress systemAddress,
555 ::RakNet::RakPeer::RemoteSystemStruct::ConnectMode connectionMode,
556 ::RakNet::RakNetSocket2* incomingRakNetSocket,
557 bool* thisIPConnectedRecently,
558 ::RakNet::SystemAddress bindingAddress,
559 int incomingMTU,
560 ::RakNet::RakNetGUID guid,
561 bool
562 );
563
564 MCAPI void
565 CallPluginCallbacks(::DataStructures::List<::RakNet::PluginInterface2*>& pluginList, ::RakNet::Packet* packet);
566
567 MCAPI void ClearBufferedCommands();
568
569 MCAPI void ClearBufferedPackets();
570
571 MCAPI void ClearRequestedConnectionList();
572
573 MCAPI void CloseConnectionInternal(
574 ::RakNet::AddressOrGUID const& systemIdentifier,
575 bool sendDisconnectionNotification,
576 bool performImmediate,
577 uchar orderingChannel,
578 ::PacketPriority disconnectionNotificationPriority
579 );
580
581 MCAPI void DereferenceRemoteSystem(::RakNet::SystemAddress const& sa);
582
583 MCAPI void FillIPList();
584
585 MCAPI uint64 GetBestClockDifferential(::RakNet::SystemAddress systemAddress) const;
586
587 MCAPI int GetIndexFromSystemAddress(::RakNet::SystemAddress systemAddress, bool calledFromNetworkThread) const;
588
589 MCAPI ::RakNet::RakPeer::RemoteSystemStruct*
590 GetRemoteSystemFromGUID(::RakNet::RakNetGUID guid, bool onlyActive) const;
591
592 MCAPI ::RakNet::RakPeer::RemoteSystemStruct* GetRemoteSystemFromSystemAddress(
593 ::RakNet::SystemAddress systemAddress,
594 bool calledFromNetworkThread,
595 bool onlyActive
596 ) const;
597
598 MCAPI uint GetRemoteSystemIndex(::RakNet::SystemAddress const& sa) const;
599
600 MCAPI bool IsLoopbackAddress(::RakNet::AddressOrGUID const& systemIdentifier, bool matchPort) const;
601
602 MCAPI void NotifyAndFlagForShutdown(
603 ::RakNet::SystemAddress systemAddress,
604 bool performImmediate,
605 uchar orderingChannel,
606 ::PacketPriority disconnectionNotificationPriority
607 );
608
609 MCAPI void OnConnectionRequest(::RakNet::RakPeer::RemoteSystemStruct* remoteSystem, uint64 incomingTimestamp);
610
611 MCAPI void ParseConnectionRequestPacket(
612 ::RakNet::RakPeer::RemoteSystemStruct* remoteSystem,
613 ::RakNet::SystemAddress const& systemAddress,
614 char const* data,
615 int byteSize
616 );
617
618 MCAPI void PingInternal(::RakNet::SystemAddress target, bool performImmediate, ::PacketReliability reliability);
619
620 MCAPI RakPeer();
621
622 MCAPI void ReferenceRemoteSystem(::RakNet::SystemAddress const& sa, uint remoteSystemListIndex);
623
624 MCAPI void RemoveFromActiveSystemList(::RakNet::SystemAddress const& sa);
625
626 MCAPI void SendBuffered(
627 char const* data,
628 uint numberOfBitsToSend,
629 ::PacketPriority priority,
630 ::PacketReliability reliability,
631 char orderingChannel,
632 ::RakNet::AddressOrGUID systemIdentifier,
633 bool broadcast,
634 ::RakNet::RakPeer::RemoteSystemStruct::ConnectMode connectionMode,
635 uint receipt
636 );
637
638 MCAPI void SendBufferedList(
639 char const** data,
640 int const* lengths,
641 int numParameters,
642 ::PacketPriority priority,
643 ::PacketReliability reliability,
644 char orderingChannel,
645 ::RakNet::AddressOrGUID systemIdentifier,
646 bool broadcast,
647 ::RakNet::RakPeer::RemoteSystemStruct::ConnectMode connectionMode,
648 uint receipt
649 );
650
651 MCAPI ::RakNet::ConnectionAttemptResult SendConnectionRequest(
652 char const* host,
653 ushort remotePort,
654 char const* passwordData,
655 int passwordDataLength,
656 ::RakNet::PublicKey* connectionSocketIndex,
657 uint extraData,
658 uint sendConnectionAttemptCount,
659 uint timeBetweenSendConnectionAttemptsMS,
660 uint timeoutTime,
661 uint
662 );
663
664 MCAPI ::RakNet::ConnectionAttemptResult SendConnectionRequest(
665 char const* host,
666 ushort remotePort,
667 char const* passwordData,
668 int passwordDataLength,
669 ::RakNet::PublicKey* connectionSocketIndex,
670 uint extraData,
671 uint sendConnectionAttemptCount,
672 uint timeBetweenSendConnectionAttemptsMS,
673 uint timeoutTime,
674 uint socket,
675 ::RakNet::RakNetSocket2*
676 );
677
678 MCAPI bool SendImmediate(
679 char* data,
680 uint numberOfBitsToSend,
681 ::PacketPriority priority,
682 ::PacketReliability reliability,
683 char orderingChannel,
684 ::RakNet::AddressOrGUID systemIdentifier,
685 bool broadcast,
686 bool useCallerDataAllocation,
687 uint64 currentTime,
688 uint receipt
689 );
690
691 MCAPI void ShiftIncomingTimestamp(uchar* data, ::RakNet::SystemAddress const& systemAddress) const;
692 // NOLINTEND
693
694public:
695 // constructor thunks
696 // NOLINTBEGIN
697 MCAPI void* $ctor();
698 // NOLINTEND
699
700public:
701 // destructor thunk
702 // NOLINTBEGIN
703 MCAPI void $dtor();
704 // NOLINTEND
705
706public:
707 // virtual function thunks
708 // NOLINTBEGIN
709 MCAPI void $InitializeConfiguration(::std::unique_ptr<::RakNet::ShadowBanList> banList);
710
711 MCAPI ::RakNet::StartupResult $Startup(
712 uint maxConnections,
713 ::RakNet::SocketDescriptor* socketDescriptors,
714 uint socketDescriptorCount,
715 int threadPriority
716 );
717
718 MCFOLD bool $InitializeSecurity(char const*, char const*, bool);
719
720 MCFOLD void $DisableSecurity();
721
722 MCAPI void $AddToSecurityExceptionList(char const* ip);
723
724 MCAPI void $RemoveFromSecurityExceptionList(char const* ip);
725
726 MCAPI bool $IsInSecurityExceptionList(char const* ip);
727
728 MCAPI void $SetMaximumIncomingConnections(ushort numberAllowed);
729
730 MCFOLD uint $GetMaximumIncomingConnections() const;
731
732 MCAPI ushort $NumberOfConnections() const;
733
734 MCAPI void $SetIncomingPassword(char const* passwordData, int passwordDataLength);
735
736 MCAPI void $GetIncomingPassword(char* passwordData, int* passwordDataLength);
737
738 MCAPI ::RakNet::ConnectionAttemptResult $Connect(
739 char const* host,
740 ushort remotePort,
741 char const* passwordData,
742 int passwordDataLength,
743 ::RakNet::PublicKey* publicKey,
744 uint connectionSocketIndex,
745 uint sendConnectionAttemptCount,
746 uint timeBetweenSendConnectionAttemptsMS,
747 uint timeoutTime
748 );
749
750 MCAPI ::RakNet::ConnectionAttemptResult $ConnectWithSocket(
751 char const* host,
752 ushort remotePort,
753 char const* passwordData,
754 int passwordDataLength,
755 ::RakNet::RakNetSocket2* socket,
756 ::RakNet::PublicKey* publicKey,
757 uint sendConnectionAttemptCount,
758 uint timeBetweenSendConnectionAttemptsMS,
759 uint timeoutTime
760 );
761
762 MCAPI void $Shutdown(uint blockDuration, uchar orderingChannel, ::PacketPriority disconnectionNotificationPriority);
763
764 MCAPI bool $SetApplicationHandshakeCompleted(::RakNet::AddressOrGUID systemIdentifier);
765
766 MCAPI bool $IsActive() const;
767
768 MCAPI bool $GetConnectionList(::RakNet::SystemAddress* remoteSystems, ushort* numberOfSystems) const;
769
770 MCAPI uint $GetNextSendReceipt();
771
772 MCAPI uint $IncrementNextSendReceipt();
773
774 MCAPI uint $Send(
775 char const* data,
776 int const length,
777 ::PacketPriority priority,
778 ::PacketReliability reliability,
779 char orderingChannel,
780 ::RakNet::AddressOrGUID const systemIdentifier,
781 bool broadcast,
782 uint forceReceiptNumber
783 );
784
785 MCAPI uint $Send(
786 ::RakNet::BitStream const* bitStream,
787 ::PacketPriority priority,
788 ::PacketReliability reliability,
789 char orderingChannel,
790 ::RakNet::AddressOrGUID const systemIdentifier,
791 bool broadcast,
792 uint forceReceiptNumber
793 );
794
795 MCAPI void $SendLoopback(char const* data, int const length);
796
797 MCAPI uint $SendList(
798 char const** data,
799 int const* lengths,
800 int const numParameters,
801 ::PacketPriority priority,
802 ::PacketReliability reliability,
803 char orderingChannel,
804 ::RakNet::AddressOrGUID const systemIdentifier,
805 bool broadcast,
806 uint forceReceiptNumber
807 );
808
809 MCAPI ::RakNet::Packet* $Receive();
810
811 MCAPI void $DeallocatePacket(::RakNet::Packet* packet);
812
813 MCFOLD uint $GetMaximumNumberOfPeers() const;
814
815 MCAPI void $CloseConnection(
816 ::RakNet::AddressOrGUID const target,
817 bool sendDisconnectionNotification,
818 uchar orderingChannel,
819 ::PacketPriority disconnectionNotificationPriority
820 );
821
822 MCAPI void $CancelConnectionAttempt(::RakNet::SystemAddress const target);
823
824 MCAPI ::RakNet::ConnectionState $GetConnectionState(::RakNet::AddressOrGUID const systemIdentifier);
825
826 MCAPI int $GetIndexFromSystemAddress(::RakNet::SystemAddress const systemAddress) const;
827
828 MCAPI ::RakNet::SystemAddress $GetSystemAddressFromIndex(uint index);
829
830 MCAPI ::RakNet::RakNetGUID $GetGUIDFromIndex(uint index);
831
832 MCAPI void $GetSystemList(
833 ::DataStructures::List<::RakNet::SystemAddress>& addresses,
834 ::DataStructures::List<::RakNet::RakNetGUID>& guids
835 ) const;
836
837 MCAPI void $AddToBanList(char const* IP, uint milliseconds);
838
839 MCAPI void $RemoveFromBanList(char const* IP);
840
841 MCAPI void $ClearBanList();
842
843 MCAPI bool $IsBanned(char const* IP);
844
845 MCAPI void $SetLimitIPConnectionFrequency(bool b);
846
847 MCAPI void $Ping(::RakNet::SystemAddress const target);
848
849 MCAPI bool
850 $Ping(char const* host, ushort remotePort, bool onlyReplyOnAcceptingConnections, uint connectionSocketIndex);
851
852 MCAPI void $SendNatTraversalMessage(::RakNet::SystemAddress const target);
853
854 MCAPI int $GetAveragePing(::RakNet::AddressOrGUID const systemIdentifier);
855
856 MCAPI int $GetLastPing(::RakNet::AddressOrGUID const systemIdentifier) const;
857
858 MCAPI int $GetLowestPing(::RakNet::AddressOrGUID const systemIdentifier) const;
859
860 MCAPI void $SetOccasionalPing(bool doPing);
861
862 MCAPI uint64 $GetClockDifferential(::RakNet::AddressOrGUID const systemIdentifier);
863
864 MCAPI void $SetOfflinePingResponse(char const* data, uint const length);
865
866 MCAPI void $GetOfflinePingResponse(char** data, uint* length);
867
868 MCAPI ::RakNet::SystemAddress $GetInternalID(::RakNet::SystemAddress const systemAddress, int const index) const;
869
870 MCAPI void $SetInternalID(::RakNet::SystemAddress systemAddress, int index);
871
872 MCAPI ::RakNet::SystemAddress $GetExternalID(::RakNet::SystemAddress const target) const;
873
874 MCAPI ::RakNet::RakNetGUID const $GetMyGUID() const;
875
876 MCAPI void $resetMyGUID();
877
878 MCAPI ::RakNet::SystemAddress $GetMyBoundAddress(int const socketIndex);
879
880 MCAPI void $SetAllowUnconnectedPings(bool unconnectedPings);
881
882 MCAPI bool $GetAllowUnconnectedPings() const;
883
884 MCAPI ::RakNet::RakNetGUID const& $GetGuidFromSystemAddress(::RakNet::SystemAddress const input) const;
885
886 MCAPI ::RakNet::SystemAddress $GetSystemAddressFromGuid(::RakNet::RakNetGUID const input) const;
887
888 MCFOLD bool $GetClientPublicKeyFromSystemAddress(::RakNet::SystemAddress const, char*) const;
889
890 MCAPI void $SetTimeoutTime(uint timeMS, ::RakNet::SystemAddress const target);
891
892 MCAPI uint $GetTimeoutTime(::RakNet::SystemAddress const target);
893
894 MCAPI int $GetMTUSize(::RakNet::SystemAddress const target) const;
895
896 MCAPI uint $GetNumberOfAdapters();
897
898 MCAPI ::RakNet::NetworkAdapter& $GetLocalAdapter(uint index);
899
900 MCAPI uint $GetNumberOfAddresses();
901
902 MCAPI char const* $GetLocalIP(uint index);
903
904 MCAPI bool $IsLocalIP(char const* ip);
905
906 MCAPI void $AllowConnectionResponseIPMigration(bool allow);
907
908 MCAPI bool
909 $AdvertiseSystem(char const* host, ushort remotePort, char const* data, int dataLength, uint connectionSocketIndex);
910
911 MCAPI void $SetSplitMessageProgressInterval(int interval);
912
913 MCAPI int $GetSplitMessageProgressInterval() const;
914
915 MCAPI void $SetUnreliableTimeout(uint timeoutMS);
916
917 MCAPI void $SendTTL(char const* host, ushort remotePort, int ttl, uint connectionSocketIndex);
918
919 MCAPI void $AttachPlugin(::RakNet::PluginInterface2* plugin);
920
921 MCAPI void $DetachPlugin(::RakNet::PluginInterface2* plugin);
922
923 MCAPI void $PushBackPacket(::RakNet::Packet* packet, bool pushAtHead);
924
925 MCAPI void $ChangeSystemAddress(::RakNet::RakNetGUID guid, ::RakNet::SystemAddress const& systemAddress);
926
927 MCAPI ::RakNet::Packet* $AllocatePacket(uint dataSize);
928
929 MCAPI ::RakNet::RakNetSocket2* $GetSocket(::RakNet::SystemAddress const target);
930
931 MCAPI void $GetSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets);
932
933 MCAPI void $ReleaseSockets(::DataStructures::List<::RakNet::RakNetSocket2*>& sockets);
934
935 MCAPI void $WriteOutOfBandHeader(::RakNet::BitStream* bitStream);
936
937 MCAPI void
938 $SetUserUpdateThread(void (*_userUpdateThreadPtr)(::RakNet::RakPeerInterface*, void*), void* _userUpdateThreadData);
939
940 MCAPI void $SetIncomingDatagramEventHandler(bool (*_incomingDatagramEventHandler)(::RakNet::RNS2RecvStruct*));
941
942 MCFOLD void $ApplyNetworkSimulator(float, ushort, ushort);
943
944 MCAPI void $SetPerConnectionOutgoingBandwidthLimit(uint maxBitsPerSecond);
945
946 MCFOLD bool $IsNetworkSimulatorActive();
947
948 MCAPI ::RakNet::RakNetStatistics*
949 $GetStatistics(::RakNet::SystemAddress const systemAddress, ::RakNet::RakNetStatistics* rns);
950
951 MCAPI bool $GetStatistics(uint const index, ::RakNet::RakNetStatistics* rns);
952
953 MCAPI void $GetStatisticsList(
954 ::DataStructures::List<::RakNet::SystemAddress>& addresses,
955 ::DataStructures::List<::RakNet::RakNetGUID>& guids,
956 ::DataStructures::List<::RakNet::RakNetStatistics>& statistics
957 );
958
959 MCAPI uint $GetReceiveBufferSize();
960
961 MCAPI bool $RunUpdateCycle(::RakNet::BitStream& updateBitStream);
962
963 MCAPI bool
964 $SendOutOfBand(char const* host, ushort remotePort, char const* data, uint dataLength, uint connectionSocketIndex);
965
966 MCAPI void $DeallocRNS2RecvStruct(::RakNet::RNS2RecvStruct* s, char const* file, uint line);
967
968 MCAPI ::RakNet::RNS2RecvStruct* $AllocRNS2RecvStruct(char const*, uint);
969
970 MCAPI void $OnRNS2Recv(::RakNet::RNS2RecvStruct* recvStruct);
971
972
973 // NOLINTEND
974
975public:
976 // vftables
977 // NOLINTBEGIN
978 MCNAPI static void** $vftableForRakPeerInterface();
979
980 MCNAPI static void** $vftableForRNS2EventHandler();
981 // NOLINTEND
982};
983
984} // namespace RakNet
Definition BitStream.h:7
Definition PluginInterface2.h:20
Definition RNS2EventHandler.h:12
Definition RakNetSocket2.h:12
Definition RakPeerInterface.h:32
static MCAPI void ** $vftableForRakPeerInterface()
static MCAPI void ** $vftableForRNS2EventHandler()
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