question

xigmasuji avatar image
xigmasuji asked

How Do I set and get TitleDisplayName using the Server API

I am trying to get and set the TitleDisplayName using Azure Servers and that would require me the

 PlayFabServerInstanceAPI api = new PlayFabServerInstanceAPI(
          new PlayFabApiSettings
          {
                  TitleId = context.TitleAuthenticationContext.Id,
                  DeveloperSecretKey = Environment.GetEnvironmentVariable("PLAYFAB_DEV_SECRET_KEY", EnvironmentVariableTarget.Process)
          },
          new PlayFabAuthenticationContext
          {
              PlayFabId = context.CallerEntityProfile.Entity.Id,
              EntityToken = context.TitleAuthenticationContext.EntityToken
          }
      );

And there is no API in the PlayFabServerInstanceAPI that helps me set the TitleDisplayName of a player. Can you suggest me any for setting the TitleDisplayName currently I am using the following code to get the TitleDisplayName

  PlayFab.ServerModels.GetPlayerProfileRequest  profileRequest = new PlayFab.ServerModels.GetPlayerProfileRequest
  {
  PlayFabId = context.CallerEntityProfile.Lineage.MasterPlayerAccountId
  };
  PlayFabResult profileResult = await api.GetPlayerProfileAsync(profileRequest);

but PlayFab.ServerModels does not have one to set it, is there a possibility to use ClientAPI and the CLientModels not the ServerAPI and the Server models because with the Client API I have seen several APIs for this purpose, appreciate any kinda help with this thank you.

Player Dataapisunity3d
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Infer Wang avatar image
Infer Wang answered

Your solution to get title display name is ok. And you can use the admin api Update User Title Display Name to set title display name on server side.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

xigmasuji avatar image xigmasuji commented ·

It works!! thank you for the timely help.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.