#include <UDPProxyServer.h>
Public Member Functions | |
void | SetSocketFamily (unsigned short _socketFamily) |
void | SetResultHandler (UDPProxyServerResultHandler *rh) |
bool | LoginToCoordinator (RakNet::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 Attributes | |
UDPForwarder | 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.
bool RakNet::UDPProxyServer::LoginToCoordinator | ( | RakNet::RakString | password, | |
SystemAddress | coordinatorAddress | |||
) |
Before the coordinator will register the UDPProxyServer, you must login
Coordinator must have set a password with UDPProxyCoordinator::SetRemoteLoginPassword()
virtual void RakNet::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
[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 RakNet::PluginInterface2.
virtual PluginReceiveResult RakNet::UDPProxyServer::OnReceive | ( | Packet * | packet | ) | [virtual] |
OnReceive is called for every packet.
[in] | packet | the packet that is being returned to the user |
Reimplemented from RakNet::PluginInterface2.
void RakNet::UDPProxyServer::SetResultHandler | ( | UDPProxyServerResultHandler * | rh | ) |
Receives the results of calling LoginToCoordinator() Set before calling LoginToCoordinator or you won't know what happened
[in] | resultHandler |
void RakNet::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.
[in] | ip | IP address to report in UDPProxyClientResultHandler::OnForwardingSuccess() and UDPProxyClientResultHandler::OnForwardingNotification() as proxyIPAddress |
void RakNet::UDPProxyServer::SetSocketFamily | ( | unsigned short | _socketFamily | ) |
Sets the socket family to use, either IPV4 or IPV6
[in] | socketFamily | For IPV4, use AF_INET (default). For IPV6, use AF_INET6. To autoselect, use AF_UNSPEC. |
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