Expose to BP: get server port and IP address

Hello [USER=“947258”]Mr. Wood[/USER],

I’m in the process of Exposing IP/Port to BP Function Library (C++ Plugin). Unfortunately, I hit a road block with ‘nonstatic member reference must be relative to a specific object’. Curious if you found a solution to this issue?



*.h
UFUNCTION(BlueprintCallable, meta = (DefaultToSelf = "WorldContextObject", DisplayName = "GetNetworkURL", Keywords = "Server Client IP Port"), Category = "Woosah")
FString GetNetworkURL();

*.cpp
FString UWoosahBPLibrary::GetNetworkURL()
{
    return GetWorld()->GetAddressURL();
}


Any assistance you can offer in this matter is greatly appreciated. Thanks in advance.

1 Like