The RPC4Plugin plugin is just an association between a C function pointer and a string. More...
#include <RPC4Plugin.h>
Inherits PluginInterface2.
Public Member Functions | |
RPC4Plugin () | |
virtual | ~RPC4Plugin () |
bool | RegisterFunction (const char *uniqueID, void(*functionPointer)(RakNet::BitStream *userData, Packet *packet)) |
Register a function pointer to be callable from a remote system. | |
bool | UnregisterFunction (const char *uniqueID) |
Unregister a function pointer previously registered with RegisterFunction(). | |
void | CallLoopback (const char *uniqueID, RakNet::BitStream *bitStream) |
void | Call (const char *uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast) |
Protected Member Functions | |
virtual PluginReceiveResult | OnReceive (Packet *packet) |
Protected Attributes | |
DataStructures::StringKeyedHash < void(*)(RakNet::BitStream *, Packet *), 64 | registeredFunctions ) |
The RPC4Plugin plugin is just an association between a C function pointer and a string.
It is for users that want to use RPC, but do not want to use boost. You do not have the automatic serialization or other features of RPC3, and C++ member calls are not supported.
Definition at line 50 of file RPC4Plugin.h.
RPC4Plugin::RPC4Plugin | ( | ) |
Definition at line 11 of file RPC4Plugin.cpp.
RPC4Plugin::~RPC4Plugin | ( | ) | [virtual] |
Definition at line 15 of file RPC4Plugin.cpp.
void RPC4Plugin::Call | ( | const char * | uniqueID, | |
RakNet::BitStream * | bitStream, | |||
PacketPriority | priority, | |||
PacketReliability | reliability, | |||
char | orderingChannel, | |||
const AddressOrGUID | systemIdentifier, | |||
bool | broadcast | |||
) |
Send to the specified remote instance of RakPeer.
[in] | Identifier | originally passed to RegisterFunction() on the remote system(s) |
[in] | bitStream | bitStream encoded data to send to the function callback |
[in] | priority | See RakPeerInterface::Send() |
[in] | reliability | See RakPeerInterface::Send() |
[in] | orderingChannel | See RakPeerInterface::Send() |
[in] | systemIdentifier | See RakPeerInterface::Send() |
[in] | broadcast | See RakPeerInterface::Send() |
Definition at line 93 of file RPC4Plugin.cpp.
void RPC4Plugin::CallLoopback | ( | const char * | uniqueID, | |
RakNet::BitStream * | bitStream | |||
) |
Send to the attached instance of RakPeer. See RakPeerInterface::SendLoopback()
[in] | Identifier | originally passed to RegisterFunction() on the local system |
[in] | bitStream | bitStream encoded data to send to the function callback |
Definition at line 33 of file RPC4Plugin.cpp.
PluginReceiveResult RPC4Plugin::OnReceive | ( | Packet * | packet | ) | [protected, virtual] |
OnReceive is called for every packet.
[in] | packet | the packet that is being returned to the user |
Reimplemented from PluginInterface2.
Definition at line 105 of file RPC4Plugin.cpp.
bool RPC4Plugin::RegisterFunction | ( | const char * | uniqueID, | |
void(*)(RakNet::BitStream *userData, Packet *packet) | functionPointer | |||
) |
Register a function pointer to be callable from a remote system.
The hash of the function name will be stored as an association with the function pointer When a call is made to call this function from the Call() or CallLoopback() function, the function pointer will be invoked with the passed bitStream to Call() and the actual Packet that RakNet got.
[in] | uniqueID | Identifier to be associated with functionPointer. If this identifier is already in use, the call will return false. |
[in] | functionPointer | C function pointer to be called |
Definition at line 19 of file RPC4Plugin.cpp.
bool RPC4Plugin::UnregisterFunction | ( | const char * | uniqueID | ) |
Unregister a function pointer previously registered with RegisterFunction().
[in] | Identifier | originally passed to RegisterFunction() |
Definition at line 28 of file RPC4Plugin.cpp.
DataStructures::StringKeyedHash<void ( * ) ( RakNet::BitStream *, Packet * ),64 RakNet::RPC4Plugin::registeredFunctions) [protected] |
Definition at line 94 of file RPC4Plugin.h.