Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate GetRegionalPings for new GetPingsForRegions method #32

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mikeseese
Copy link
Collaborator

This PR primarily is to provide a new HathoraSDK::GetPingsForRegions method which doesn't call the Discovery API, but rather has an argument of the region names/urls to ping. This method also enables optional UDP echo pinging instead of ICPM (default) with another argument. HathoraSDK::GetRegionalPings has been deprecated with appropriate deprecation messages for both C++ and Blueprints. The readme has been updated accordingly and the lobby example (both the C++ and BP versions) now use the updated version (using the new HathoraSDK::GetRegionMap method that provides a hardcoded version of all Hathora URLs).

Here are the changes to the W_LobbyMenu.uasset:

image

^ This used to simply call GetRegionalPings

image

^ This looped on EHathoraCloudRegion enum to fill things out instead of using the same GetRegionMap function.

This PR also does some other housekeeping:

  • Added Dubai and Johannesburg regions
  • Update the DefaultBuildSettings to use Latest in the sample project Targets to better support future engine versions
  • Deprecated Discovery API endpoints
  • Some minimal updates to outdated readme docs
  • Update UHathoraSDK::GetServerEnvironment() to include new injected environment variables

@mikeseese mikeseese requested review from jchu231 and hpx7 January 22, 2025 20:32
- It's recommended for your backend/matchmaker to provide this map of supported regions; there is a helper function `UHathoraSDK::GetRegionMap()` which provides a hardcoded map of all the regions.
1. A `EHathoraPingType PingType` of either `EHathoraPingType::ICMP` or `EHathoraPingType::UDPEcho`. Both send an ICMP packet; the former uses the ICMP protocol and the latter uses the UDP protocol (expecting an echo response)
1. A callback with the results
1. An optional `int32 NumPingsPerRegion` which defaults to `3`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Looks like the numbers got malformed here (all of them are 1. instead of incrementing)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is markdown syntax which renders a number list in a descending order.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jchu231 Can I merge without changing these? As Jared mentioned, this syntax is automatically rendered properly; it's useful so that if you insert a new step or move steps, you don't have to go back and fix all the numbers. You can see it rendered here: https://github.com/hathora/hathora-unreal-sdk/tree/ms/decouple-api-usage
image

Copy link
Contributor

@jchu231 jchu231 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM outside of the minor readme typo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants