In your case you can call the PlayFab API LoginWithPlayFab. If you want any sample code, could please clarify your specific development platform, is it native CPP or the unreal engine?
It is in unreal engine.
Thanks for replying @Sarah Zhang, I really appreciate it. Look forward to hearing from you.
Hey just wanted to check in if you had sample code you could either provide or point me to. Thanks again @Sarah Zhang
Please refer to this document -- https://docs.microsoft.com/en-us/gaming/playfab/sdks/unreal/quickstart, especially this section -- https://docs.microsoft.com/en-us/gaming/playfab/sdks/unreal/quickstart#add-playfab-api-calls-to-your-c-loginactor.
In your case, you need to replace this code snippet
PlayFab::ClientModels::FLoginWithCustomIDRequest request; request.CustomId = TEXT("GettingStartedGuide"); request.CreateAccount = true; clientAPI->LoginWithCustomID(request, PlayFab::UPlayFabClientAPI::FLoginWithCustomIDDelegate::CreateUObject(this, &ALoginActor::OnSuccess), PlayFab::FPlayFabErrorDelegate::CreateUObject(this, &ALoginActor::OnError) );
to this.
PlayFab::ClientModels::FLoginWithPlayFabRequest request; request.Username = TEXT("xxxxxx"); request.Password = TEXT("xxxxxx"); request.TitleId = TEXT("xxxxxx"); clientAPI-> LoginWithPlayFab(request, PlayFab::UPlayFabClientAPI::FLoginWithPlayFabDelegate::CreateUObject(this, &ALoginActor::OnSuccess), PlayFab::FPlayFabErrorDelegate::CreateUObject(this, &ALoginActor::OnError) );
Thank you for the reply @Sarah Zhang. One quick question if I am creating a contoller class for playfab would making it static be ideal so the other developers can access the functions anywhere we need?
You can do it. But whether it is appropriate to set the controller class to a static class depends on your specific program design. If you need any Unreal CPP source code, you can refer to our repo -- GitHub - PlayFab/UnrealMarketplacePlugin: Source code for the PlayFab Marketplace Plugin for Unreal.
2 People are following this question.