(39) 's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

Get Your IP Address From In-Game via BP Node

BP Node to Get Your Computer’s IP Address!

Dear Community,

I’ve finally succeeded at implementing a node that many have been trying to implement since the Beta!

is a BP node that gets the IP address of your computer!

My node relies on http://api.ipify.org, a free and easy way to get your current IP address.

Because node involves an HTTP request I can’t make it a static library node, so I instead made a VictoryPC class that contains only functionality.

You can easily re-parent your current player controller blueprint to use my plugin VictoryPC class!

File->Reparent

and if you are not using a PC already, make sure to go to World Settings and use my VictoryPC as your player controller!

As long as my Victory BP Library is an active plugin for you, then VictoryPC class will show up!


**Celebration!**

Yay!

Now we can  get the IP address of the local computer for use with multiplayer games or webserver activities!

Enjoy!



Pic

Here’s the setup you should create in your Blueprinted version of my VictoryPC!


**C++ Source Code For You**

Here is the C++ source code I wrote just earlier today!



```


/**  node relies on http://api.ipify.org, so if  node ever stops working, check out http://api.ipify.org.  Returns false if the operation could not occur because HTTP module was not loaded or unable to process request. */
	UFUNCTION(BlueprintCallable, Category="Victory PC")
	bool VictoryPC_GetMyIP_SendRequest();
	
	/** Implement  event to receive your IP once the request is processed!  requires that your computer has a live internet connection */
	UFUNCTION(BlueprintImplementableEvent, Category = "Victory PC", meta = (DisplayName = "Victory PC ~ GetMyIP ~ Data Received!"))
	void VictoryPC_GetMyIP_DataReceived(const FString& YourIP);
	
	void HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);


```





```


bool AVictoryPC::VictoryPC_GetMyIP_SendRequest()
{
	FHttpModule* Http = &FHttpModule::Get();
	
	if(!Http)
	{
		return false;
	}
	 
	if(!Http->IsHttpEnabled()) 
	{
		return false;
	} 
	//~~~~~~~~~~~~~~~~~~~
	
	FString TargetHost = "http://api.ipify.org";
	TSharedRef < IHttpRequest > Request = Http->CreateRequest(); 
	Request->SetVerb("GET");
	Request->SetURL(TargetHost);
	Request->SetHeader("User-Agent", "VictoryBPLibrary/1.0");
	Request->SetHeader("Content-Type" ,"text/html");
 
	Request->OnProcessRequestComplete().BindUObject(, &AVictoryPC::HTTPOnResponseReceived);
	if (!Request->ProcessRequest())
	{
		return false;
	}
	  
	return true;
}
	
void AVictoryPC::HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{
	->VictoryPC_GetMyIP_DataReceived(Response->GetContentAsString());
}
 


```



**Latest plugin download on the UE4 Wiki: (8 mb) **


**Victory Plugin on Media Fire**

If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!

Please note clicking  link will not start a download instantly, it will just take you to the Media Fire file description.

https://www.mediafire.com/?g6uf9kt5ueb2upj

Enjoy!

:)