question

Philip Alexander Prates Machado avatar image
Philip Alexander Prates Machado asked

invalid input parameters when calling GetMatch()

I am trying to call GetMatch() in the server, i managed to call GetEntityToken() sucessfully already so that i can make that call.


PlayFabMultiplayerPtr multiplayerAPI = IPlayFabModuleInterface::Get().GetMultiplayerAPI();


PlayFab::MultiplayerModels::FGetMatchRequest request;
request.EscapeObject = false;
request.MatchId = FString::FromInt(matchID);
request.QueueName = "QuickPlay5";
request.ReturnMemberAttributes = true;


UE_LOG(LogTemp, Warning, TEXT("getting match"));

multiplayerAPI->GetMatch(request, PlayFab::UPlayFabMultiplayerAPI::FGetMatchDelegate::CreateUObject(this, &AArenaGameMode::OnGetMatchSuccess), PlayFab::FPlayFabErrorDelegate::CreateUObject(this, &AArenaGameMode::OnGetMatchFailed));


Trying to call this in c++ triggers the "failed" callback and gives the following message "invalid input parameters".

This message suggests that i am doing something wrong when filling the request struct but i honestly dont know what.

Any ideas?

unreal
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

·
Seth Du avatar image
Seth Du answered

May I ask how do you get the "matchID"? Usually it is a GUID returned by GetMatchmakingTicket, which is not an int. Would you directly pass through the "MatchId" from GetMatchmakingTicket API callback to GetMatch API reqeust?

5 comments
10 |1200

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

Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado commented ·

Through the GSDK like so:

std::unordered_map<std::string, std::string> config = Microsoft::Azure::Gaming::GSDK::getConfigSettings();


		//Retrieve a particular configuration value
		auto it = config.find(Microsoft::Azure::Gaming::GSDK::SESSION_ID_KEY);


		if (it != config.end())
		{
			std::string sessionID = config[Microsoft::Azure::Gaming::GSDK::SESSION_ID_KEY];

			FString sessionIDtofstring = FString(sessionID.c_str());


			matchID = FCString::Atoi(*sessionIDtofstring);

I spoke with Brendan and he said that the session_id_key should be the game the ticket ID.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Philip Alexander Prates Machado commented ·

The match ID should be something like "e50519e0-b084-4711-90ac-d4aae09c04b2" becuase it is a GUID/UUID. I am not sure how the SDK defines "SESSION_ID_KEY", but it should work as a String. I don't think it is an int. Would you output matchID and FString::FromInt(matchID) to check it again?

0 Likes 0 ·
Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado Seth Du ♦ commented ·

I already did, in the movckVM agent it printed "0" and in the your actual backend i remote acessed the VM and it printed "9".

If you know how to get the match ID through another method through c++ i can give it a shot.

Edit: this older thread https://community.playfab.com/questions/41241/how-does-player-information-reach-the-server-when.html says the same, i am just not sure if the SESSION_ID_KEY is the same as the SessionId mentioned.

Still even if the match id was wrong shouldnt the error be diferent instead of "invalid input parameters", i dont know the system as well as to««you guys but i imagine it would be some thing along the lines of "invalid gameId number".

Edit2: This is how the request looks like.

Warning: {
	"EscapeObject": 
	false,
	"MatchId": 
	"0",
	"QueueName": 
	"QuickPlay5",
	"ReturnMemberAttributes": 
	true
}

Edit 3: so after reading your post again looking for clues i noticed that you said that the ID is actualy a string and not an int (which for some reason i overlooked), and after changing that i managed to get a "The match could not be found" so i assume i am on the right track. Thanks.

0 Likes 0 ·
Show more comments

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.