question

krishole avatar image
krishole asked

PLayfab + UE4 client joining a server

Hi, i'm working on integrating playfab with a UE4 project, i've got the client and server talking to playfab successfully however when calling GetCurrentGames or MatchMake i'm not getting a hostname response at all. Does playfab automatically fill in the IP address when a server calls RegisterGame or do I have to pass it through manually?

If i do need to pass it through manually is there a recommended service I should use for obtaining the server's ip? Or is there a port that should be opened perhaps for communications with PlayFab?

This is the response I get from Matchmake:

{
 "code": 200,
 "status": "OK",
 "data": {
  "LobbyID": "16456158280985024219",
  "ServerPort": 7777,
  "Ticket": "959B07626C478FF8-0-78874FB3DC4B432B-4934-8D608E7181B72B2-7aeZcHLsgtl0McoM0io8VTYT8jGzTwEaRKR9yaZrMK4=",
  "Expires": "2018-08-23T10:58:35.4423474Z",
  "Status": "Complete"
 },
 "CallBackTimeMS": 416
}

and this is the response from GetCurrentGames:

{
 "code": 200,
 "status": "OK",
 "data": {
  "Games": [
   {
    "Region": "EUWest",
    "LobbyID": "16456158280985024219",
    "BuildVersion": "1.0.0.0",
    "GameMode": "Race",
    "PlayerUserIds": [],
    "RunTime": 1765,
    "GameServerState": 0,
    "GameServerStateEnum": "Open",
    "Tags": {
     "SpeedClass": "0",
     "InLobby": "true",
     "CanJoin": "true"
    },
    "LastHeartbeat": "2018-08-23T10:56:46.364Z",
    "ServerPort": 7777
   }
  ],
  "PlayerCount": 0,
  "GameCount": 1
 },
 "CallBackTimeMS": 445
}
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

Yes, you do need to tell us the IP Address of the server in the call - the reason it's not required is because you can send in IPv4 or IPv6 (or both). You can use GetLocalHostAddr on the server, to get its IP.

10 |1200

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

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.