question

lordsplendidhumility avatar image
lordsplendidhumility asked

Custom Thunderhead server calling PlayFabServerAPI

We have our custom server program running in in the new Servers 2.0 setup, and being fed into via a Matchmaking 2.0 queue. I've verified that it all runs correctly up to the point where players connect to the server, which happens successfully.

After connecting, players send the server their session ticket, and the server attempts to call the following C# code to authenticate that session ticket:

```

PlayFabServerAPI.AuthenticateSessionTicket(new AuthenticateSessionTicketRequest()
{
SessionTicket = message.AuthTicket
}, OnAuthLocalUserResponse, (error) =>
{
Logger.Dispatch(LoggerTypes.Info, error.GenerateErrorReport());
}, uconn.ConnectionId);

```

This code works fine when running the server on our own machines, but when running inside the Thunderhead setup, that call returns an error message `/Server/AuthenticateSessionTicket: Unknown Error`

I'm kind of at a loss. Is it possible that the firewall around the custom servers is preventing these servers from contacting the PlayFab server API endpoints? This is the only PlayFabServerAPI call which our servers are currently attempting to make. Might we have missed something in our configuration?

(This is leftover flow from when we were using Matchmaking 1.0; if we weren't running using matchmaker 1.0, we would authenticate session tickets instead of validating Matchmaking 1.0 tickets. If this isn't the right way to validate that players are legitimate any more in the Matchmaking 2.0 world, it'd be handy to learn that too!)

Thanks for any advice!

10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

Did you use a Linux-based container? If so, there is a similar issue in this thread Unable to call ExecuteCloudScript from Thunderhead server. If it can help you or you still have questions, please feel free to let us know.

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

lordsplendidhumility avatar image lordsplendidhumility commented ·

Apologies, no; it's running in a Windows container, using Servers 2.0. I hadn't been aware that Linux-based containers were supported!

0 Likes 0 ·
brandon@uprootstudios.com avatar image brandon@uprootstudios.com lordsplendidhumility commented ·

@lordsplendidhumility I'm assuming you're using Unity (I'm the guy from the linked thread above). If you are, and wanna use Linux-based servers, I wrote an app to make it super easy to build/push Linux servers to PlayFab. Do you have Discord or Slack?

1 Like 1 ·
lordsplendidhumility avatar image lordsplendidhumility brandon@uprootstudios.com commented ·
@Brandon Phillips

On Discord, I'm doomedbunnies#0691; would be very interested to see what you've put together!

0 Likes 0 ·
Show more comments
lordsplendidhumility avatar image lordsplendidhumility commented ·

@Sarah Zhang No, I’m not using a Linux-based container, I am using the default Windows container that is provided and maintained and recommended by PlayFab, and am using PlayFab’s Unity SDK to try to send server API calls.

According to my own tests and what other people are telling me (including inside this comment thread), it seems like when running inside PlayFab’s default Windows container, PlayFab’s Unity SDK is unable to successfully make PlayFab API calls. This seems like kind of a major issue either in the container image or in the SDK, and since PlayFab provides and maintains both, it seems like something that the folks on your end are going to have more luck debugging than the rest of us.

Can this be forwarded to the dev team to try to sort out?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang lordsplendidhumility commented ·

We will try to inform our team. By the way, if you check the Frequently asked questions in our documents. You can find the following answer to this question.

Q: I am using Unity. Do you have a sample of a Unity-based game interfacing with the game server SDK?

At this time, we do not have a Unity sample demonstrating PlayFab Multiplayer Servers. A small group of preview customers have gotten the C# GSDK to work with their Unity-based game server, but it is not a straightforward experience.

And could you please provide your Unity version, Title Id and server build id? Some Unity versions have known networking bugs, maybe you can check unity bug pool too. I saw that you said this code works fine when you locally debugged, do you also locally debugged on a container? Did it work well too? Please provide these details, thanks.

0 Likes 0 ·
lordsplendidhumility avatar image lordsplendidhumility Sarah Zhang commented ·

Hi, @Sarah Zhang

Getting the C# GSDK into Unity was not trivial (it involved setting up a fake C# project and using Nuget to fetch the modules and then importing the correct set of DLLs into the Unity project), but I got it up and working without much trouble.

I haven't yet tested locally inside a container; I haven't set up a machine here for Dropbox yet, so I've only tested inside the MockVM sandbox, where it's acted as expected. All GameserverSDK functions appear to be working just fine; it's only the PlayFabServerAPI functions which are failing.

Unity version is 2019.1.7f1. TitleId is 9ca3. Server build id is more complicated; I've been taking them down as they've not been working. One that's running right now is 03c04c11-c004-4cb8-a92b-eabd5886afb8. Not sure how long I'll leave it up; I'm testing other stuff at the moment and had to remove the calls into PlayFabServerAPI as they were failing. But if you're just looking for a container image which has the problem, that'd be an example of one. But really, all the images associated with this TitleId are showing this same issue.

0 Likes 0 ·
Show more comments
Benjamin Bennett avatar image
Benjamin Bennett answered
@Sarah Zhang

did this ever get resolved? I believe I'm running into the same issue with my custom server trying to make an AuthenticateSessionTicket call.

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

brandon@uprootstudios.com avatar image brandon@uprootstudios.com commented ·

@Benjamin Bennett I don't think it was resolved yet. For now, you probably should look into using Linux-based servers or creating your own SSL certificate and using that to authenticate the container before calling Server APIs

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang commented ·

Currently, your own certificateHandler is still a workaround. There has not been an official solution yet.

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.