Add Editor Preference to control server selection
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "Blueprint/WidgetBlueprintLibrary.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "Engine/GameInstance.h"
|
||||
#include "ProjectSettings.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "AnimQueue.h"
|
||||
@@ -214,14 +215,13 @@ void ALuprexGameModeBase::InitializeGlobalState()
|
||||
|
||||
// Possibly tell the engine to connect to a server.
|
||||
if (Playing) {
|
||||
FString LuprexServer;
|
||||
FParse::Value(FCommandLine::Get(), TEXT("-LuprexServer="), LuprexServer);
|
||||
LuprexServer = LuprexServer.ToLower();
|
||||
UE_LOG(LogTemp, Display, TEXT("LuprexServer = %s"), *LuprexServer)
|
||||
if (LuprexServer != TEXT("standalone"))
|
||||
{
|
||||
FTCHARToUTF8 utf8server(LuprexServer);
|
||||
w->play_access(w.Get(), AccessKind::CONNECT_TO_SERVER, 0, utf8server.Length(), utf8server.Get(), nullptr, nullptr);
|
||||
UlxServerSelection* Server = GetDefault<UlxProjectSettings>()->ActiveServer.LoadSynchronous();
|
||||
if (Server) {
|
||||
FString Host = Server->Host.TrimStartAndEnd();
|
||||
if (!Host.IsEmpty()) {
|
||||
FTCHARToUTF8 utf8server(*Server->Host);
|
||||
w->play_access(w.Get(), AccessKind::CONNECT_TO_SERVER, 0, utf8server.Length(), utf8server.Get(), nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user