Unreal Engine 4.23 Networking not ready in GameMode

0

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?

demandé il y a 4 ans190 vues
2 réponses
0

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.

répondu il y a 4 ans
0

@REDACTEDUSER

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); }

}

répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions