question

Vivek Jha avatar image
Vivek Jha asked

Error while using custom game server as externally hosted server

So, I tested the Playfab custom game server (https://github.com/PlayFab/PlayFabGameServer) and it worked fine when I followed all the steps mentioned in the Readme of the repo.

Now I am trying to test this as an externally hosted game server, so I followed this tutorial (https://api.playfab.com/docs/tutorials/external-game-servers) and updated the code with RegisterGame and RefreshGameServerInstanceHeartbeat, then I made a headless Linux build with unity and uploaded it on our own server, now when I am running this server, my server gets registered with playfab, my client gets logged in, but my client authentication fails, in server log I get this error: GameTicketDoesNotMatchLobby.
Previously I was not using the correct LobbyId but now I am using the LobbyId which I get in return after hitting the RegisterGame API. So, now I don't know what is causing this error. so, any help in debugging?

Custom Game Servers
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

·
brendan avatar image
brendan answered

That's the response you get from a call to RedeemMatchmakerTicket if the ticket passed in isn't for the server in question. Once you register the servers with PlayFab, you still need to use Matchmake to get a matchmaker ticket for that server (if you want to use our matchmaker, that is). As with our hosted servers, the client should pass the ticket it gets back from that call to the server, for authentication purposes.

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.

Vivek Jha avatar image Vivek Jha commented ·

Thanks Brendan, I found the issue, so I was calling RegisterGame API but I was not calling DeregisterGame from the external server, so when I checked Active Games tab in my Playfab Game Manager, I saw 66 server instances running, so when client was calling Matchmake it was joined in a lobby different than the server instance which was actually active.

so, I removed all the previous instances and now everything works fine.

so my test was a success, the Playfab custom game server works perfectly fine as an externally hosted server, all I had to change/add were these 3 API's
RegisterGame
RefreshGameServerInstanceHeartbeat
DeregisterGame

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.