Public Member Functions | Protected Member Functions | Protected Attributes

RakNet::RPC4Plugin Class Reference
[RPC]

The RPC4Plugin plugin is just an association between a C function pointer and a string. More...

#include <RPC4Plugin.h>

Inherits PluginInterface2.

Collaboration diagram for RakNet::RPC4Plugin:
Collaboration graph
[legend]

List of all members.

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 )

Detailed Description

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.


Constructor & Destructor Documentation

RPC4Plugin::RPC4Plugin (  ) 

Definition at line 11 of file RPC4Plugin.cpp.

RPC4Plugin::~RPC4Plugin (  )  [virtual]

Definition at line 15 of file RPC4Plugin.cpp.


Member Function Documentation

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.

Parameters:
[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.

Here is the call graph for this function:

void RPC4Plugin::CallLoopback ( const char *  uniqueID,
RakNet::BitStream bitStream 
)

Send to the attached instance of RakPeer. See RakPeerInterface::SendLoopback()

Parameters:
[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.

Here is the call graph for this function:

PluginReceiveResult RPC4Plugin::OnReceive ( Packet packet  )  [protected, virtual]

OnReceive is called for every packet.

Parameters:
[in] packet the packet that is being returned to the user
Returns:
True to allow the game and other plugins to get this message, false to absorb it

Reimplemented from PluginInterface2.

Definition at line 105 of file RPC4Plugin.cpp.

Here is the call graph for this function:

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.

Parameters:
[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
Returns:
True if the hash of uniqueID is not in use, false otherwise.

Definition at line 19 of file RPC4Plugin.cpp.

Here is the call graph for this function:

bool RPC4Plugin::UnregisterFunction ( const char *  uniqueID  ) 

Unregister a function pointer previously registered with RegisterFunction().

Parameters:
[in] Identifier originally passed to RegisterFunction()
Returns:
True if the hash of uniqueID was in use, and hence removed. false otherwise.

Definition at line 28 of file RPC4Plugin.cpp.


Member Data Documentation

Definition at line 94 of file RPC4Plugin.h.


The documentation for this class was generated from the following files: