[URGENT] Why does AOnlineBeaconHost::Init() keep failing?

So I am trying to learn how to use online beacons in UE4, and there seems to be scarce information and documentation on how to use it. I’m trying to get information from a client listen server that’s waiting idle and keep running into issues trying to write the beacon in my game instance.


#include "Engine/GameInstance.h"
#include "DefconOnlineBeaconHost.h"
#include "DefconOnlineBeaconHostObject.h"
#include "MyGameInstance.generated.h"

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = GlobalCommands)
		ADefconOnlineBeaconHost* Beacon;

	UFUNCTION(BlueprintCallable, Category = GlobalCommands)
		void InitializeBeaconHost();

void UNWGameInstance::InitializeBeaconHost()

	if (Beacon)
		Beacon = NULL;

	// Create the hosting connection
	ADefconOnlineBeaconHost* BeaconHost = GetWorld()->SpawnActor<ADefconOnlineBeaconHost>(ADefconOnlineBeaconHost::StaticClass());

	if (BeaconHost && BeaconHost->InitHost())
		// Register a class to handle traffic of a specific type
		ADefconOnlineBeaconHostObject* BeaconHostObject = GetWorld()->SpawnActor<ADefconOnlineBeaconHostObject>(ADefconOnlineBeaconHost::StaticClass());
		if (BeaconHostObject)
			Beacon = BeaconHost;
			GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Red, TEXT("There was an error: BeaconHostObject is a nullptr."));

		GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Red, TEXT("Beacon->Init() failed."));
	if (Beacon)

		GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Red, TEXT("There was an error: Beacon is a null ptr."));


#include "CoreMinimal.h"
#include "OnlineBeaconHost.h"
#include "MyOnlineBeaconHost.generated.h"

class DEFCON5DEV_API ADefconOnlineBeaconHost : public AOnlineBeaconHost


    UFUNCTION(BlueprintCallable, Category = GlobalCommands)
	void MyCustomGetListenPort();

#include “MyProject.h”
#include “MyOnlineBeaconHost.h”

void AMyOnlineBeaconHost::MyCustomGetListenPort()
	GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Green, TEXT("Getting Listen Port... Please Wait."));
	GEngine->AddOnScreenDebugMessage(-1, 10, FColor::Green, FString::Printf(TEXT("Beacon Listening Port: %d"), GetListenPort()));

###In MyGameInstance.cpp, when I try to call BeaconHost->InitHost(), it returns false (meaning that it failed to complete successfully). Any help would be greatly appreciated. I’m on a time constrained project right now, so there are no wrong answers on this one.

I’ll take a guess or anything, so even if your not sure, through up your ideas. I’ve spent a few days trying to work out this issue and I’m way behind on this project now because of this.

I’ve traced the issue back to: bool AOnlineBeacon::InitBase()

It seems that NetDriver is NULL.

What would I do for the DriverClassName if I’m using OnlineSubsytemNULL rather than Steam?

Use what I’ve put in the fallback but instead as the DriverClassName

Let me try it out. I’ll get back to you within a few days. Thanks!

Well, I don’t have a great way of testing this as I need to use a custom NetDriver. Can you point me in the right direction for that?

You’re very likely missing the BeaconNetDriver definition.