Testing Ip before Open <Ip> for user convenience

Hello, I was (re)searching for 2 days now before I asked and I am stuck.
I managed to build a dedicated server and everything works as it should.

Execute Command Open works and Open Level too. So that´s good.
But these too methods have no user response, you start joining whenever its
possible. What would be nice / what I want is to test if there is a game to join via
Ip before I actually want to join. Now there are so many different topics about it and
it feels misguiding most of the time or its just too much.

From what I gathered on Information, a server browser can do something like that, finding games that are hostet on a specific adress. But since I am hosting only one Game that seems unnecessary.

So what I want the user to do is:

Get the Ip from another User → Copy & Paste it into a text box → It gets tested → If valid game is found on that Ip a button to join that adress appears → User confirms to join / open that ip

If there is anything out there, any bit of information or you can guide me where to dig further on that regard, its much appreciated. I feel like I am asking this for others too, although I haven´t seen such a specific question or request on that (but might have missed it). I just can not believe, that this little extra step to test an Ip before an actual open ip joining is not possible with C++

I tried my best to solve it even if I can´t proof that I dug deep before asking here , I really hope someone can help me, because I feel like this could be a request that has the potential to stay unsolved. Regardless, thanks in advance for any help on this

I am posting things I found in the edit section so that others can follow my steps

Edit : Found this bit but not much else Information around it :

need to dig around of the internal online beacon system (Plugins/OnlineSubsystemUtils). lightweight connection before actual connection, if can’t connect, override net error message at the beacon, otherwise show ping.

ready to use implementation in the Engine https://github.com/EpicGames/UnrealEngine/tree/4.27/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/TestBeaconClient.cpp

Thank you,

unfortunately I don´t understand where the part happens where the client knows where to find the beacon or otherwise how the beacon advertises over the internet to be found by a client. But maybe I am way off track and don´t understand where everything works in conjunction to this. I will dig deeper into it, if that is the right direction and I just miss the clue to solve my problem :slight_smile:

I think it would be very helpful answer from developer What are "online beacons" and how do they work?

(InitHost, InitClient)


The beacons are exactly what you want for what you want to do. To see if a spot is available on the server / server is available before actually doing a full game connection.

The BeaconHost and BeaconHostObject lives on the active map server side. The BeaconClient is on the user side aka the Client. The Beacons live on a different Port than the map server port. Thus, it allows you to test to see if the server is available in some fashion. The BeaconHostObject is active on the active server map. Thus, you will always need to make sure your custom BeaconHostObject is spawned when you go to a new map on the server.

6r0m is semi correct on the InitHost / InitClient, but it would be better to implement your own RPC command for the beacon. This will ensure the beacon you are connecting to from the client respects your RPC and thus you know it is one of your servers. For example in the tutorial I wrote, the BeaconHostObject OnClientConnection sends an RPC called Ready() to the client beacon. This way the client beacon, knows it has successfully connected to the server beacon, and the server beacon is ready to process the client RPC commands for the Ping / Pong. You wouldn’t even need to do a ping, but on the client you would know that it is your server. Then, you could say, yep we connected if we received the Ready() and then close the client beacon connection and destroy it. Otherwise, if OnFailure method is called you failed to connect, or you set a timeout of x seconds when you initially try to connect with the beacon. And if the time out delegate is called and not canceled, then you failed to connect to a valid beacon as well.

You do not need to overwrite the BeaconHost class. As that is no longer necessary. As noted in a response, on the tutorial post, you can use: BeaconHost->PauseBeaconRequests(false);

The tutorial I wrote is old, but still applies somewhat to the beacon with UE4, not sure about UE5. I know some of the variable names and how they are accessed in the latest UE4 has changed, since I wrote the tutorial. But in general the BeaconClient and BeaconHostObject still applies from that tutorial in general.

Experience showed in Paragon and early Fortnite that “ping” from the beacon wasn’t super accurate because it was part of the tick loop of the engine. It could add up to 16ms @60fps on the client plus whatever time might be on the server if the tick processed actors just as the packet was received.

Have you looked at the ATestBeaconClient code that demonstrates how its the RPC that matters to start things off once the actor is spawned? The OnConnected() and other functions are meant to be internal details.

Apologies if this was already shared, but have you seen the docs I wrote up a few years ago after answering the original forum question?