SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes
UDPProxy
Plugins

Forwards UDP datagrams from one system to another. Protocol independent. More...

## Classes

struct | SLNet::UDPProxyClientResultHandler
class | SLNet::UDPProxyClient
| Communicates with UDPProxyCoordinator, in order to find a UDPProxyServer to forward our datagrams. More...
struct | SLNet::UDPProxyServerResultHandler
class | SLNet::UDPProxyServer
| UDPProxyServer to control our instance of UDPForwarder. More...
struct | SLNet::UDPProxyClient::PingServerGroup
struct | SLNet::UDPProxyClient::SenderAndTargetAddress
struct | SLNet::UDPProxyClient::ServerWithPing

## Detailed Description

Forwards UDP datagrams from one system to another. Protocol independent.

Used when NatPunchthroughClient fails

## Class Documentation

struct SLNet::UDPProxyClientResultHandler

Callback to handle results of calling UDPProxyClient::RequestForwarding()

Definition at line 42 of file UDPProxyClient.h.

### Public Member Functions

| UDPProxyClientResultHandler ()
virtual | ~UDPProxyClientResultHandler ()
virtual void | OnForwardingSuccess (const char *proxyIPAddress, unsigned short proxyPort, SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddress, RakNetGUID targetGuid, SLNet::UDPProxyClient *proxyClientPlugin)=0
virtual void | OnForwardingNotification (const char *proxyIPAddress, unsigned short proxyPort, SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddress, RakNetGUID targetGuid, SLNet::UDPProxyClient *proxyClientPlugin)=0
virtual void | OnNoServersOnline (SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddress, RakNetGUID targetGuid, SLNet::UDPProxyClient *proxyClientPlugin)=0
virtual void | OnRecipientNotConnected (SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddress, RakNetGUID targetGuid, SLNet::UDPProxyClient *proxyClientPlugin)=0
virtual void | OnAllServersBusy (SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddress, RakNetGUID targetGuid, SLNet::UDPProxyClient *proxyClientPlugin)=0
virtual void | OnForwardingInProgress (const char *proxyIPAddress, unsigned short proxyPort, SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddress, RakNetGUID targetGuid, SLNet::UDPProxyClient *proxyClientPlugin)=0

#### Constructor & Destructor Documentation

SLNet::UDPProxyClientResultHandler::UDPProxyClientResultHandler | ( |  | ) |

inline

Definition at line 44 of file UDPProxyClient.h.

virtual SLNet::UDPProxyClientResultHandler::~UDPProxyClientResultHandler | ( |  | ) |

inlinevirtual

Definition at line 45 of file UDPProxyClient.h.

#### Member Function Documentation

virtual void SLNet::UDPProxyClientResultHandler::OnAllServersBusy | ( | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | SystemAddress | targetAddress,
|  | RakNetGUID | targetGuid,
|  | SLNet::UDPProxyClient * | proxyClientPlugin
| ) |  |

pure virtual

Called when our forwarding request failed, because all UDPProxyServers that are connected to UDPProxyCoordinator are at their capacity Either add more servers, or increase capacity via UDPForwarder::SetMaxForwardEntries()

Parameters

  [out] | proxyCoordinator | proxyCoordinator parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | sourceAddress | sourceAddress parameter passed to UDPProxyClient::RequestForwarding. If it was UNASSIGNED_SYSTEM_ADDRESS, it is now our external IP address.
  [out] | targetAddress | targetAddress parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | targetGuid | targetGuid parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | proxyClient | The plugin that is calling this callback

virtual void SLNet::UDPProxyClientResultHandler::OnForwardingInProgress | ( | const char * | proxyIPAddress,
|  | unsigned short | proxyPort,
|  | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | SystemAddress | targetAddress,
|  | RakNetGUID | targetGuid,
|  | SLNet::UDPProxyClient * | proxyClientPlugin
| ) |  |

pure virtual

Called when our forwarding request is already in progress on the proxyCoordinator. This can be ignored, but indicates an unneeded second request

Parameters

  [out] | proxyIPAddress | IP Address of the proxy server, which is forwarding messages to targetAddress
  [out] | proxyPort | Remote port to use on the proxy server, which is forwarding messages to targetAddress
  [out] | proxyCoordinator | proxyCoordinator parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | sourceAddress | sourceAddress parameter passed to UDPProxyClient::RequestForwarding. If it was UNASSIGNED_SYSTEM_ADDRESS, it is now our external IP address.
  [out] | targetAddress | targetAddress parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | targetGuid | targetGuid parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | proxyClient | The plugin that is calling this callback

virtual void SLNet::UDPProxyClientResultHandler::OnForwardingNotification | ( | const char * | proxyIPAddress,
|  | unsigned short | proxyPort,
|  | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | SystemAddress | targetAddress,
|  | RakNetGUID | targetGuid,
|  | SLNet::UDPProxyClient * | proxyClientPlugin
| ) |  |

pure virtual

Called when another system has setup forwarding, with our system as the target address. Plugin automatically sends a datagram to proxyIPAddress before this callback, to open our router if necessary.

Parameters

  [out] | proxyIPAddress | IP Address of the proxy server, which will forward messages to targetAddress
  [out] | proxyPort | Remote port to use on the proxy server, which will forward messages to targetAddress
  [out] | proxyCoordinator | proxyCoordinator parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | sourceAddress | sourceAddress parameter passed to UDPProxyClient::RequestForwarding. This is originating source IP address of the remote system that will be sending to us.
  [out] | targetAddress | targetAddress parameter originally passed to UDPProxyClient::RequestForwarding. This is our external IP address.
  [out] | targetGuid | targetGuid parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | proxyClient | The plugin that is calling this callback

virtual void SLNet::UDPProxyClientResultHandler::OnForwardingSuccess | ( | const char * | proxyIPAddress,
|  | unsigned short | proxyPort,
|  | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | SystemAddress | targetAddress,
|  | RakNetGUID | targetGuid,
|  | SLNet::UDPProxyClient * | proxyClientPlugin
| ) |  |

pure virtual

Called when our forwarding request was completed. We can now connect to targetAddress by using proxyAddress instead

Parameters

  [out] | proxyIPAddress | IP Address of the proxy server, which will forward messages to targetAddress
  [out] | proxyPort | Remote port to use on the proxy server, which will forward messages to targetAddress
  [out] | proxyCoordinator | proxyCoordinator parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | sourceAddress | sourceAddress parameter passed to UDPProxyClient::RequestForwarding. If it was UNASSIGNED_SYSTEM_ADDRESS, it is now our external IP address.
  [out] | targetAddress | targetAddress parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | targetGuid | targetGuid parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | proxyClient | The plugin that is calling this callback

virtual void SLNet::UDPProxyClientResultHandler::OnNoServersOnline | ( | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | SystemAddress | targetAddress,
|  | RakNetGUID | targetGuid,
|  | SLNet::UDPProxyClient * | proxyClientPlugin
| ) |  |

pure virtual

Called when our forwarding request failed, because no UDPProxyServers are connected to UDPProxyCoordinator

Parameters

  [out] | proxyCoordinator | proxyCoordinator parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | sourceAddress | sourceAddress parameter passed to UDPProxyClient::RequestForwarding. If it was UNASSIGNED_SYSTEM_ADDRESS, it is now our external IP address.
  [out] | targetAddress | targetAddress parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | targetGuid | targetGuid parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | proxyClient | The plugin that is calling this callback

virtual void SLNet::UDPProxyClientResultHandler::OnRecipientNotConnected | ( | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | SystemAddress | targetAddress,
|  | RakNetGUID | targetGuid,
|  | SLNet::UDPProxyClient * | proxyClientPlugin
| ) |  |

pure virtual

Called when our forwarding request failed, because no UDPProxyServers are connected to UDPProxyCoordinator

Parameters

  [out] | proxyCoordinator | proxyCoordinator parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | sourceAddress | sourceAddress parameter passed to UDPProxyClient::RequestForwarding. If it was UNASSIGNED_SYSTEM_ADDRESS, it is now our external IP address.
  [out] | targetAddress | targetAddress parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | targetGuid | targetGuid parameter originally passed to UDPProxyClient::RequestForwarding
  [out] | proxyClient | The plugin that is calling this callback

class SLNet::UDPProxyClient

Communicates with UDPProxyCoordinator, in order to find a UDPProxyServer to forward our datagrams.

When NAT Punchthrough fails, it is possible to use a non-NAT system to forward messages from us to the recipient, and vice-versa.
The class to forward messages is UDPForwarder, and it is triggered over the network via the UDPProxyServer plugin.
The UDPProxyClient connects to UDPProxyCoordinator to get a list of servers running UDPProxyServer, and the coordinator will relay our forwarding request

See Also
  NatPunchthroughServer
  NatPunchthroughClient

Definition at line 115 of file UDPProxyClient.h.

Inheritance diagram for SLNet::UDPProxyClient:

### Public Member Functions

| UDPProxyClient ()
| ~UDPProxyClient ()
void | SetResultHandler (UDPProxyClientResultHandler *rh)
bool | RequestForwarding (SystemAddress proxyCoordinator, SystemAddress sourceAddress, SystemAddress targetAddressAsSeenFromCoordinator, SLNet::TimeMS timeoutOnNoDataMS, SLNet::BitStream *serverSelectionBitstream=0)
bool | RequestForwarding (SystemAddress proxyCoordinator, SystemAddress sourceAddress, RakNetGUID targetGuid, SLNet::TimeMS timeoutOnNoDataMS, SLNet::BitStream *serverSelectionBitstream=0)
virtual void | Update (void)
| Update is called every time a packet is checked for .
virtual PluginReceiveResult | OnReceive (Packet *packet)
virtual void | OnRakPeerShutdown (void)
| Called when RakPeer is shutdown.
Public Member Functions inherited from SLNet::PluginInterface2
| PluginInterface2 ()
virtual | ~PluginInterface2 ()
virtual void | OnAttach (void)
| Called when the interface is attached.
virtual void | OnDetach (void)
| Called when the interface is detached.
virtual void | OnRakPeerStartup (void)
| Called when RakPeer is initialized.
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, SLNet::TimeMS time, int isSend)
virtual void | OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, SLNet::TimeMS time)
virtual void | OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
RakPeerInterface * | GetRakPeerInterface (void) const
RakNetGUID | GetMyGUIDUnified (void) const
void | SetRakPeerInterface (RakPeerInterface *ptr)
void | SetTCPInterface (TCPInterface *ptr)

### Public Attributes

DataStructures::List < PingServerGroup * > | pingServerGroups

### Protected Member Functions

void | OnPingServers (Packet *packet)
void | Clear (void)
Protected Member Functions inherited from SLNet::PluginInterface2
void | SendUnified (const SLNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
void | SendUnified (const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
bool | SendListUnified (const char **data, const int *lengths, const int numParameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
Packet * | AllocatePacketUnified (unsigned dataSize)
void | PushBackPacketUnified (Packet *packet, bool pushAtHead)
void | DeallocPacketUnified (Packet *packet)

### Protected Attributes

UDPProxyClientResultHandler * | resultHandler
Protected Attributes inherited from SLNet::PluginInterface2
RakPeerInterface * | rakPeerInterface
TCPInterface * | tcpInterface

#### Constructor & Destructor Documentation

SLNet::UDPProxyClient::UDPProxyClient | ( |  | ) |

SLNet::UDPProxyClient::~UDPProxyClient | ( |  | ) |

#### Member Function Documentation

void SLNet::UDPProxyClient::Clear | ( | void |  | ) |

protected

void SLNet::UDPProxyClient::OnPingServers | ( | Packet * | packet | ) |

protected

virtual void SLNet::UDPProxyClient::OnRakPeerShutdown | ( | void |  | ) |

virtual

Called when RakPeer is shutdown.

Reimplemented from SLNet::PluginInterface2.

virtual PluginReceiveResult SLNet::UDPProxyClient::OnReceive | ( | Packet * | packet | ) |

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 SLNet::PluginInterface2.

bool SLNet::UDPProxyClient::RequestForwarding | ( | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | SystemAddress | targetAddressAsSeenFromCoordinator,
|  | SLNet::TimeMS | timeoutOnNoDataMS,
|  | SLNet::BitStream * | serverSelectionBitstream = `0`
| ) |  |

Sends a request to proxyCoordinator to find a server and have that server setup UDPForwarder::StartForwarding() on our address to targetAddressAsSeenFromCoordinator The forwarded datagrams can be from any UDP source, not just RakNet

Precondition
  Must be connected to proxyCoordinator
  Systems running UDPProxyServer must be connected to proxyCoordinator and logged in via UDPProxyCoordinator::LoginServer() or UDPProxyServer::LoginToCoordinator()

Note
  May still fail, if all proxy servers have no open connections.
  RakNet's protocol will ensure a message is sent at least every 5 seconds, so if routing RakNet messages, it is a reasonable value for timeoutOnNoDataMS, plus an extra few seconds for latency.

Parameters

  [in] | proxyCoordinator | System we are connected to that is running the UDPProxyCoordinator plugin
  [in] | sourceAddress | External IP address of the system we want to forward messages from. This does not have to be our own system. To specify our own system, you can pass UNASSIGNED_SYSTEM_ADDRESS which the coordinator will treat as our external IP address.

  [in]

  targetAddressAsSeenFromCoordinator

  External IP address of the system we want to forward messages to. If this system is connected to UDPProxyCoordinator at this address using RakNet, that system will ping the server and thus open the router for incoming communication. In any other case, you are responsible for doing your own network communication to have that system ping the server. See also targetGuid in the other version of RequestForwarding(), to avoid the need to know the IP address to the coordinator of the destination.

  [in] | timeoutOnNoData | If no data is sent by the forwarded systems, how long before removing the forward entry from UDPForwarder? UDP_FORWARDER_MAXIMUM_TIMEOUT is the maximum value. Recommended 10 seconds.
  [in] | serverSelectionBitstream | If you want to send data to UDPProxyCoordinator::GetBestServer(), write it here

Returns
  true if the request was sent, false if we are not connected to proxyCoordinator

bool SLNet::UDPProxyClient::RequestForwarding | ( | SystemAddress | proxyCoordinator,
|  | SystemAddress | sourceAddress,
|  | RakNetGUID | targetGuid,
|  | SLNet::TimeMS | timeoutOnNoDataMS,
|  | SLNet::BitStream * | serverSelectionBitstream = `0`
| ) |  |

Same as above, but specify the target with a GUID, in case you don't know what its address is to the coordinator If requesting forwarding to a RakNet enabled system, then it is easier to use targetGuid instead of targetAddressAsSeenFromCoordinator

void SLNet::UDPProxyClient::SetResultHandler | ( | UDPProxyClientResultHandler * | rh | ) |

Receives the results of calling RequestForwarding() Set before calling RequestForwarding or you won't know what happened

Parameters

  [in] | resultHandler |

virtual void SLNet::UDPProxyClient::Update | ( | void |  | ) |

virtual

Update is called every time a packet is checked for .

Reimplemented from SLNet::PluginInterface2.

#### Member Data Documentation

DataStructures::List<PingServerGroup*> SLNet::UDPProxyClient::pingServerGroups

Definition at line 173 of file UDPProxyClient.h.

UDPProxyClientResultHandler* SLNet::UDPProxyClient::resultHandler

protected

Definition at line 178 of file UDPProxyClient.h.

struct SLNet::UDPProxyServerResultHandler

Callback to handle results of calling UDPProxyServer::LoginToCoordinator()

Definition at line 39 of file UDPProxyServer.h.

### Public Member Functions

| UDPProxyServerResultHandler ()
virtual | ~UDPProxyServerResultHandler ()
virtual void | OnLoginSuccess (SLNet::RakString usedPassword, SLNet::UDPProxyServer *proxyServerPlugin)=0
virtual void | OnAlreadyLoggedIn (SLNet::RakString usedPassword, SLNet::UDPProxyServer *proxyServerPlugin)=0
virtual void | OnNoPasswordSet (SLNet::RakString usedPassword, SLNet::UDPProxyServer *proxyServerPlugin)=0
virtual void | OnWrongPassword (SLNet::RakString usedPassword, SLNet::UDPProxyServer *proxyServerPlugin)=0

#### Constructor & Destructor Documentation

SLNet::UDPProxyServerResultHandler::UDPProxyServerResultHandler | ( |  | ) |

inline

Definition at line 41 of file UDPProxyServer.h.

virtual SLNet::UDPProxyServerResultHandler::~UDPProxyServerResultHandler | ( |  | ) |

inlinevirtual

Definition at line 42 of file UDPProxyServer.h.

#### Member Function Documentation

virtual void SLNet::UDPProxyServerResultHandler::OnAlreadyLoggedIn | ( | SLNet::RakString | usedPassword,
|  | SLNet::UDPProxyServer * | proxyServerPlugin
| ) |  |

pure virtual

We are already logged in. This login failed, but the system is operational as if it succeeded

Parameters

  [out] | usedPassword | The password we passed to UDPProxyServer::LoginToCoordinator()
  [out] | proxyServer | The plugin calling this callback

virtual void SLNet::UDPProxyServerResultHandler::OnLoginSuccess | ( | SLNet::RakString | usedPassword,
|  | SLNet::UDPProxyServer * | proxyServerPlugin
| ) |  |

pure virtual

Called when our login succeeds

Parameters

  [out] | usedPassword | The password we passed to UDPProxyServer::LoginToCoordinator()
  [out] | proxyServer | The plugin calling this callback

virtual void SLNet::UDPProxyServerResultHandler::OnNoPasswordSet | ( | SLNet::RakString | usedPassword,
|  | SLNet::UDPProxyServer * | proxyServerPlugin
| ) |  |

pure virtual

The coordinator operator forgot to call UDPProxyCoordinator::SetRemoteLoginPassword()

Parameters

  [out] | usedPassword | The password we passed to UDPProxyServer::LoginToCoordinator()
  [out] | proxyServer | The plugin calling this callback

virtual void SLNet::UDPProxyServerResultHandler::OnWrongPassword | ( | SLNet::RakString | usedPassword,
|  | SLNet::UDPProxyServer * | proxyServerPlugin
| ) |  |

pure virtual

The coordinator operator set a different password in UDPProxyCoordinator::SetRemoteLoginPassword() than what we passed

Parameters

  [out] | usedPassword | The password we passed to UDPProxyServer::LoginToCoordinator()
  [out] | proxyServer | The plugin calling this callback

class SLNet::UDPProxyServer

UDPProxyServer to control our instance of UDPForwarder.

When NAT Punchthrough fails, it is possible to use a non-NAT system to forward messages from us to the recipient, and vice-versa.
The class to forward messages is UDPForwarder, and it is triggered over the network via the UDPProxyServer plugin.
The UDPProxyServer connects to UDPProxyServer to get a list of servers running UDPProxyServer, and the coordinator will relay our forwarding request.

Definition at line 71 of file UDPProxyServer.h.

Inheritance diagram for SLNet::UDPProxyServer:

### Public Member Functions

| UDPProxyServer ()
| ~UDPProxyServer ()
void | SetSocketFamily (unsigned short _socketFamily)
void | SetResultHandler (UDPProxyServerResultHandler *rh)
bool | LoginToCoordinator (SLNet::RakString password, SystemAddress coordinatorAddress)
void | SetServerPublicIP (RakString ip)
| The server IP reported to the client is the IP address from the server to the coordinator. If the server and coordinator are on the same LAN, you need to call SetServerPublicIP() to tell the client what address to connect to.
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 | OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual void | OnRakPeerStartup (void)
| Called when RakPeer is initialized.
virtual void | OnRakPeerShutdown (void)
| Called when RakPeer is shutdown.
Public Member Functions inherited from SLNet::PluginInterface2
| PluginInterface2 ()
virtual | ~PluginInterface2 ()
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, SLNet::TimeMS time, int isSend)
virtual void | OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, SLNet::TimeMS time)
virtual void | OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
RakPeerInterface * | GetRakPeerInterface (void) const
RakNetGUID | GetMyGUIDUnified (void) const
void | SetRakPeerInterface (RakPeerInterface *ptr)
void | SetTCPInterface (TCPInterface *ptr)

### Public Attributes

UDPForwarder | udpForwarder

### Protected Member Functions

void | OnForwardingRequestFromCoordinatorToServer (Packet *packet)
Protected Member Functions inherited from SLNet::PluginInterface2
void | SendUnified (const SLNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
void | SendUnified (const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
bool | SendListUnified (const char **data, const int *lengths, const int numParameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
Packet * | AllocatePacketUnified (unsigned dataSize)
void | PushBackPacketUnified (Packet *packet, bool pushAtHead)
void | DeallocPacketUnified (Packet *packet)

### Protected Attributes

DataStructures::OrderedList < SystemAddress, SystemAddress > | loggingInCoordinators
DataStructures::OrderedList < SystemAddress, SystemAddress > | loggedInCoordinators
UDPProxyServerResultHandler * | resultHandler
unsigned short | socketFamily
RakString | serverPublicIp
Protected Attributes inherited from SLNet::PluginInterface2
RakPeerInterface * | rakPeerInterface
TCPInterface * | tcpInterface

#### Constructor & Destructor Documentation

SLNet::UDPProxyServer::UDPProxyServer | ( |  | ) |

SLNet::UDPProxyServer::~UDPProxyServer | ( |  | ) |

#### Member Function Documentation

bool SLNet::UDPProxyServer::LoginToCoordinator | ( | SLNet::RakString | password,
|  | SystemAddress | coordinatorAddress
| ) |  |

Before the coordinator will register the UDPProxyServer, you must login

Precondition
  Must be connected to the coordinator
  Coordinator must have set a password with UDPProxyCoordinator::SetRemoteLoginPassword()

Returns
  false if already logged in, or logging in. Returns true otherwise

virtual void SLNet::UDPProxyServer::OnAttach | ( | void |  | ) |

virtual

Called when the interface is attached.

Reimplemented from SLNet::PluginInterface2.

virtual void SLNet::UDPProxyServer::OnClosedConnection | ( | const SystemAddress & | systemAddress,
|  | RakNetGUID | rakNetGUID,
|  | PI2_LostConnectionReason | lostConnectionReason
| ) |  |

virtual

Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system

Parameters

  [in] | systemAddress | The system whose connection was closed
  [in] | rakNetGuid | The guid of the specified system
  [in] | lostConnectionReason | How the connection was closed: manually, connection lost, or notification of disconnection

Reimplemented from SLNet::PluginInterface2.

virtual void SLNet::UDPProxyServer::OnDetach | ( | void |  | ) |

virtual

Called when the interface is detached.

Reimplemented from SLNet::PluginInterface2.

void SLNet::UDPProxyServer::OnForwardingRequestFromCoordinatorToServer | ( | Packet * | packet | ) |

protected

virtual void SLNet::UDPProxyServer::OnRakPeerShutdown | ( | void |  | ) |

virtual

Called when RakPeer is shutdown.

Reimplemented from SLNet::PluginInterface2.

virtual void SLNet::UDPProxyServer::OnRakPeerStartup | ( | void |  | ) |

virtual

Called when RakPeer is initialized.

Reimplemented from SLNet::PluginInterface2.

virtual PluginReceiveResult SLNet::UDPProxyServer::OnReceive | ( | Packet * | packet | ) |

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 SLNet::PluginInterface2.

void SLNet::UDPProxyServer::SetResultHandler | ( | UDPProxyServerResultHandler * | rh | ) |

Receives the results of calling LoginToCoordinator() Set before calling LoginToCoordinator or you won't know what happened

Parameters

  [in] | resultHandler |

void SLNet::UDPProxyServer::SetServerPublicIP | ( | RakString | ip | ) |

The server IP reported to the client is the IP address from the server to the coordinator. If the server and coordinator are on the same LAN, you need to call SetServerPublicIP() to tell the client what address to connect to.

Parameters

  [in] | ip | IP address to report in UDPProxyClientResultHandler::OnForwardingSuccess() and UDPProxyClientResultHandler::OnForwardingNotification() as proxyIPAddress

void SLNet::UDPProxyServer::SetSocketFamily | ( | unsigned short | _socketFamily | ) |

Sets the socket family to use, either IPV4 or IPV6

Parameters

  [in] | socketFamily | For IPV4, use AF_INET (default). For IPV6, use AF_INET6. To autoselect, use AF_UNSPEC.

virtual void SLNet::UDPProxyServer::Update | ( | void |  | ) |

virtual

Update is called every time a packet is checked for .

Reimplemented from SLNet::PluginInterface2.

#### Member Data Documentation

DataStructures::OrderedList<SystemAddress, SystemAddress> SLNet::UDPProxyServer::loggedInCoordinators

protected

Definition at line 119 of file UDPProxyServer.h.

DataStructures::OrderedList<SystemAddress, SystemAddress> SLNet::UDPProxyServer::loggingInCoordinators

protected

Definition at line 118 of file UDPProxyServer.h.

UDPProxyServerResultHandler* SLNet::UDPProxyServer::resultHandler

protected

Definition at line 121 of file UDPProxyServer.h.

RakString SLNet::UDPProxyServer::serverPublicIp

protected

Definition at line 123 of file UDPProxyServer.h.

unsigned short SLNet::UDPProxyServer::socketFamily

protected

Definition at line 122 of file UDPProxyServer.h.

UDPForwarder SLNet::UDPProxyServer::udpForwarder

Operative class that performs the forwarding Exposed so you can call UDPForwarder::SetMaxForwardEntries() if you want to change away from the default UDPForwarder::Startup(), UDPForwarder::Shutdown(), and UDPForwarder::Update() are called automatically by the plugin

Definition at line 103 of file UDPProxyServer.h.

struct SLNet::UDPProxyClient::PingServerGroup

Definition at line 162 of file UDPProxyClient.h.

### Public Member Functions

bool | AreAllServersPinged (void) const
void | SendPingedServersToCoordinator (RakPeerInterface *rakPeer)

### Public Attributes

SenderAndTargetAddress | sata
SLNet::TimeMS | startPingTime
SystemAddress | coordinatorAddressForPings
DataStructures::List < ServerWithPing > | serversToPing

#### Member Function Documentation

bool SLNet::UDPProxyClient::PingServerGroup::AreAllServersPinged | ( | void |  | ) | const

void SLNet::UDPProxyClient::PingServerGroup::SendPingedServersToCoordinator | ( | RakPeerInterface * | rakPeer | ) |

#### Member Data Documentation

SystemAddress SLNet::UDPProxyClient::PingServerGroup::coordinatorAddressForPings

Definition at line 166 of file UDPProxyClient.h.

SenderAndTargetAddress SLNet::UDPProxyClient::PingServerGroup::sata

Definition at line 164 of file UDPProxyClient.h.

DataStructures::List<ServerWithPing> SLNet::UDPProxyClient::PingServerGroup::serversToPing

Definition at line 168 of file UDPProxyClient.h.

SLNet::TimeMS SLNet::UDPProxyClient::PingServerGroup::startPingTime

Definition at line 165 of file UDPProxyClient.h.

struct SLNet::UDPProxyClient::SenderAndTargetAddress

Definition at line 157 of file UDPProxyClient.h.

Class Members
SystemAddress | senderClientAddress |
SystemAddress | targetClientAddress |

struct SLNet::UDPProxyClient::ServerWithPing

Definition at line 152 of file UDPProxyClient.h.

Class Members
unsigned short | ping |
SystemAddress | serverAddress |