From 22913217e6cd9a39bc39458efaba5e150420c0a7 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 24 Aug 2024 23:33:38 +0800 Subject: [PATCH] [raknet] Implement/match `RakClient::RPC(...)` --- raknet/RakClient.cpp | 10 ++++++++++ raknet/RakClient.h | 4 ++++ raknet/RakClientInterface.h | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/raknet/RakClient.cpp b/raknet/RakClient.cpp index c0f25b4..0030bd2 100644 --- a/raknet/RakClient.cpp +++ b/raknet/RakClient.cpp @@ -381,6 +381,16 @@ bool RakClient::RPC( char* uniqueID, RakNet::BitStream *parameters, PacketPriori return RakPeer::RPC( uniqueID, parameters, priority, reliability, orderingChannel, remoteSystemList[ 0 ].playerId, false, shiftTimestamp, networkID, replyFromTarget ); } +// SAMPSRV (adding this just as a tag for next RakNet upgrade) +bool RakClient::RPC( char* uniqueID, RakNet::BitStream *parameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, bool shiftTimestamp ) +{ + if ( remoteSystemList == 0 ) + return false; + + return RakPeer::RPC( uniqueID, parameters, priority, reliability, orderingChannel, remoteSystemList[ 0 ].playerId, false, shiftTimestamp, UNASSIGNED_NETWORK_ID, 0 ); +} +// SAMPSRV end + void RakClient::SetTrackFrequencyTable( bool b ) { RakPeer::SetCompileFrequencyTable( b ); diff --git a/raknet/RakClient.h b/raknet/RakClient.h index b6a79a1..896a8df 100644 --- a/raknet/RakClient.h +++ b/raknet/RakClient.h @@ -231,6 +231,10 @@ public: /// \return True on a successful packet send (this does not indicate the recipient performed the call), false on failure\note This is part of the Remote Procedure Call Subsystem bool RPC( char* uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, bool shiftTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget ); + // SAMPSRV (adding this just as a tag for next RakNet upgrade) + bool RPC( char* uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, bool shiftTimestamp ); + // SAMPSRV end + /// Enables or disables frequency table tracking. This is required to get a frequency table, which is used in GenerateCompressionLayer() /// This value persists between connect calls and defaults to false (no frequency tracking) /// \pre You can call this at any time - however you SHOULD only call it when disconnected. Otherwise you will only trackpart of the values sent over the network. diff --git a/raknet/RakClientInterface.h b/raknet/RakClientInterface.h index 16ea395..876019f 100644 --- a/raknet/RakClientInterface.h +++ b/raknet/RakClientInterface.h @@ -226,6 +226,10 @@ public: /// \return True on a successful packet send (this does not indicate the recipient performed the call), false on failure virtual bool RPC( char* uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, bool shiftTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget )=0; + // SAMPSRV (adding this just as a tag for next RakNet upgrade) + virtual bool RPC( char* uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, bool shiftTimestamp )=0; + // SAMPSRV end + /// Enables or disables frequency table tracking. This is required to get a frequency table, which is used in GenerateCompressionLayer() /// This value persists between connect calls and defaults to false (no frequency tracking) /// \pre You can call this at any time - however you SHOULD only call it when disconnected. Otherwise you will only trackpart of the values sent over the network.