Download

Create (Advanced) Session / Join Session - Join does nothing, server doesn't seem to react

Just started up a basic project in UE4.20.1. I added the Advanced Sessions plugin because it allows you to create a session for a dedicated server (Player Controller is not required). To summarize the issue, the player can query for sessions and finds it, but when doing a “Join Session”, nothing happens. The client should be opening the server’s level. The server’s console doesn’t show any incoming connections and the GameMode’s “OnPostLogin” never executes. On the client, the session state is “No Session”. I’ve gotten this to work before but I am failing to see where the breakdown is.

Here’s the details

SERVER STUFF
GameInfoInstance (MyGameInstance):

If this is being launched as a dedicated server, execute a Create Advanced Session then open the level (MyMap) with the Listen option.

GameMode (MyGameMode)

This is the only other server code to report if a client connects

To launch the server, I run a .bat file with the following:
“E:\Games\UE_4.20\Engine\Binaries\Win64\UE4Editor.exe” “C:\Users<username>\Documents\Unreal Projects\ItsAGame\ItsAGame.uproject” MyMap PORT=7777 -server -game -log
-NOSTEAM

My DefaultEngine.ini has
[OnlineSubsystem]
DefaultPlatformService=Null

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

[/Script/OnlineSubsystemUtils.IpNetDriver]
InitialConnectTimeout=120.0

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName=“OnlineSubsystemSteam.SteamNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName=“OnlineSubsystemSteam.SteamNetConnection”

CLIENT STUFF
GameInfoInstance (MyGameInstance)

If the game is launched and it is not a dedicated server, wait until the Player Controller is valid then add a “Default Menu” widget to the viewport. This is just done because it takes a little longer to get the Player Controller setup so this will fail without retrying.

Default Menu (User Widget) - PART 1

When the menu is built, run a query for dedicated server sessions. On success, report the number of servers found (continued on PART 2)

Default Menu (User Widget) - PART 2

Loop through each session return and create a “Server Entry” widget, adding it to a Vertical Menu within the “Default Menu” widget.

Server Entry (User Widget)

When created, get information from the session and add it to a button for that server. Note that the session info is saved directly from the Default Menu.
When the button is clicked, send the session info to the Player Controller to handle connecting.

MyPlayerController (Player Controller)

Get the session info and call Join Session. Print the session state.

So here’s how it goes. First I start the server with the .bat above. The console output looks good.

[2018.08.17-18.20.56:317] 0]LogLoad: (Engine Initialization) Total Blueprint compile time: 0.00 seconds
[2018.08.17-18.20.58:335] 60]LogInit: WinSock: I am DESKTOP-D4GM4C4 (192.168.1.6:0)
[2018.08.17-18.20.59:358] 91]LogBlueprintUserMessages: [MyGameInstance_C_0] Created session - opening level
[2018.08.17-18.20.59:392] 92]LogNet: Browse: /Game/MyContent/Maps/MyMap?listen
[2018.08.17-18.20.59:392] 92]LogLoad: LoadMap: /Game/MyContent/Maps/MyMap?listen
[2018.08.17-18.20.59:393] 92]LogNet: World NetDriver shutdown SteamNetDriver_0 [GameNetDriver]
[2018.08.17-18.20.59:393] 92]LogNet: DestroyNamedNetDriver SteamNetDriver_0 [GameNetDriver]
[2018.08.17-18.20.59:394] 92]LogExit: GameNetDriver SteamNetDriver_0 shut down
[2018.08.17-18.20.59:514] 92]LogAIModule: Creating AISystem for world MyMap
[2018.08.17-18.20.59:530] 92]LogLoad: Game class is ‘MyGameMode_C’
[2018.08.17-18.20.59:530] 92]LogTemp: Display: ParseSettings for GameNetDriver
[2018.08.17-18.20.59:530] 92]LogTemp: Display: ParseSettings for SteamNetDriver_1
[2018.08.17-18.20.59:531] 92]LogTemp: Display: ParseSettings for GameNetDriver
[2018.08.17-18.20.59:531] 92]LogNet: ReplicationDriverClass is null! Not using ReplicationDriver.
[2018.08.17-18.20.59:531] 92]LogNet: Display: SteamNetDriver_1 bound to port 7777
[2018.08.17-18.20.59:531] 92]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2018.08.17-18.20.59:532] 92]LogNet: GameNetDriver SteamNetDriver_1 IpNetDriver listening on port 7777
[2018.08.17-18.20.59:534] 92]LogWorld: Bringing World /Game/MyContent/Maps/MyMap.MyMap up for play (max tick rate 30) at 2018.08.17-14.20.59
[2018.08.17-18.20.59:534] 92]LogWorld: Bringing up level for play took: 0.001171
[2018.08.17-18.20.59:535] 92]LogLoad: Took 0.141670 seconds to LoadMap(/Game/MyContent/Maps/MyMap)

Then I launch the client. It queries for sessions and creates a button for each result.

If I click the session, I get my “No Session” output and the player is never loaded into the level.

Subsequent clicks result in a failure to join the session.

And the server console remains unchanged.

I don’t know where the breakdown could be. Clearly the session is being created and found OK, but it seems like when a player connects to the session, they are not being properly redirectly to the MyMap?listen level on the server. I suspect the issue is within the server setup but I don’t know what else to check. Any suggestions?

Edit: Figured it out. Launching it in this way it can’t use Steam. I changed bEnabled=false and it worked.

but bEnabled enables steam… so how does this connect
btw great tutorial