i created a class that extended UIpNetDriver because i need to override a function
[TABLE]
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "IpNetDriver.h"
#include "UObject/ObjectMacros.h"
#include "MobileNetDriver.generated.h"
/**
*
*/
UCLASS()
class CASTLEVERSUS_API UMobileNetDriver : public UIpNetDriver
{
GENERATED_BODY()
bool InitListen(FNetworkNotify* InNotify, FURL& ListenURL, bool bReuseAddressAndPort, FString& Error) override;
};
so far so good
my problem is that there is no enough info about how to add it to DefaultEngine. I tried to add it loking at other plugin projects
[TABLE]
[/Script/Engine.Engine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")
[/Script/OnlineSubsystemUtils.IpNetDriver]
NetConnectionClassName="/Scripts/CastleVersus.MobileNetDriver"
then i test loading a map with listen. The game mode of that map is this
[TABLE]
void AVersusGameMode::BeginPlay()
{
Super::BeginPlay();
UNetDriver* driver= GetWorld()->GetNetDriver();
UMobileNetDriver* MobileNetDriver = Cast<UMobileNetDriver>(driver);
if(MobileNetDriver==nullptr)
{
UE_LOG(LogTemp, Error, TEXT("other path name %s"), *driver->GetPathName());
UE_LOG(LogTemp, Error, TEXT("GetPathName %s"), *UMobileNetDriver::StaticClass()->GetPathName());
}
[TABLE]
UNetDriver* driver= GetWorld()->GetNetDriver(); result null
because name not found.
what am i missing?