PluginInterface Class Reference

PluginInterface provides a mechanism to add functionality in a modular way. More...

#include <PluginInterface.h>

Inheritance diagram for PluginInterface:

FullyConnectedMesh PacketLogger ReplicaManager List of all members.

Public Member Functions

virtual void OnAttach (RakPeerInterface *peer)
virtual void OnDetach (RakPeerInterface *peer)
virtual void OnInitialize (RakPeerInterface *peer)
virtual void OnUpdate (RakPeerInterface *peer)
virtual int OnReceive (RakPeerInterface *peer, Packet *packet)
virtual void OnDisconnect (RakPeerInterface *peer)
virtual void OnCloseConnection (RakPeerInterface *peer, PlayerID playerId)
 Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system.
virtual bool PropagateToGame (Packet *packet) const
virtual void OnDirectSocketSend (const char *data, const unsigned bitsUsed, PlayerID remoteSystemID)
virtual void OnDirectSocketReceive (const char *data, const unsigned bitsUsed, PlayerID remoteSystemID)
virtual void OnInternalPacket (InternalPacket *internalPacket, unsigned frameNumber, PlayerID remoteSystemID, RakNetTime time, bool isSend)

Detailed Description

PluginInterface provides a mechanism to add functionality in a modular way.

MessageHandlers should derive from PluginInterface and be attached to RakPeer using the function AttachPlugin On a user call to Receive, OnReceive is called for every PluginInterface, which can then take action based on the packet passed to it. This is used to transparently add game-independent functional modules, similar to browser plugins

See also:
ReplicaManager

FullyConnectedMesh

PacketLogger


Member Function Documentation

void PluginInterface::OnAttach RakPeerInterface peer  )  [virtual]
 

Called when the interface is attached

Parameters:
[in] peer the instance of RakPeer that is calling Receive

Reimplemented in PacketLogger, and ReplicaManager.

void PluginInterface::OnDetach RakPeerInterface peer  )  [virtual]
 

Called when the interface is detached

Parameters:
[in] peer the instance of RakPeer that is calling Receive

void PluginInterface::OnDirectSocketReceive const char *  data,
const unsigned  bitsUsed,
PlayerID  remoteSystemID
[virtual]
 

Called on a receive from the socket, per datagram, that does not go through the reliability layer

Parameters:
[in] data The data being sent
[in] bitsUsed How many bits long data is
[in] remoteSystemID Which system this message is being sent to

Reimplemented in PacketLogger.

void PluginInterface::OnDirectSocketSend const char *  data,
const unsigned  bitsUsed,
PlayerID  remoteSystemID
[virtual]
 

Called on a send to the socket, per datagram, that does not go through the reliability layer

Parameters:
[in] data The data being sent
[in] bitsUsed How many bits long data is
[in] remoteSystemID Which system this message is being sent to

Reimplemented in PacketLogger.

void PluginInterface::OnDisconnect RakPeerInterface peer  )  [virtual]
 

Called when RakPeer is shutdown

Parameters:
[in] peer the instance of RakPeer that is calling Receive

Reimplemented in FullyConnectedMesh, and ReplicaManager.

void PluginInterface::OnInitialize RakPeerInterface peer  )  [virtual]
 

Called when RakPeer is initialized

Parameters:
[in] peer the instance of RakPeer that is calling Receive

void PluginInterface::OnInternalPacket InternalPacket internalPacket,
unsigned  frameNumber,
PlayerID  remoteSystemID,
RakNetTime  time,
bool  isSend
[virtual]
 

Called on a send or recieve within the reliability layer

Parameters:
[in] internalPacket The user message, along with all send data.
[in] frameNumber The number of frames sent or received so far for this player depending on isSend . Indicates the frame of this user message.
[in] remoteSystemID The player we sent or got this packet from
[in] time The current time as returned by RakNet::GetTime()
[in] isSend Is this callback representing a send event or receive event?

Reimplemented in PacketLogger.

int PluginInterface::OnReceive RakPeerInterface peer,
Packet packet
[virtual]
 

OnReceive is called for every packet.

Parameters:
[in] peer the instance of RakPeer that is calling Receive
[in] packet the packet that is being returned to the user
Returns:
2 to absorb but do not deallocate the packet, 1 to absorb and automatically deallocate the packet, 0 to allow the packet to propagate to another handler, or to the game

Reimplemented in FullyConnectedMesh, and ReplicaManager.

void PluginInterface::OnUpdate RakPeerInterface peer  )  [virtual]
 

OnUpdate is called every time a packet is checked for .

Parameters:
[in] peer - the instance of RakPeer that is calling Receive

Reimplemented in FullyConnectedMesh, and ReplicaManager.

bool PluginInterface::PropagateToGame Packet packet  )  const [virtual]
 

PropagateToGame tells RakPeer if a particular packet should be sent to the game or notIf you create a custom packet ID just for this handler you would not want to propagate it to the game, for example

Parameters:
[in] id The first byte of the packet in question
Return values:
true (default) Allow a packet to propagate to the game
Returns:
false Only let the packet be sent to message handlers

Reimplemented in FullyConnectedMesh, and ReplicaManager.


The documentation for this class was generated from the following files:
Generated on Wed May 3 09:11:55 2006 for RakNet by  doxygen 1.4.6-NO