question

Z. avatar image
Z. asked

GetPlayerCombinedInfoResult returns null TitleData,PlayerProfile.

Hi,

so I've been trying to get some player info but the results always comes back null.

I've already allowed Clients to access creation time, last login and display name from the GameManager but I never seem to be able to get those info returned to me. It happens on a new publisher, new title player as well as a device registered player.

I am not using any cloudScripts right now.

First I've tried using the Auth result and it returns me a null infoResultPayload.

var request = new LoginWithAndroidDeviceIDRequest
{
     AndroidDeviceId = SystemInfo.deviceUniqueIdentifier,
     CreateAccount = false,
};
PlayFabClientAPI.LoginWithAndroidDeviceID(request, PrintResult, DeviceAttemptLoginFailure);



void PrintResult(LoginResult result)
{
	print (result.InfoResultPayload);
	// Successful auth, but returns me a null infoResultPayload
}

and then i tried the GetPlayerCombinedInfoRequest

var request = new LoginWithAndroidDeviceIDRequest
{
     AndroidDeviceId = SystemInfo.deviceUniqueIdentifier,
     CreateAccount = false,
};
PlayFabClientAPI.LoginWithAndroidDeviceID(request, PrintResult, DeviceAttemptLoginFailure);


void GetPlayerInfo(LoginResult result)
{
        GetPlayerCombinedInfoRequestParams getInfoParms = new GetPlayerCombinedInfoRequestParams()
        {
            GetTitleData = true,
            GetPlayerProfile = true
        };
        var requestT = new GetPlayerCombinedInfoRequest()
        {
            InfoRequestParameters = getInfoParms
        };
        PlayFabClientAPI.GetPlayerCombinedInfo(requestT, PlayerInfoSuccessOut, PlayerInfoFailOut);
}


void PlayerInfoSuccessOut(GetPlayerCombinedInfoResult result)
{
        print(result.InfoResultPayload); 
	// which also returns a Null               
}

is there a step that I am missing? Thanks for any help!

Player DataTitle Data
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.

Citrus Yan avatar image Citrus Yan commented ·

What's the title id and the id of that player?

0 Likes 0 ·

1 Answer

·
Z. avatar image
Z. answered

Seems I have to add the GetPlayerCombinedInfoRequestParams into the login Request to get a result.

This gives me the results I wanted.

GetPlayerCombinedInfoRequestParams requestParams = new GetPlayerCombinedInfoRequestParams()
        {
            GetTitleData = true,
            GetPlayerProfile = true,
            GetUserAccountInfo = true,
            GetUserVirtualCurrency = true
        };

        var request = new LoginWithAndroidDeviceIDRequest
        {
            AndroidDeviceId = SystemInfo.deviceUniqueIdentifier,
            CreateAccount = false,
            InfoRequestParameters = requestParams
        };
        PlayFabClientAPI.LoginWithAndroidDeviceID(request, PrintResult, DeviceAttemptLoginFailure);

void PrintResult(LoginResult result)
{	
	print (result.InfoResultPayload.PlayerProfile,DisplayName);	
	// returns my DisplayName 
}
10 |1200

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

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.