Interface Selection

This is obviously beyond the scope of this course, so I’m not asking for help from official channels, but I’m curious if anyone can point me/us in the right direction.

I notice that when I join the session it is connecting over my vpn network interface, so I started hunting for a way to configure which interface is used for creating, searching, and joinging a session, and I’m coming up empty.

I expected to find something in the FOnlineSessionSettings and/or FOnlineSessionSearch->QuerySettings or similar, but I’m not seeing anything. I couldn’t even find a listing of the setting available in those classes, so I went to the header files, and I’m not seeing anytihng related to Network Interfaces.

I would like to be able to find create a list of network interfaces and pass their name or IP, or whatever is most useful, to the UI and allow players to select the interface from a dropdown when they create, search, join etc.

So, for clarification, you have multiple Internet connections and you want to specify which one is used for gaming?

If so, that is more of a routing configuration on your pc. You can specify ip ranges and the adapter to route traffic to. I very much doubt this is something that you would handle inside a game without perhaps modifying the engine code.

I could be wrong here. I do know (as I’ve done this before) that you can set static routes via a command prompt so that will hold true.

I don’t know if this is of any help to you.

No, I’m sorry, I must not have explained it well.

I have multiple Network Interfaces on my PC. I actually have several because Networking is my profession and I do some odd things, but it’s common for people to use a VPN and that will create a virtual interface.

So this is part of my ipconfig output

Ethernet adapter Ethernet 3:

  • Connection-specific DNS Suffix . :*
  • IPv4 Address. . . . . . . . . . . : [Ommitted because it’s a public IP]*
  • Subnet Mask . . . . . . . . . . . : 255.255.255.255*
  • Default Gateway . . . . . . . . . :*

[…Removed several other interfaces for clarity…]

Ethernet adapter VMware Network Adapter VMnet8:

  • Connection-specific DNS Suffix . :*
  • Link-local IPv6 Address . . . . . : fe80::a1c4:55fe:312c:4b40%22*
  • IPv4 Address. . . . . . . . . . . : 192.168.234.1*
  • Subnet Mask . . . . . . . . . . . : 255.255.255.0*
  • Default Gateway . . . . . . . . . :*

Wireless LAN adapter Wi-Fi:

  • Connection-specific DNS Suffix . : acenet.local*
  • IPv4 Address. . . . . . . . . . . : 10.0.0.156*
  • Subnet Mask . . . . . . . . . . . : 255.255.255.0*
  • Default Gateway . . . . . . . . . : 10.0.0.1*

So “Wireless LAN adapter Wi-Fi:” is my standard network interface that I would like to use (again, just using me as an example) but “Ethernet adapter Ethernet 3:” is my VPN interface and it is the one that ??The Subsystem?? is using. Probably because it has a public IP Address, so a lot of algorythms would prefer it.

So, what I would like to be able to do is present players with a dropdown to select which Network Interface they use to host, search, joing etc.

That part did make sense. I am really not sure in that case to be honest and am not sure this is even something you can do. You can try asking over in the gamedev tv discord, possibly the Unreal forums and also the Unreal slackers (something else now) discord too which will probably be able to help and I’ve found them very helpful in the past for unusual and mac solves.

This is for servers but might be relevant: How to set the network adapter for server multiplayer - Multiplayer & Networking - Epic Developer Community Forums

Not an answer to your question per-se, but it may be of interest. I was curious about the macro “SEARCH_PRESENCE” and in particular what other useful things might be packaged obscurely like this. After coming up empty with the Unreal API Documentation search, I found that OnlineSessionNames.h contains a list of them (there’s a bunch of other useful stuff in there too, but nothing that relates directly sorry):

/**
 * Search settings
 */

/** Search only for dedicated servers (value is true/false) */
#define SEARCH_DEDICATED_ONLY FName(TEXT("DEDICATEDONLY"))
/** Search for empty servers only (value is true/false) */
#define SEARCH_EMPTY_SERVERS_ONLY FName(TEXT("EMPTYONLY"))
/** Search for non empty servers only (value is true/false) */
#define SEARCH_NONEMPTY_SERVERS_ONLY FName(TEXT("NONEMPTYONLY"))
/** Search for secure servers only (value is true/false) */
#define SEARCH_SECURE_SERVERS_ONLY FName(TEXT("SECUREONLY"))
/** Search for presence sessions only (value is true/false) */
#define SEARCH_PRESENCE FName(TEXT("PRESENCESEARCH"))
/** Search for a match with min player availability (value is int) */
#define SEARCH_MINSLOTSAVAILABLE FName(TEXT("MINSLOTSAVAILABLE"))
/** Exclude all matches where any unique ids in a given array are present (value is string of the form "uniqueid1;uniqueid2;uniqueid3") */
#define SEARCH_EXCLUDE_UNIQUEIDS FName(TEXT("EXCLUDEUNIQUEIDS"))
/** User ID to search for session of */
#define SEARCH_USER FName(TEXT("SEARCHUSER"))
/** Keywords to match in session search */
#define SEARCH_KEYWORDS FName(TEXT("SEARCHKEYWORDS"))
/** The matchmaking queue name to matchmake in, e.g. "TeamDeathmatch" (value is string) */
#define SEARCH_MATCHMAKING_QUEUE FName(TEXT("MATCHMAKINGQUEUE"))
/** If set, use the named Xbox Live hopper to find a session via matchmaking (value is a string) */
#define SEARCH_XBOX_LIVE_HOPPER_NAME FName(TEXT("LIVEHOPPERNAME"))
/** Which session template from the service configuration to use */
#define SEARCH_XBOX_LIVE_SESSION_TEMPLATE_NAME FName(TEXT("LIVESESSIONTEMPLATE"))
/** Selection method used to determine which match to join when multiple are returned (valid only on Switch) */
#define SEARCH_SWITCH_SELECTION_METHOD FName(TEXT("SWITCHSELECTIONMETHOD"))
/** Whether to use lobbies vs sessions */
#define SEARCH_LOBBIES FName(TEXT("LOBBYSEARCH"))

The ‘exclude’ option allows players to blacklist other players, and never meet them in matches again (I think).

1 Like

This is very useful, thank you.

It looks like there is no mechanism in UE for doing what I want, so I would need to implement it for each platform (Windows, OSX, etc) in a production product. There are standard libraries (no pun intended) that make it easier, so not a big deal, but it would be nice to have built in and handled for us like so many other things in UE.

1 Like

Privacy & Terms