question

Philip Alexander Prates Machado avatar image
Philip Alexander Prates Machado asked

Connecting to playfab server with steam

I am trying to connect to a playfab server (dynamically spawned server instances for matchmaking with queue) using steam and unreal, unfortunately when using steam you cannot connect using a raw IP:port.

From looking at the steam documentation and unreal forums it seems u have to call steam's "PingServer()" so that steam can register the server.

Steam directs you to open the ports 27015 (https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711&l&l=english) BUT even after opening both TCP and UDP in the playfab dashboard every time i try to ping the server fails to respond.


How can i connect to a playfab server using UE4 and STEAM? is there anything i am missing here?

unreal
10 |1200

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

Philip Alexander Prates Machado avatar image
Philip Alexander Prates Machado answered

So after almost a week i finally managed to make it work with a workaround.

I highly suggest that you guys add this to a doc somewhere because as far as i know there's is absolutely 0 ways of knowing what to do when you are faced with this issue.

So heres how i didi it:

When you try to connect to a playfab server(or any other dedicated server) when you have steam enabled unreal is gonna check if your "unique net ID" matches the servers subsystem ID type. Dedicated servers will fall back to to the IP net driver and not steam's so while ur server expects a regular ID you will be sending a steam ID making the server reject the connection.

First go into your game mode and OVERRIDE your "login" and "preLogin" functions. Call Super:: and instead of passing the ID from the overriden function pass a "FUniqueNetIfRepl()" in the parameter, you gotta do it in both the prelogin and login.

Then go into the GameModeBase.cpp (engine source) and in the "PreLogin" function either delete the check or just call the "approveLogin" in both code paths after the "IF" statement. (note this might not be nescessary since you are passing an empty FUniqueNetIfRepl but i have not tested).

That should fix it.

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

Citrus Yan avatar image Citrus Yan commented ·

Thanks for sharing your insights on this:)

1 Like 1 ·
attilavarg avatar image attilavarg commented ·

Thanks for this, you just saved me a lot of work before probably giving up on steam.

1 Like 1 ·
Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado commented ·

Other things to consider:

I do not know if this will break joining through the usual server browser that you generally use with steam, you are still using the subsystem so i am assuming it still works but i have not tested this. I can confirm that the friends list is working and probably Lobbies too.

Take that into consideration, also if any one comes across this thread with the same issue and has a server browser implemented, let me know if it works or not.

Hope this helps some one.

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

Looks like you already read this thread: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1483622-connect-to-steam-dedicated-server-via-raw-ip

May I know the details of the port settings in the PlayFab Dashboard and the full response returned from PingServer()?

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

Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado commented ·

I did read that thread :)

What i did in the dashboard was go into the multiplayer, new build, and then in the network section open 27015 TCP, 27015 UDP and the 7777 UDP(unreal default server port) for the game itself.

There was no response, the server always fails to respond (at least the ServerFailedToRespond call back is the one getting triggered).

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Philip Alexander Prates Machado commented ·

Did you open these ports on the client side?

  • UDP remote port 27000--27100:
  • Game traffic UDP local port 27031-27036:
  • Remote Play TCP local port 27036:
  • Remote Play UDP remote port 4380
0 Likes 0 ·
Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado Citrus Yan commented ·

I did not, but to be honest i dont think that is necessary, there are plenty of games on steam that use remote servers and i never had no open ports for any of them i dont see how my game would be different?

I recently stumbled upon a possible solution which i have not tried because i have been working on other stuff.

Suposedly you could go into your games .ini file (where you add the steam stuff) and comment the steam net driver part and it would allow you to connect through a raw ip BUT i am 99% that would not allow you to make a game browser using steam if you do that, so i would rather avoid going that route in case i might need to add player hosted games later on.

Have you guys tried connecting to playfab servers using steam internally? since you guys have steam authentication i was under the impression that this was just an every day thing and that i was just missing an option or 2 in the dash board.

0 Likes 0 ·
Show more comments
yann avatar image
yann answered

Hello! @Philip Alexander Prates Machado

I have a similar problem, except for me the difference is that the server is hosted locally on the client's machine. Essentially when starting a game, the server player opens two ports: the UE one, and an additional TCP port.

Using Steam OSS only the first one that is official gets bound to the relay and not the second one, I was wondering if you had any insight on how to adapt this solution to my use case.

My initial assumption was that steam.123123123 binds to a single port for security reason. I am a bit lost

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.

Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado commented ·

I am sorry man, i have no idea, your best bet would be to ask in the unreal discord in the network or cpp coding channels.

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.