Netera
(Shai)
May 2, 2016, 2:54pm
1
I am trying to spawn an AOnlineBeaconHost actor trough
BeaconHostListener = GetWorld()->SpawnActor<AOnlineBeaconHost>(AOnlineBeaconHost::StaticClass());
When i call the creation of the AOnlineBeaconHost actor i receive the log:
CreateNamedNetDriver failed to create driver from definition BeaconNetDriver
After that if I try to call InitHost() it returns false .
At first my game DefaultEngine.ini didn’t define a BeaconNetDriver and was
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
Then I examine the Unreal Tournament DefaultEngine.ini and updated mine
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="BeaconNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[/Script/OnlineSubsystemUtils.OnlineBeaconHost]
ListenPort=7787
BeaconConnectionInitialTimeout=48.0
BeaconConnectionTimeout=49.0
Nevertheless nothing changed.
Someone know the proper way to create and init an AOnlineBeaconHost class actor?
Netera
(Shai)
May 3, 2016, 2:36pm
2
I updated all the DefaultEngine.ini in my project (even in Saved folder) and resolved
Hey I’ve copied the above lines into my DefaultEngine.ini files.
There’s only 2 of those files, one in Config and one in Temp (I think the one in Temp is just a backup and not really changing anything?).
I still get the same error “CreateNamedNetDriver failed to create driver from definition BeaconNetDriver” whenever I try to InitHost().
Any other suggestions?
I’m currently in 4.17.
Netera
(Shai)
September 18, 2017, 9:56pm
4
Create a new FNetDriverDefinition to add to GEngine’s NetDriverDefinitions, then restart the game/editor.
FNetDriverDefinition BeaconDriverDefinition;
BeaconDriverDefinition.DefName = NAME_BeaconNetDriver;
BeaconDriverDefinition.DriverClassName = FName("/Script/OnlineSubsystemUtils.IpNetDriver");
BeaconDriverDefinition.DriverClassNameFallback = FName("/Script/OnlineSubsystemUtils.IpNetDriver");
1 Like
Thanks for the reply Shai.
Where do I add this piece of code?
Netera
(Shai)
September 19, 2017, 7:11pm
6
It doesn’t matter, just be sure to call it and then restart the editor. Add a check, to prevent adding multiple definition, somethings like this before add the beacondriverdefinition
for (auto& Definition : GEngine->NetDriverDefinitions)
{
if (Definition.DefName == NAME_BeaconNetDriver)
{
return;
}
}
I was running into the same issue, and instead of adding it via code, you can fix the ini file. It is supposed to be set in “[/Script/Engine.Engine]” not “[/Script/Engine.GameEngine]”
2 Likes
Thanks, for some reason changing config files doesn’t work for, placing this into custom GameInstance Init function worked:
for (auto& Definition : GEngine->NetDriverDefinitions)
{
if (Definition.DefName == NAME_BeaconNetDriver)
{
return;
}
}
FNetDriverDefinition BeaconDriverDefinition;
BeaconDriverDefinition.DefName = NAME_BeaconNetDriver;
BeaconDriverDefinition.DriverClassName = FName("/Script/OnlineSubsystemEOS.NetDriverEOS");
BeaconDriverDefinition.DriverClassNameFallback = FName("/Script/OnlineSubsystemUtils.IpNetDriver");
GEngine->NetDriverDefinitions.Add(BeaconDriverDefinition);