RakNet  4.0
Public Member Functions | List of all members
RakNet::PluginInterface2 Class Reference

#include <PluginInterface2.h>

Inheritance diagram for RakNet::PluginInterface2:
RakNet::AutopatcherServer RakNet::CloudClient RakNet::CloudServer RakNet::ConnectionGraph2 RakNet::FileListTransfer RakNet::FullyConnectedMesh2 RakNet::HTTPConnection2 RakNet::Lobby2Plugin RakNet::MessageFilter RakNet::NatPunchthroughClient RakNet::NatPunchthroughServer RakNet::NatTypeDetectionClient RakNet::NatTypeDetectionServer RakNet::PacketLogger RakNet::RakNetTransport2 RakNet::RakVoice RakNet::ReadyEvent RakNet::RelayPlugin RakNet::ReplicaManager3 RakNet::RoomsPlugin RakNet::Router2 RakNet::RPC3 RakNet::RPC4 RakNet::SQLite3ClientPlugin RakNet::SQLite3ServerPlugin RakNet::StatisticsHistoryPlugin RakNet::TeamBalancer RakNet::TeamManager RakNet::TwoWayAuthentication RakNet::UDPProxyClient RakNet::UDPProxyCoordinator RakNet::UDPProxyServer

Public Member Functions

virtual void OnAttach (void)
 Called when the interface is attached.
 
virtual void OnDetach (void)
 Called when the interface is detached.
 
virtual void Update (void)
 Update is called every time a packet is checked for .
 
virtual PluginReceiveResult OnReceive (Packet *packet)
 
virtual void OnRakPeerStartup (void)
 Called when RakPeer is initialized.
 
virtual void OnRakPeerShutdown (void)
 Called when RakPeer is shutdown.
 
virtual void OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
 
virtual void OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming)
 
virtual void OnFailedConnectionAttempt (Packet *packet, PI2_FailedConnectionAttemptReason failedConnectionAttemptReason)
 
virtual bool UsesReliabilityLayer (void) const
 
virtual void OnDirectSocketSend (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
 
virtual void OnDirectSocketReceive (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
 
virtual void OnReliabilityLayerNotification (const char *errorMessage, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress, bool isError)
 
virtual void OnInternalPacket (InternalPacket *internalPacket, unsigned frameNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time, int isSend)
 
virtual void OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time)
 
virtual void OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
 

Detailed Description

RakNet's plugin system. Each plugin processes the following events: -Connection attempts -The result of connection attempts -Each incoming message -Updates over time, when RakPeer::Receive() is called

Member Function Documentation

virtual void RakNet::PluginInterface2::OnAck ( unsigned int  messageNumber,
SystemAddress  remoteSystemAddress,
RakNet::TimeMS  time 
)
inlinevirtual

Called when we get an ack for a message we reliably sent

Precondition
To be called, UsesReliabilityLayer() must return true
Parameters
[in]messageNumberThe numerical identifier for which message this is
[in]remoteSystemAddressThe player we sent or got this packet from
[in]timeThe current time as returned by RakNet::GetTimeMS()

Reimplemented in RakNet::PacketLogger.

virtual void RakNet::PluginInterface2::OnClosedConnection ( const SystemAddress systemAddress,
RakNetGUID  rakNetGUID,
PI2_LostConnectionReason  lostConnectionReason 
)
inlinevirtual
virtual void RakNet::PluginInterface2::OnDirectSocketReceive ( const char *  data,
const BitSize_t  bitsUsed,
SystemAddress  remoteSystemAddress 
)
inlinevirtual

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

Precondition
To be called, UsesReliabilityLayer() must return true
Parameters
[in]dataThe data being sent
[in]bitsUsedHow many bits long data is
[in]remoteSystemAddressWhich system this message is being sent to

Reimplemented in RakNet::PacketLogger.

virtual void RakNet::PluginInterface2::OnDirectSocketSend ( const char *  data,
const BitSize_t  bitsUsed,
SystemAddress  remoteSystemAddress 
)
inlinevirtual

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

Precondition
To be called, UsesReliabilityLayer() must return true
Parameters
[in]dataThe data being sent
[in]bitsUsedHow many bits long data is
[in]remoteSystemAddressWhich system this message is being sent to

Reimplemented in RakNet::PacketLogger.

virtual void RakNet::PluginInterface2::OnFailedConnectionAttempt ( Packet packet,
PI2_FailedConnectionAttemptReason  failedConnectionAttemptReason 
)
inlinevirtual

Called when a connection attempt fails

Parameters
[in]packetPacket to be returned to the user
[in]failedConnectionReasonWhy the connection failed

Reimplemented in RakNet::FullyConnectedMesh2, RakNet::HTTPConnection2, and RakNet::Router2.

virtual void RakNet::PluginInterface2::OnInternalPacket ( InternalPacket internalPacket,
unsigned  frameNumber,
SystemAddress  remoteSystemAddress,
RakNet::TimeMS  time,
int  isSend 
)
inlinevirtual

Called on a send or receive of a message within the reliability layer

Precondition
To be called, UsesReliabilityLayer() must return true
Parameters
[in]internalPacketThe user message, along with all send data.
[in]frameNumberThe number of frames sent or received so far for this player depending on isSend . Indicates the frame of this user message.
[in]remoteSystemAddressThe player we sent or got this packet from
[in]timeThe current time as returned by RakNet::GetTimeMS()
[in]isSendIs this callback representing a send event or receive event?

Reimplemented in RakNet::PacketLogger.

virtual void RakNet::PluginInterface2::OnNewConnection ( const SystemAddress systemAddress,
RakNetGUID  rakNetGUID,
bool  isIncoming 
)
inlinevirtual

Called when we got a new connection

Parameters
[in]systemAddressAddress of the new connection
[in]rakNetGuidThe guid of the specified system
[in]isIncomingIf true, this is ID_NEW_INCOMING_CONNECTION, or the equivalent

Reimplemented in RakNet::TeamManager, RakNet::ReplicaManager3, RakNet::StatisticsHistoryPlugin, RakNet::FullyConnectedMesh2, RakNet::NatPunchthroughClient, RakNet::MessageFilter, RakNet::ConnectionGraph2, RakNet::HTTPConnection2, RakNet::NatPunchthroughServer, and RakNet::RakNetTransport2.

virtual void RakNet::PluginInterface2::OnPushBackPacket ( const char *  data,
const BitSize_t  bitsUsed,
SystemAddress  remoteSystemAddress 
)
inlinevirtual

System called RakPeerInterface::PushBackPacket

Parameters
[in]dataThe data being sent
[in]bitsUsedHow many bits long data is
[in]remoteSystemAddressThe player we sent or got this packet from

Reimplemented in RakNet::PacketLogger.

virtual PluginReceiveResult RakNet::PluginInterface2::OnReceive ( Packet packet)
inlinevirtual
virtual void RakNet::PluginInterface2::OnReliabilityLayerNotification ( const char *  errorMessage,
const BitSize_t  bitsUsed,
SystemAddress  remoteSystemAddress,
bool  isError 
)
inlinevirtual

Called when the reliability layer rejects a send or receive

Precondition
To be called, UsesReliabilityLayer() must return true
Parameters
[in]bitsUsedHow many bits long data is
[in]remoteSystemAddressWhich system this message is being sent to

Reimplemented in RakNet::PacketLogger.

virtual bool RakNet::PluginInterface2::UsesReliabilityLayer ( void  ) const
inlinevirtual

Queried when attached to RakPeer Return true to call OnDirectSocketSend(), OnDirectSocketReceive(), OnReliabilityLayerNotification(), OnInternalPacket(), and OnAck() If true, then you cannot call RakPeer::AttachPlugin() or RakPeer::DetachPlugin() for this plugin, while RakPeer is active

Reimplemented in RakNet::PacketLogger.


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