Using playfab with Unreal, the login information when requesting location comes through as FLocationModel.CountryCode and ContinentCode, both of which are enums making it a little bit of a hassle to actually use it with anything outside of playfab, since its ISO strings why not store it as an FString too to make it easier for developer use? The json response has its as 2 letters anyway, i'm struggling to see why it would be stored as something other than a string
Answer by kris.hole · Nov 20, 2018 at 10:29 PM
If anybody does want this functionality you can do the following:
in PlayFabClientDataModels.h::FLocationModel, Line 2722, add these two in there somewhere:
Boxed<FString> CountryCode; Boxed<FString> ContinentCode;
then add to the constructors to look like this:
FLocationModel() : FPlayFabBaseModel(), City(), pfContinentCode(), pfCountryCode(), Latitude(), Longitude(), CountryCode(), ContinentCode() {} FLocationModel(const FLocationModel& src) : FPlayFabBaseModel(), City(src.City), pfContinentCode(src.pfContinentCode), pfCountryCode(src.pfCountryCode), Latitude(src.Latitude), Longitude(src.Longitude), CountryCode(src.CountryCode), ContinentCode(src.ContinentCode) {}
then in PlayFabClientDataModels.cpp::Line4208,
pfCountryCode = readCountryCodeFromValue(obj->TryGetField(TEXT("CountryCode")));
add the following:
CountryCode = obj->TryGetField(TEXT("CountryCode"))->AsString(); ContinentCode = obj->TryGetField(TEXT("ContinentCode"))->AsString();
Then in your login result handler, you can access it like this:
Result.InfoResultPayload->PlayerProfile->Locations[0].CountryCode.mValue;
Result.InfoResultPayload->PlayerProfile->Locations[0].ContinentCode.mValue;
If you'd like to see this added to the SDK, feel free to submit a pull request, so that our SDK team can review the changes.
Unreal Engine 4.21 along with Multiplayer Features 1 Answer
Save and Load player location or other data in UE4 Blueprints? 1 Answer
Update User Data via Blueprints in UE4? 1 Answer
Custom Analytics of Specific Action By Player [UE4] 1 Answer
Where do I find email verification status via blueprints? 2 Answers