On the server, I’d like to get the peer IP (the public IP) of the client that has connected.
Can anyone point me in the right direction for how to do that in C++?
On the server, I’d like to get the peer IP (the public IP) of the client that has connected.
Can anyone point me in the right direction for how to do that in C++?
Discovered that you can get this from the player controller’s NetConnection.
Example:
#include "GameFramework/PlayerController.h"
UFUNCTION(BlueprintCallable, Category = "ExampleCategory")
static FString get_client_ip_from_pc(APlayerController* player_controller)
{
return player_controller->NetConnection->RemoteAddressToString();
}