question

Kytan avatar image
Kytan asked

"Unable to contact server"

I'm trying to login to Playfab in my multiplayer server using this code in UE4.27.2:

I can successfully login when testing the server with the LocalMultiplayerAgent but its not working on the server build, its giving me these errors:

I think this error is caused by some port not being open but i'm not sure, can anyone help me?

(The server build is being successfully deployed on Playfab)

unrealmultiplayer
screenshot-3.png (137.4 KiB)
screenshot-2.png (91.2 KiB)
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

·
Made Wang avatar image
Made Wang answered

From the error message, the CA certificate is missing, you can try the solution in MpsSamples/amazon_root_ca.md at main PlayFab/MpsSamples (github.com).

Also, it is not recommended to call the client API on the server side. You could try to use LoginWithServerCustomId.

6 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.

Kytan avatar image Kytan commented ·

That worked, thank you so much!

I have changed that node to use the LoginWithServerCustomId, now I have one more issue, I'm trying to create a Group using the "CreateGroup" node from the Server but its giving me an error:

Do I need to change to Entity Global Title Policy with something to make it work?


[2022.06.13-11.43.43:283][181]LogPlayFab: Request: {
	"GroupName": "20.67.170.117"
}
[2022.06.13-11.43.43:485][187]LogPlayFab: Response : {"code":401,"status":"Unauthorized","error":"NotAuthenticated","errorCode":1074,"errorMessage":"This API method does not allow anonymous callers."}
[2022.06.13-11.43.43:485][187]LogBlueprintUserMessages: [Main_GI_C_2147482596] NotAuthenticated
[2022.06.13-11.43.43:485][187]LogBlueprintUserMessages: [Main_GI_C_2147482596] This API method does not allow anonymous callers.
0 Likes 0 ·
Made Wang avatar image Made Wang Kytan commented ·

LoginWithServerCustomId does not automatically store the EnityToken, you need to get the EntityToken in the login callback and manually store it in request.AuthenticationContext when calling the Entity API, refer to the code below.

PlayFabGroupsAPI.CreateGroup(new CreateGroupRequest
{
    AuthenticationContext=new PlayFabAuthenticationContext
    {
        EntityToken=" "
    },
    GroupName = "serverTest"
},
(result) =>
{
    Debug.Log("Create Success");
},
(error) =>
{
    Debug.LogError(error.GenerateErrorReport());
});
1 Like 1 ·
Kytan avatar image Kytan Made Wang commented ·

That worked, thank you for the help!

0 Likes 0 ·
Kytan avatar image Kytan Kytan commented ·

I am logged in tho, the CreateGroup happens after the "On Success" pin from the "LoginWithCustomServerID".

0 Likes 0 ·
Kytan avatar image Kytan Kytan commented ·

Logs screenshot:

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.