How To List Dedicated Servers?

Hello I have a server list widget that is supposed to get all the dedicated servers that are being hosted and make a button on the server list for each server found.

This worked when I would launch a server from the game but now that I have a standalone dedicated server built, the game isn’t detecting the servers.

Here is the blueprints I have

Event UpdateList is called when this widget is constructed and can be called again with a refresh button I have.

The server itself does work because I’m able to connect to it through open(myip) in console.

Any help would be appreciated thank you.

1 Like

I also tried advanced sessions with dedicated server ticked but it seems this is redundant considering I can join without this blueprint being called, I’m still unable to get the dedicated server and add it to the list in the widget though.

bump ⠀⠀⠀⠀⠀

1 Like

without cpp or without advanced sessions “Find Sessions” with dedicated server only setting it’s impossible, AFAIK.

So if I recompile using advanced sessions to list the servers it would detect the standalone server I built?

not promise, but it supposed to show correct.

It did show on the server menu but I’m unable to click the button to join the session.

thank you though, its a great step in the right direction for me.

are you connecting to session with advanced node too?

I have an on clicked event for the button that’s connected to the join session node.

Here are all the blueprints I have regarding the server

This is what I have on the level blueprint

This is what I have for the server list

And this is what I have for the server button

Why you can’t connect to server? Is it “Find Session” giving failure or there’s 0 length array output or join session gives failure?

It seems theirs 0 length array output on the session results which then results in the button failing to connect.

Am I setting up the server wrong?

The thing is when I close the dedicated server and refresh the list the button disappears, and the server log prints that the server started successfully.

I also opened up multiple servers and a button was created for each of them upon refresh.

Edit: when I opened up 3 servers the array counted 2 so I’m assuming its counting from 0 being the first server I opened.

So you’re saying that you can connect to server only if two servers created? That’s really weird. What about creating non-dedicated server? Is it bugging again? And do you talking about length, not last index? When there’s more than one server and button generates to every server, can you connect to every server or every but not first one?

I’m unable to connect regardless of the amount of servers

I can connect locally and through my IP through console using “open IP” but I cannot connect using the button on the server list

I’m not sure about array length or index so I may have worded that wrong but it does list all 3 servers when I print the string for it, and also creates a button for it, but I am not able to connect to any of them through those buttons.

I’m not even sure if I have this server list setup correctly, I know the dedicated server is working because I can join using “open IP” in the console.

I made a separate build removing the “create advanced session” on the game and now no buttons appear when searching for the servers.

This would trigger on eventbeginplay when the game starts in the level blueprint.

It seems that the server it found was created by the game instead of the dedicated server itself which means that the game is not detecting that the dedicated server was created even though is open and working?

So “Join Session” gives an error? Actually, on screenshot you gave, there’s standard join session node. Try to replace it with “Advanced join session”. Also, how you test the join? In editor or with build game? Try to test it in editor with “server” game and “client” game, and create session with “server” version(maybe that will help).

I’m unable to find the “Advanced Join Session” you’re talking about. I tested in both editor and standalone and both don’t work.

I believe “Find Sessions” is used for local listen servers, so if in the same network a player is both the server and a client. I don’t think a dedicated server on a local network has any point (regarding real life scenarios), so that can be a reason to why it fails to work.

If you want your game to be playable on the internet with dedicated servers, you are going to have to use master servers; the easiest way is to use an Online Subsystem that has it implemented, like Steam, but you can also write and set up your own.

1 Like

Would I have to implement some sort of master server that lists all the other servers from the game?

Thank you for clarifying, I am using the Advanced Sessions plugin but it could very well be behaving the same way since I’m assuming the default online subsystem doesn’t support dedicated servers etc.

I’ll consider this answered as I feel like I’m going about this the wrong way thank you.

Hello,
You can use this solution to to run a master server on Windows / Linux and get a list of game servers using the UE4 plug-in.