Download

How to get the IP Address of a Dedicated Server to create a list of joinable dedicated servers?

Here’s the gist of my problem guys:

I have searched, extensively, all across the internet for an answer to this question. I have found literally 0 helpful answers, as they are all either too vague or they branch into directions I would not like to head. Now, I’m going to explain a little about my project so you can get an understanding of what I’m needing to do, and so you can potentially help me out if you know an answer or a way of doing this properly:

  • I have a source build of the latest version of the Unreal Engine (4.21 as of writing this).
  • I have both a client and a dedicated server built and working.
  • I am building 99% of all functionality in Blueprints, so an answer here would be preferred, though I can follow C++ instructions if necessary.
  • The game is built around Steam support, and is working properly.
  • I have the Advanced Sessions Plugin installed and working, though it may not be necessarily required for this.

Let me explain what I’m needing: I am creating a game that will allow users to host their own dedicated servers on their machines, or they will eventually be able to use third-party hosters to host these servers. I have created a widget that will allow them to browse through all of the hosted dedicated servers their internet can detect.

My problem is: I cannot make a hosted dedicated server appear in the list of servers via a Find Sessions node, or any other way for that matter.

I have followed, several different tutorials on how to make a server browsing list, all to the T. None of them ever return the dedicated server that I’m hosting on my local machine.

I’ve even tried editing the session the dedicated server is hosting to try and make it discoverable by a find sessions node, but have had no luck.

Test Cases:

  • Having the player host a listen server: Creates a list item that can be used to join the listen server (with same list widget I’m trying to use for the dedicated ones).
  • Hosting the dedicated server (same version as client) with localhost ip (127.0.0.1) hardcoded into the Execute Console Command node: (worked
  • Hosting dedicated server and using Find Sessions node to pull the Blueprint Session Result information: “Success” result string prints, though no list item appears for the server.

Hopefully you can see my issue. If I plan on allowing players to host their own servers or pay for a third-party to host one for them, then they have to be joinable, and it would be impossible to manually get all the IP’s and hardcode them into the game unless I was just hosting a few servers myself and that was all, though this isn’t practical and I’m not going to do it.

So here’s the rules of the answer I’m needing:

  • I want to stay away from any 3rd party things like PlayFab (no offense).
  • I would prefer that it all be done in blueprints for easy editing later on if necessary.
  • I need to be able to put a button inside of a list to represent the hosted dedicated server. I’m not worried about functionality of it, just getting one to appear for each dedicated server.
  • I need to be able to dynamically set the IP address for the client to know what server to join.

That’s what I’m needing. For every server, I need a widget that appears representing that server, that clicking on will allow them to join via either find session or open level [ip variable] or execute console command [open ip variable].

Any help at all would be extremely valued.