question

Sultan Sultanov avatar image
Sultan Sultanov asked

How i can get InitalPlayers on UE4 Server?

I successfully started the server, now during the connection I want to check if this player can be on this server? And also I want to divide them into teams. How should I do it?
What values will this function return to me?


Microsoft::Azure::Gaming::GSDK::getInitialPlayers();
Matchmaking
10 |1200

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

Seth Du avatar image
Seth Du answered

getInitialPlayers() is usually used to verify the players that are trying to connect to the server instance.

To get the team member information, you may need the server to call GetMatch API via SESSION_ID_KEY from GSDK (which is match ID).

>>The player starts searching for the server together with his group.

I am not sure but do you specify team members in the MembersToMatchWith property in the request of CreateMatchmakingTicket API call? If so, after the match is found, players will be in the same team and GetMatch API will return team information.

MatchmakingPlayerWithTeamAssignment is a request property of CreateServerBackfillTicket API, which is different from CreateMatchmakingTicket API.

CreateServerBackfillTicket is used when tickets are match and there is a match ID already, while the server wants to allocate more players or refill the slots of those players who have lost the connection.

In a word, when the matchmaking starts, members can only make sure they are in the same team, and it cannot be guaranteed that they are in a specific team. Only when creating backfill ticket, can the server allocate the players to a specific team.

10 |1200

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

Sultan Sultanov avatar image
Sultan Sultanov answered

In my game: The player starts searching for the server together with his group. After he found the server they should connect and be in the same team together. I cannot understand what results "TeamId" will return ( in MatchmakingPlayerWithTeamAssignment)

10 |1200

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

Sultan Sultanov avatar image
Sultan Sultanov answered

@SethDu Hello, thanks for answer, but for GetMatch i need to get QueueName on server side. How i can get this value?

for example. ServerCode

FString MatchID = Microsoft::Azure::Gaming::GSDK::SESSION_ID_KEY;
PlayFabMultiplayerPtr PlayFabMultiplayerAPIPtr = IPlayFabModuleInterface::Get().GetMultiplayerAPI(); if (PlayFabMultiplayerAPIPtr == nullptr) { UE_LOG(LogTemp, Warning, TEXT("ACPP_ExtremeGameMode::PreLogin FAILED | PlayFabMultiplayerPtr == nullptr")); return; } if (MatchID.IsEmpty()) { UE_LOG(LogTemp, Warning, TEXT("ACPP_ExtremeGameMode::PreLogin FAILED | MatchID.IsEmpty()")); return; } PlayFab::MultiplayerModels::FGetMatchRequest PlayFabGetMatchRequest; PlayFabGetMatchRequest.MatchId = MatchID; PlayFabGetMatchRequest.QueueName = TEXT(""); //Need to Get this Value PlayFabGetMatchRequest.ReturnMemberAttributes = true; PlayFabMultiplayerAPIPtr->GetMatch(PlayFabGetMatchRequest, PlayFab::UPlayFabMultiplayerAPI::FGetMatchDelegate::CreateUObject(this, &ACPP_ExtremeGameMode::OnPlayFabGetMatchSuccess), PlayFab::FPlayFabErrorDelegate::CreateUObject(this, &ACPP_ExtremeGameMode::OnPlayFabGetMatchFailture) );
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.

Seth Du avatar image Seth Du ♦ commented ·

In most scenario, one matchmaking queue corresponds to one server build, which means the queue name is hard-coded and can be stored by plain text in the server code.

Otherwise, you may need to retrieve from somewhere else. For example, if you are creating matchmaking ticket from server side (Cloud Script/Azure Function), you may store the queue name in Player Read-only/Internal Data for later use.

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.