RakNet::RPC4 Class Reference
[RPC]

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

#include <RPC4Plugin.h>

Inheritance diagram for RakNet::RPC4:

RakNet::PluginInterface2

List of all members.

Public Member Functions

bool RegisterFunction (const char *uniqueID, void(*functionPointer)(RakNet::BitStream *userData, Packet *packet))
 Register a function pointer to be callable from a remote system.
void RegisterSlot (const char *sharedIdentifier, void(*functionPointer)(RakNet::BitStream *userData, Packet *packet), int callPriority)
bool RegisterBlockingFunction (const char *uniqueID, void(*functionPointer)(RakNet::BitStream *userData, RakNet::BitStream *returnData, Packet *packet))
 Same as RegisterFunction, but is called with CallBlocking() instead of Call() and returns a value to the caller.
void RegisterLocalCallback (const char *uniqueID, MessageID messageId)
bool UnregisterFunction (const char *uniqueID)
 Unregister a function pointer previously registered with RegisterFunction().
bool UnregisterBlockingFunction (const char *uniqueID)
 Same as UnregisterFunction, except for a blocking function.
bool UnregisterLocalCallback (const char *uniqueID, MessageID messageId)
bool UnregisterSlot (const char *sharedIdentifier)
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)
bool CallBlocking (const char *uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, RakNet::BitStream *returnData)
 Same as call, but don't return until the remote system replies. Broadcasting parameter does not exist, this can only call one remote system.
void Signal (const char *sharedIdentifier, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, bool invokeLocal)
void InterruptSignal (void)
 If called while processing a slot, no further slots for the currently executing signal will be executed.

Protected Member Functions

virtual void OnAttach (void)
 Called when the interface is attached.
virtual PluginReceiveResult OnReceive (Packet *packet)

Protected Attributes

unsigned int nextSlotRegistrationCount
 Used so slots are called in the order they are registered.


Detailed Description

The RPC4 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.

Note:
You cannot use RPC4 at the same time as RPC3Plugin

Member Function Documentation

void RakNet::RPC4::Call ( const char *  uniqueID,
RakNet::BitStream bitStream,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast 
)

Deprecated:
, use Signal() Send to the specified remote instance of RakPeer.
Parameters:
[in] uniqueID 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()

bool RakNet::RPC4::CallBlocking ( const char *  uniqueID,
RakNet::BitStream bitStream,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
RakNet::BitStream returnData 
)

Same as call, but don't return until the remote system replies. Broadcasting parameter does not exist, this can only call one remote system.

Note:
This function does not return until the remote system responds, disconnects, or was never connected to begin with
Parameters:
[in] Identifier originally passed to RegisterBlockingFunction() 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()
[out] returnData Written to by the function registered with RegisterBlockingFunction.
Returns:
true if successfully called. False on disconnect, function not registered, or not connected to begin with

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

Deprecated:
Use RegisterSlot() and Signal() with your own RakNetGUID as the send target 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

virtual PluginReceiveResult RakNet::RPC4::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 RakNet::PluginInterface2.

bool RakNet::RPC4::RegisterFunction ( const char *  uniqueID,
void(*)(RakNet::BitStream *userData, Packet *packet)  functionPointer 
)

Register a function pointer to be callable from a remote system.

Deprecated:
Use RegisterSlot
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.
See also:
RegisterPacketCallback()
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.

void RakNet::RPC4::RegisterLocalCallback ( const char *  uniqueID,
MessageID  messageId 
)

Deprecated:
Use RegisterSlot and invoke on self only when the packet you want arrives When a RakNet Packet with the specified identifier is returned, execute CallLoopback() on a function previously registered with RegisterFunction() For example, you could call "OnClosedConnection" whenever you get ID_DISCONNECTION_NOTIFICATION or ID_CONNECTION_LOST
Parameters:
[in] uniqueID Identifier passed to RegisterFunction()
[in] messageId What RakNet packet ID to call on, for example ID_DISCONNECTION_NOTIFICATION or ID_CONNECTION_LOST

void RakNet::RPC4::RegisterSlot ( const char *  sharedIdentifier,
void(*)(RakNet::BitStream *userData, Packet *packet)  functionPointer,
int  callPriority 
)

Register a slot, which is a function pointer to one or more implementations that supports this function signature When a signal occurs, all slots with the same identifier are called.

Parameters:
[in] sharedIdentifier A string to identify the slot. Recommended to be the same as the name of the function.
[in] functionPtr Pointer to the function. For C, just pass the name of the function. For C++, use ARPC_REGISTER_CPP_FUNCTION
[in] callPriority Slots are called by order of the highest callPriority first. For slots with the same priority, they are called in the order they are registered

void RakNet::RPC4::Signal ( const char *  sharedIdentifier,
RakNet::BitStream bitStream,
PacketPriority  priority,
PacketReliability  reliability,
char  orderingChannel,
const AddressOrGUID  systemIdentifier,
bool  broadcast,
bool  invokeLocal 
)

Calls zero or more functions identified by sharedIdentifier registered with RegisterSlot()

Parameters:
[in] sharedIdentifier parameter of the same name passed to RegisterSlot() on the remote system
[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()
[in] invokeLocal If true, also sends to self.

bool RakNet::RPC4::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.

bool RakNet::RPC4::UnregisterLocalCallback ( const char *  uniqueID,
MessageID  messageId 
)

Remove the association created with RegisterPacketCallback()

Parameters:
[in] uniqueID Identifier passed as uniqueID to RegisterLocalCallback()
[in] messageId Identifier passed as messageId to RegisterLocalCallback()
Returns:
True if the combination of uniqueID and messageId was in use, and hence removed

bool RakNet::RPC4::UnregisterSlot ( const char *  sharedIdentifier  ) 

Remove the association created with RegisterSlot()

Parameters:
[in] sharedIdentifier Identifier passed as sharedIdentifier to RegisterSlot()


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

Generated on Wed Feb 1 13:33:48 2012 for RakNet by  doxygen 1.5.7.1