How to get Create/Join Session IP

Hello,

I am currently trying to implement a simple test Multiplayer system with the new Create/Find/Join Session commands.
I am able to Create/Find and Join sessions that I have created, but I have no idea how I can load a map from the Client who Created the Session and also be able to connect to it with the other Clients.
I know that “open Testmap?listen” will create map for joining and also that the clients have to type "open ", but I am not able to get any IP address where I can join to.
I can’t understand that when you find a Session that you can’t just get the IP from the Session via the struct like “Get ServerIP”, and I have no idea how to get the IP otherwise or how to manage the Sessions in a matter where the one who Created the Session is able to execute a command where it automaticly loads the map for everyone, but trying to do stuff like “servertravel Testmap” doesn’t work like that.

Is there a way to get the IP from a Session where you can connect to? Or do you have to do all that joining a map stuff different?

UE4 does not have internal solution for that (except LAN support) … most games don’t, they usually use external services to list servers (so called “master list”) that send beacon calls (and i think UE4 actully has support for that) so then can be listed and downloaded list by user can be used to find specific server and thats just fro dedicated servers, it’s even more complex for client-side made sessions (popularly called P2P but it’s not always real P2P)

So you have 2 options use:

  1. Code your own solution, for example using HTTP, that lists sessions and then find them, this will require C++
  2. Use external online service, like SteamWorks, Google+ games, also on consoles PSN or Xbox Live they provide session listing features. UE4 got common interface to use them all called iOnlineSubsystem

https://docs.unrealengine.com/latest/INT/API/Runtime/OnlineSubsystem/IOnlineSubsystem/index.html

This will most likely require registration your application on service (if there no test mode), also don’t know how much this is exposed to blueprint i know TappyChicken use Leadderboard and Achievements features (and note they all work the same few platfroms) of those services in blueprint so that might be good starting point

Hmm interesting, thats for the information.

My Problem is that I am actually trying to implement the LAN connections for now, but I don’t want to do it by simply entering 127.0.0.1, since I was trying to go for something where you can for instance join each others over lan with the help of Hamachi/Tunngle.

Looking on API refrence and engine source code you could use LAN search via OnlineSubsystemNull (OnlineSubsystem module that don’t use any network service), so i guess good direction is to learn how to use OnlineSubsystems in first place. As you may notice they are devided in to modules for each gaming network service that UE4 supports to which oyu can communicate via common interface so you dont need to write support for each network service

TappyChicken is a only blueprint example that i know it’s using IOnlineSubsystem

The simplest solution I can think of is developing a resful web api in a language like node.js or even PHP. There are probably 1000’s of tutorials on the subject. There are also a few plugins that expose some http blueprint nodes for posting and getting json right in the engine. When a user creates a new game the game posts up to the api and tells it things like what’s the hosts name and what’s the hosts IP address. Then the clients get a list of servers from the api which has the hosts name and the hosts IP. The next step is running the console command in blueprint to open 12.12.12.12 and let UE4 take over the rest. Host needs 7777 udp opened. To avoid that situation you’re really going to be looking at something more custom with NAT punch-through.

For someone that knows little to nothing about C++ (or programming in general), is there a way to pass other information through the “JoinSession” functionality in blueprints? I know that you can get the server name and whether or not it’s LAN, how many current players, and the maximum amount of players. I’m sure this is something that you can do when writing the game in C++, and I’m ok with doing that, but I wouldn’t even know where to begin, how to implement that functionality, or how to combine that with what we already have set up in Blueprints (I know you can expose variables in C++ that can be edited via blueprints, but I don’t know exactly how to do that either)