How to connect a client to a dedicated server

I don’t know how to get clients to connect to dedicated servers. The blueprint doesn’t seem to provide relevant functions. Is it feasible for me to do this in the blueprint?

you can do that via the console command “open IPADDRESSHERE”
For example: open 127.0.0.1

1 Like

I am stuck on this too.

Use the Open level node, that is used to change levels. In place of a level name you put in your IP address. If you are trying to connect clients that are not on your network it needs to be your actual IP address and not your local address.

From my understanding the session nodes you are trying to use are not for dedicated servers.

Yes I now believe that dedicated servers and sessions are basically mutually exclusive.

I have tried open level with an IP address and I still can’t connect. Its really frustrating.

My clients start the “lobby” level, my dedicated server starts the main game level. When I “join game” from the client… nothing happens.

The log shows:

LogBlueprintUserMessages: [Choose_Inventory_C_0] Opened level 127.0.0.1
LogNet: Browse: 127.0.0.1//Game/FirstPersonBP/Maps/Choose_equip
LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768)
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogNet: Game client on port 7777, rate 10000

The problem is that the map running on the server should be arena, and therefor I expect the open level on the client to load the level from the dedicated server - but as you can see… it doesn’t

Did you find and solution to this? i’m having the same trouble when running a Default map for the server and a diferent default map for the clients.

I ended up making the game non dedicated server.

However you can just open level with the IP address (of the dedicated server), I believe that works.

Sessions use online subsystems. If you have not created (or installed a plugin for) an online subsystem for your specific type of dedicated server setup, then the Sessions don’t know what they’re doing and won’t have the information in them needed to connect.

For dedicated servers, you just Open the IP address (and optionally port after a “:” character) with the Open node.
In order to know what the public IP address is, you must have your server publish that IP address in a publicly-accessible place and have your game request that information from that place.
To have a public IP address, you will have to host the dedicated server somewhere that provides a public IP address that will not get lost in Network Address Translation due to being behind a private network like happens on most home internet connections.

Steam overcomes that NAT problem by use of its STUN/TURN/ICE methods or something like that. The Steam online subsystem knows how to talk to that and create and connect to Listen Servers that are hosting using Steam, over public internet because of that Steam-provided method. This is probably the easiest way to set up online multiplayer for an Unreal game, but Steam is not cross-platform, and the Online subsystem will break Android builds for example, so I have settled on paying a little each month for public hosting, and dedicated servers, and trying things like AWS and DigitalOcean, which works, but I think for the lowest pricing I am not getting good latency.

Just to add on top of the comment above, if your ip is lost in a the network of your provider, in some cases, you can request for a exclusive ipv4 ip address for you, i had to do that with my provider and it took 2 days.