Unreal Engine 4.23 Networking not ready in GameMode

In 4.23 IpNetDriver is starting after Gamemode it seems and I am unable to run more then 1 server on an instance since I don’t have the port available in GameMode to send to Gamelift. Has Anyone figured out a work around for this. I.e. a place to call the Gamelift Server SDK code instead of GameMode that runs after the Networking is setup?

I am sorry you are having problems. Have pinged a few people to see if they have any thoughts but I am not sure anyone has encountered this.

I would suggest asking on the Unreal forums as this is specific to Unreal start up order.

You can separate the InitSDK and ProcessReady calls in the GameLift Server SDK/Unreal Plugin, so it should be possible to wait for IpNetDriver to complete its set-up. You may need to implement an event or similar to listen for.

@David_Heath

Try to create gameInstanceSubsystem, and onMapLoadedFinished initialize gameLiftSDK:

Something like this:

/**

  • Author: Tahir Slezovic
    */

#include “UMyGameInstanceSubsystem.h”
#include “AwsFunctionLibrary.h”
#include “Engine/World.h”

void UMyGameInstanceSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);

FCoreUObjectDelegates::PreLoadMap.AddUObject(this, &UFBGameInstanceSubsystem::OnMapLoadStarted);
FCoreUObjectDelegates::PostLoadMapWithWorld.AddUObject(this, &UFBGameInstanceSubsystem::OnMapLoadFinished);

GLog->Log(“Initialize GameInstance Subsystem”);
}

void UMyGameInstanceSubsystem::Deinitialize()
{
Super::Deinitialize();

FCoreUObjectDelegates::PreLoadMap.RemoveAll(this);
FCoreUObjectDelegates::PostLoadMapWithWorld.RemoveAll(this);

GLog->Log(“SUBSYSTEM Deinitialize GameInstance Subsystem”);
}

void UMyGameInstanceSubsystem::OnMapLoadStarted(const FString & MapName)
{
GLog->Log("SUBSYSTEM GameInstance Subsystem Map Load Started " + MapName);

}

void UMyGameInstanceSubsystem::OnMapLoadFinished(UWorld * LoadedWorld)
{
GLog->Log("SUBSYSTEM GameInstance Subsystem Map Load Finished, RUNNING ON PORT: " + FString::FromInt(LoadedWorld->URL.Port));

if (LoadedWorld->IsServer()) {
UAwsFunctionLibrary::InitializeGameLift(LoadedWorld->URL.Port);
}

}

1 Like