diff --git a/raknet/RakClient.cpp b/raknet/RakClient.cpp index 3df9310..6e53e22 100644 --- a/raknet/RakClient.cpp +++ b/raknet/RakClient.cpp @@ -118,19 +118,19 @@ void RakClient::vftable_54() // TODO: RakClient::vftable_54() (saco 10034A70) (server L: 8069340) (bot W: 4032B0 L: 806CD3E) } -void RakClient::vftable_58() +void RakClient::RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) ) { - // TODO: RakClient::vftable_58() (saco 10034A80) (server L: 8069350) (bot W: 4032C0 L: 806CD4C) + RakPeer::RegisterAsRemoteProcedureCall( uniqueID, functionPointer ); } -void RakClient::vftable_5C() +void RakClient::RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer ) { - // TODO: RakClient::vftable_5C() (saco 10034A90) (server L: 8069360) (bot W: 4032D0 L: 806CD5A) + RakPeer::RegisterClassMemberRPC( uniqueID, functionPointer ); } -void RakClient::vftable_60() +void RakClient::UnregisterAsRemoteProcedureCall( unsigned char* uniqueID ) { - // TODO: RakClient::vftable_60() (saco 10034AA0) (server L: 8069370) (bot W: 4032E0 L: 806CD68) + RakPeer::UnregisterAsRemoteProcedureCall( uniqueID ); } void RakClient::vftable_64() @@ -282,4 +282,3 @@ void RakClient::vftable_D8() { // TODO: RakClient::vftable_D8() (saco 10034A20) (server L: 8069550) (bot W: 403260 L: 806CF0C) } - diff --git a/raknet/RakClient.h b/raknet/RakClient.h index bc74368..4831e72 100644 --- a/raknet/RakClient.h +++ b/raknet/RakClient.h @@ -35,9 +35,25 @@ public: void vftable_4C(); void vftable_50(); void vftable_54(); - void vftable_58(); - void vftable_5C(); - void vftable_60(); + + /// \ingroup RAKNET_RPC + /// Register a C or static member function as available for calling as a remote procedure call + /// \param[in] uniqueID: A null-terminated unique string to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions + /// \param[in] functionPointer(...): The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered + void RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) ); + + /// \ingroup RAKNET_RPC + /// Register a C++ member function as available for calling as a remote procedure call. + /// \param[in] uniqueID: A null terminated string to identify this procedure.Recommended you use the macro REGISTER_CLASS_MEMBER_RPC + /// \param[in] functionPointer: The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered with UnregisterAsRemoteProcedureCall + /// \sa ObjectMemberRPC.cpp + void RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer ); + + /// \ingroup RAKNET_RPC + /// Unregisters a C function as available for calling as a remote procedure call that was formerly registeredwith RegisterAsRemoteProcedureCallOnly call offline + /// \param[in] uniqueID A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions. Must match the parameterpassed to RegisterAsRemoteProcedureCall + void UnregisterAsRemoteProcedureCall( unsigned char* uniqueID ); + void vftable_64(); void vftable_68(); void vftable_6C(); diff --git a/raknet/RakClientInterface.h b/raknet/RakClientInterface.h index 38b7a83..103c4e9 100644 --- a/raknet/RakClientInterface.h +++ b/raknet/RakClientInterface.h @@ -30,9 +30,25 @@ public: virtual void vftable_4C()=0; virtual void vftable_50()=0; virtual void vftable_54()=0; - virtual void vftable_58()=0; - virtual void vftable_5C()=0; - virtual void vftable_60()=0; + + /// \ingroup RAKNET_RPC + /// Register a C or static member function as available for calling as a remote procedure call + /// \param[in] uniqueID: A null-terminated unique string to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions + /// \param[in] functionPointer(...): The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered + virtual void RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) )=0; + + /// \ingroup RAKNET_RPC + /// Register a C++ member function as available for calling as a remote procedure call. + /// \param[in] uniqueID: A null terminated string to identify this procedure.Recommended you use the macro REGISTER_CLASS_MEMBER_RPC + /// \param[in] functionPointer: The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered with UnregisterAsRemoteProcedureCall + /// \sa ObjectMemberRPC.cpp + virtual void RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer )=0; + + ///\ingroup RAKNET_RPC + /// Unregisters a C function as available for calling as a remote procedure call that was formerly registeredwith RegisterAsRemoteProcedureCallOnly call offline + /// \param[in] uniqueID A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions. Must match the parameterpassed to RegisterAsRemoteProcedureCall + virtual void UnregisterAsRemoteProcedureCall( unsigned char* uniqueID )=0; + virtual void vftable_64()=0; virtual void vftable_68()=0; virtual void vftable_6C()=0; diff --git a/raknet/RakPeer.cpp b/raknet/RakPeer.cpp index b569284..f67aca8 100644 --- a/raknet/RakPeer.cpp +++ b/raknet/RakPeer.cpp @@ -100,19 +100,44 @@ void RakPeer::vftable_40() // TODO: RakPeer::vftable_40() (saco W: 100385E0) (server W: 4500E0 L: 806D480) (bot W: 404080 L: 8073CD2) } -void RakPeer::vftable_44() +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Description: +// Register a C function as available for calling as a remote procedure call +// +// Parameters: +// uniqueID: A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions +// functionName(...): The name of the C function or C++ singleton to be used as a function pointer +// This can be called whether the client is active or not, and registered functions stay registered unless unregistered with +// UnregisterAsRemoteProcedureCall +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +void RakPeer::RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) ) { - // TODO: RakPeer::vftable_44() (saco W: 100385F0) (server W: 4500F0 L: 806D4C0) (bot W: 404090 L: 8073D0E) + if ( uniqueID == 0 || uniqueID[ 0 ] == 0 || functionPointer == 0 ) + return; + + rpcMap.AddIdentifierWithFunction(*uniqueID, (void*)functionPointer, false); } -void RakPeer::vftable_48() +void RakPeer::RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer ) { - // TODO: RakPeer::vftable_48() (saco W: 10038620) (server W: 450120 L: 806D4D0) (bot W: 4040C0 L: 8073D1A) + if ( uniqueID == 0 || uniqueID[ 0 ] == 0 || functionPointer == 0 ) + return; + + rpcMap.AddIdentifierWithFunction(*uniqueID, functionPointer, true); } -void RakPeer::vftable_4C() +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Description: +// Unregisters a C function as available for calling as a remote procedure call that was formerly registered +// with RegisterAsRemoteProcedureCall +// +// Parameters: +// uniqueID: A null terminated string to identify this procedure. Must match the parameter +// passed to RegisterAsRemoteProcedureCall +// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +void RakPeer::UnregisterAsRemoteProcedureCall( unsigned char* uniqueID ) { - // TODO: RakPeer::vftable_4C() (saco W: 10038650) (server W: 450150 L: 806D520) (bot W: 4040F0 L: 8073D62) + // nothing } void RakPeer::vftable_50() diff --git a/raknet/RakPeer.h b/raknet/RakPeer.h index 69ab369..7953848 100644 --- a/raknet/RakPeer.h +++ b/raknet/RakPeer.h @@ -5,6 +5,8 @@ #include "Export.h" #include "RakPeerInterface.h" +#include "RPCNode.h" +#include "RPCMap.h" class RAK_DLL_EXPORT RakPeer : public RakPeerInterface { @@ -36,9 +38,26 @@ public: void vftable_38(); void vftable_3C(); void vftable_40(); - void vftable_44(); - void vftable_48(); - void vftable_4C(); + + // --------------------------------------------------------------------------------------------Remote Procedure Call Functions - Functions to initialize and perform RPC-------------------------------------------------------------------------------------------- + /// \ingroup RAKNET_RPC + /// Register a C or static member function as available for calling as a remote procedure call + /// \param[in] uniqueID A null-terminated unique string to identify this procedure. See RegisterClassMemberRPC() for class member functions. + /// \param[in] functionPointer(...) The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered + void RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) ); + + /// \ingroup RAKNET_RPC + /// Register a C++ member function as available for calling as a remote procedure call. + /// \param[in] uniqueID A null terminated string to identify this procedure. Recommended you use the macro REGISTER_CLASS_MEMBER_RPC to create the string. Use RegisterAsRemoteProcedureCall() for static functions. + /// \param[in] functionPointer The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered with UnregisterAsRemoteProcedureCall + /// \sa The sample ObjectMemberRPC.cpp + void RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer ); + + /// \ingroup RAKNET_RPC + /// Unregisters a C function as available for calling as a remote procedure call that was formerly registered with RegisterAsRemoteProcedureCall. Only call offline. + /// \param[in] uniqueID A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions. + void UnregisterAsRemoteProcedureCall( unsigned char* uniqueID ); + void vftable_50(); void vftable_54(); void vftable_58(); @@ -94,6 +113,8 @@ protected: ///Store the maximum incoming connection allowed unsigned short maximumIncomingConnections; + RPCMap rpcMap; // Can't use StrPtrHash because runtime insertions will screw up the indices + }; #endif diff --git a/raknet/RakPeerInterface.h b/raknet/RakPeerInterface.h index 63f39a7..ab3033f 100644 --- a/raknet/RakPeerInterface.h +++ b/raknet/RakPeerInterface.h @@ -35,9 +35,26 @@ public: virtual void vftable_38()=0; virtual void vftable_3C()=0; virtual void vftable_40()=0; - virtual void vftable_44()=0; - virtual void vftable_48()=0; - virtual void vftable_4C()=0; + + // --------------------------------------------------------------------------------------------Remote Procedure Call Functions - Functions to initialize and perform RPC-------------------------------------------------------------------------------------------- + /// \ingroup RAKNET_RPC + /// Register a C or static member function as available for calling as a remote procedure call + /// \param[in] uniqueID A null-terminated unique string to identify this procedure. See RegisterClassMemberRPC() for class member functions. + /// \param[in] functionPointer(...) The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered + virtual void RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) )=0; + + /// \ingroup RAKNET_RPC + /// Register a C++ member function as available for calling as a remote procedure call. + /// \param[in] uniqueID A null terminated string to identify this procedure. Recommended you use the macro REGISTER_CLASS_MEMBER_RPC to create the string. Use RegisterAsRemoteProcedureCall() for static functions. + /// \param[in] functionPointer The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered with UnregisterAsRemoteProcedureCall + /// \sa The sample ObjectMemberRPC.cpp + virtual void RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer )=0; + + /// \ingroup RAKNET_RPC + /// Unregisters a C function as available for calling as a remote procedure call that was formerly registered with RegisterAsRemoteProcedureCall. Only call offline. + /// \param[in] uniqueID A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions. + virtual void UnregisterAsRemoteProcedureCall( unsigned char* uniqueID )=0; + virtual void vftable_50()=0; virtual void vftable_54()=0; virtual void vftable_58()=0; diff --git a/raknet/RakServer.cpp b/raknet/RakServer.cpp index 78919f1..3655f88 100644 --- a/raknet/RakServer.cpp +++ b/raknet/RakServer.cpp @@ -147,19 +147,19 @@ void RakServer::vftable_70() // TODO: RakServer::vftable_70() (server W: 45A450 L: 807C060) } -void RakServer::vftable_74() +void RakServer::RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) ) { - // TODO: RakServer::vftable_74() (server W: 45A460 L: 807C090) + RakPeer::RegisterAsRemoteProcedureCall( uniqueID, functionPointer ); } -void RakServer::vftable_78() +void RakServer::RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer ) { - // TODO: RakServer::vftable_78() (server W: 45A470 L: 807C0C0) + RakPeer::RegisterClassMemberRPC( uniqueID, functionPointer ); } -void RakServer::vftable_7C() +void RakServer::UnregisterAsRemoteProcedureCall( unsigned char* uniqueID ) { - // TODO: RakServer::vftable_7C() (server W: 45A480 L: 807C0E0) + RakPeer::UnregisterAsRemoteProcedureCall( uniqueID ); } void RakServer::vftable_80() diff --git a/raknet/RakServer.h b/raknet/RakServer.h index 7f40f12..0d4a310 100644 --- a/raknet/RakServer.h +++ b/raknet/RakServer.h @@ -54,9 +54,25 @@ public: void vftable_68(); void vftable_6C(); void vftable_70(); - void vftable_74(); - void vftable_78(); - void vftable_7C(); + + /// \ingroup RAKNET_RPC + /// Register a C or static member function as available for calling as a remote procedure call + /// \param[in] uniqueID: A null-terminated unique string to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions + /// \param[in] functionPointer The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered + void RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) ); + + /// \ingroup RAKNET_RPC + /// Register a C++ member function as available for calling as a remote procedure call. + /// \param[in] uniqueID: A null terminated string to identify this procedure.Recommended you use the macro REGISTER_CLASS_MEMBER_RPC + /// \param[in] functionPointer: The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered with UnregisterAsRemoteProcedureCall + /// \sa ObjectMemberRPC.cpp + void RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer ); + + ///\ingroup RAKNET_RPC + /// Unregisters a C function as available for calling as a remote procedure call that was formerly registeredwith RegisterAsRemoteProcedureCallOnly call offline + /// \param[in] uniqueID A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions. Must match the parameterpassed to RegisterAsRemoteProcedureCall + void UnregisterAsRemoteProcedureCall( unsigned char* uniqueID ); + void vftable_80(); void vftable_84(); void vftable_88(); diff --git a/raknet/RakServerInterface.h b/raknet/RakServerInterface.h index f154128..fd97e5f 100644 --- a/raknet/RakServerInterface.h +++ b/raknet/RakServerInterface.h @@ -51,9 +51,25 @@ public: virtual void vftable_68()=0; virtual void vftable_6C()=0; virtual void vftable_70()=0; - virtual void vftable_74()=0; - virtual void vftable_78()=0; - virtual void vftable_7C()=0; + + /// \ingroup RAKNET_RPC + /// Register a C or static member function as available for calling as a remote procedure call + /// \param[in] uniqueID: A null-terminated unique string to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions + /// \param[in] functionPointer The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered + virtual void RegisterAsRemoteProcedureCall( unsigned char* uniqueID, void ( *functionPointer ) ( RPCParameters *rpcParms ) )=0; + + /// \ingroup RAKNET_RPC + /// Register a C++ member function as available for calling as a remote procedure call. + /// \param[in] uniqueID: A null terminated string to identify this procedure.Recommended you use the macro REGISTER_CLASS_MEMBER_RPC + /// \param[in] functionPointer: The name of the function to be used as a function pointer. This can be called whether active or not, and registered functions stay registered unless unregistered with UnregisterAsRemoteProcedureCall + /// \sa ObjectMemberRPC.cpp + virtual void RegisterClassMemberRPC( unsigned char* uniqueID, void *functionPointer )=0; + + ///\ingroup RAKNET_RPC + /// Unregisters a C function as available for calling as a remote procedure call that was formerly registeredwith RegisterAsRemoteProcedureCallOnly call offline + /// \param[in] uniqueID A string of only letters to identify this procedure. Recommended you use the macro CLASS_MEMBER_ID for class member functions. Must match the parameterpassed to RegisterAsRemoteProcedureCall + virtual void UnregisterAsRemoteProcedureCall( unsigned char* uniqueID )=0; + virtual void vftable_80()=0; virtual void vftable_84()=0; virtual void vftable_88()=0;