# Region Detection and More

PCU comes built in with some neat helper nodes to attempt to determine where your player is located. This will be phased out as soon as Beacon Endpoints as we will implement a ping system to try to geo-locate where your player is at.

## Get Available Regions

This retuns, in an enum array, the regions that are fully available on Playflow.&#x20;

See [Server Regions](https://duel-studios.gitbook.io/playflow-cloud-for-unreal/navigating-playflow-cloud/server-regions) for more information.

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FKGDjyF9fgyDp8h63yv85%2Fimage.png?alt=media&#x26;token=8d3082ec-aaeb-4588-90fd-8c63726bbaeb" alt=""><figcaption></figcaption></figure>

## Get Region ID

This takes in our Region Enum and gets the ID of it returned as the IDs listed in [Server Regions](https://duel-studios.gitbook.io/playflow-cloud-for-unreal/navigating-playflow-cloud/server-regions).

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FyikAetvFX1zD05WNpvxi%2Fimage.png?alt=media&#x26;token=90fa11f9-ee73-4df5-b60f-b7d3f2eb8317" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
In the Version 0.0.3.0 - Updates, we made it simpler if you display these to your users. For Instance referring to EU North (Sweden) is now just Sweden in the plugin.
{% endhint %}

## RegionID to Enum

This takes in our Region ID and then returns it neatly as our Playflow Region if it finds it.

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2F8YOKDUPYEDXzPLqAesE7%2Fimage.png?alt=media&#x26;token=4395a767-c13f-45ce-9e7c-400995e837a6" alt=""><figcaption></figcaption></figure>

## Get Region Display Name

This takes in our Enum and returns the display name of our Region. This is useful if you want to dynamically generate a dropdown (Combo Box String) without manually doing it.

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FlP9bQoIIUyp2yIGi8kEU%2Fimage.png?alt=media&#x26;token=c880d7ab-66ba-49e0-bde4-6f5b05146ec6" alt=""><figcaption></figcaption></figure>

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2FWiiDIikqOPxjbMBz3UDD%2Fimage.png?alt=media&#x26;token=bf3c176d-3a3f-4557-b224-b9673ddfb038" alt=""><figcaption></figcaption></figure>

## Get Saved Preferred Region

This retrieves our Saved Preferred Region that we detect through either [Detect Optimal Region](#detect-optimal-region) or [Set Preferred Region](#set-preferred-region).

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2F3czJYXk45uhZBExIbI7O%2Fimage.png?alt=media&#x26;token=e7ca5790-203f-47a9-bc9f-d1fa67907e31" alt=""><figcaption></figcaption></figure>

## Detect Optimal Region

This will automatically detect the player's IP address, using an API and attempt to geolocate where the best region for them is.&#x20;

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2F2GrErLFJBzCZIbKfigcO%2Fimage.png?alt=media&#x26;token=1ede595c-5f96-433b-9805-9acf9664fea9" alt=""><figcaption></figcaption></figure>

## Set Preferred Region

This overrides our auto-detection and sets our Region manually.

<figure><img src="https://599571038-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJOLYZsEpI3ofbnXUKMb9%2Fuploads%2F47hLFRSELBNDVeOreeec%2FUnrealEditor_lTC0EHv574.png?alt=media&#x26;token=2858cd31-dfb9-4773-90a0-649e46932b85" alt=""><figcaption></figcaption></figure>
