# Testing Ip before Open \<Ip\> for user convenience

**URL:** <https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, unreal-engine, UE5-0, UE4, question\
**Created:** [April 7, 2022, 9:52am UTC](https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125 "2022-04-07T09:52:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Wenzel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mathias_wenzel/32/934891_2.png) [@Mathias\_Wenzel](https://forums.unrealengine.com/u/Mathias_Wenzel)\
**Post date:** [April 7, 2022, 9:52am UTC](https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125/1 "2022-04-07T09:52:10Z")

</div>

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 :

> [@Test if server is running](https://forums.unrealengine.com/t/test-if-server-is-running/418409):
>
> So I am writing a little tool for my project and this is something that is eluding me(and I tried googling for a bit). Is there a way to test that the server is actually listening on the remote 7777(or whatever) port? From command line, c++ code, python code, javascript, whatever. UDP server running does not provide any ACK so there is that, apparently there is no header sent when somebody just connects to the server, there probably need to be some init packet sent, I do not have my wireshark …

> [@OnlineBeacons Tutorial with Blueprint Access](https://forums.unrealengine.com/t/onlinebeacons-tutorial-with-blueprint-access/100043):
>
> Hey everyone, I noticed that this is covered very little in the official docs and around the web. You can find tidbits here and there, but not a full example that works with Blueprints. Today, I am going to reveal the great mystery behind how they work and how to get them to work in C++ and have blueprint access to them. First lets cover what Beacons are good for in an online game: They can be used to get a quick ping from the server. You can use it to reserve spots on the server. They can b…

> [@What are "online beacons" and how do they work?](https://forums.unrealengine.com/t/what-are-online-beacons-and-how-do-they-work/366763/2):
>
> The idea behind beacons was to provide a lightweight way to contact a server before actually connecting “for real”. Ideally you make a connection, send an RPC, get a response, and disconnect. You can ask things like “who is in the game” or “please make room for me, I’m about to join”. Traditionally, connecting to a server involved a full map load which can be frustrating to users if they do all that work only to be denied entry to an almost full game because someone got into the game first. …

---

<div class="post-metadata">

**Author:** ![6r0m](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/6r0m/32/1194563_2.png) [@6r0m](https://forums.unrealengine.com/u/6r0m)\
**Post date:** [April 7, 2022, 10:19am UTC](https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125/2 "2022-04-07T10:19:28Z")

</div>

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](https://github.com/EpicGames/UnrealEngine/tree/4.27/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/TestBeaconClient.cpp)

---

<div class="post-metadata">

**Author:** ![Mathias\_Wenzel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mathias_wenzel/32/934891_2.png) [@Mathias\_Wenzel](https://forums.unrealengine.com/u/Mathias_Wenzel)\
**Post date:** [April 7, 2022, 10:26am UTC](https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125/3 "2022-04-07T10:26:01Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![6r0m](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/6r0m/32/1194563_2.png) [@6r0m](https://forums.unrealengine.com/u/6r0m)\
**Post date:** [April 7, 2022, 10:45am UTC](https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125/4 "2022-04-07T10:45:20Z")

</div>

I think it would be very helpful answer from developer [What are "online beacons" and how do they work?](https://forums.unrealengine.com/t/what-are-online-beacons-and-how-do-they-work/366763/2)

(InitHost, InitClient)

---

<div class="post-metadata">

**Author:** ![Metricton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Metricton](https://forums.unrealengine.com/u/Metricton)\
**Post date:** [April 7, 2022, 2:55pm UTC](https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125/5 "2022-04-07T14:55:17Z")

</div>

Mathias,

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.

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [April 7, 2022, 10:15pm UTC](https://forums.unrealengine.com/t/testing-ip-before-open-ip-for-user-convenience/518125/6 "2022-04-07T22:15:40Z")

</div>

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?

> **[Online Beacons](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/OnlineBeacons/)**
>
> Overview of the Online Beacon system
