Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Feature/UNR-2132 additional endpoint support patch 4.20 #1531

Merged
merged 29 commits into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d86a79d
Adding API endpoints for China.
improbable-danny Nov 27, 2019
39191ff
Adding API endpoints for China.
improbable-danny Nov 27, 2019
d311e18
Merge branch 'feature/UNR-2132-china-support-patch-4-20' of github.co…
improbable-danny Nov 27, 2019
0110a63
Added release note
improbable-danny Nov 27, 2019
08ca4ba
Update CHANGELOG.md
improbable-danny Nov 27, 2019
59897b7
FIxes from review
improbable-danny Nov 27, 2019
fd3029e
Merge branch 'feature/UNR-2132-china-support-patch-4-20' of github.co…
improbable-danny Nov 27, 2019
ffd320b
Update SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/Deployment…
improbable-danny Nov 27, 2019
7e92960
Update SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/Deployment…
improbable-danny Nov 27, 2019
88cf127
Update SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/Deployment…
improbable-danny Nov 27, 2019
d24b97f
Merge branch 'feature/UNR-2132-china-support-patch-4-20' of github.co…
improbable-danny Nov 27, 2019
bd336b3
Updating spatial version
improbable-danny Nov 28, 2019
0f0fd0e
Modifying Setup.bat to respect china endpoints
improbable-danny Nov 28, 2019
96e1204
Changing china flag to capital
improbable-danny Nov 28, 2019
6dcbffa
Fixed URL based on the console
improbable-danny Nov 29, 2019
f61e747
Update Setup.bat
improbable-danny Dec 2, 2019
fd39121
Apply suggestions from code review
improbable-danny Dec 2, 2019
4748715
Update DeploymentLauncher.cs
improbable-danny Dec 2, 2019
afb6dd0
Some items from the review
improbable-danny Dec 2, 2019
bb265e0
Merge branch 'feature/UNR-2132-china-support-patch-4-20' of github.co…
improbable-danny Dec 2, 2019
2e1c383
Changed comparison to case-insensitive and using --china to supply ar…
improbable-danny Dec 2, 2019
1b7fd05
Adding --China to shell script also
improbable-danny Dec 2, 2019
0c63a81
Update CHANGELOG.md
improbable-danny Dec 2, 2019
93ab8c8
Apply suggestions from code review
improbable-danny Dec 3, 2019
8f6cf48
+ Command-line args changed to lowercase
improbable-danny Dec 3, 2019
b2acc7c
+ Command-line args changed to lowercase + Changed tabs->spaces + Sor…
improbable-danny Dec 3, 2019
8265d84
Fix spaces
improbable-danny Dec 3, 2019
7b705b5
Fixed formatting
improbable-danny Dec 3, 2019
5b02826
Updated spot version
improbable-danny Dec 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format of this Changelog is based on [Keep a Changelog](https://keepachangel
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased-`x.y.z`] - 2019-xx-xx
- You can now launch cloud deployments in China by specifying the `CN` region in the Deployment Launcher.
- Setup.bat and Setup.sh both accept --China which is required for running spatial commands the CN region.

## [`0.6.2`] - 2019-10-10

Expand Down
23 changes: 13 additions & 10 deletions Setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ call :MarkStartOfBlock "Setup variables"
set SCHEMA_COPY_DIR=%~dp0..\..\..\spatial\schema\unreal\gdk
set SCHEMA_STD_COPY_DIR=%~dp0..\..\..\spatial\build\dependencies\schema\standard_library
set SPATIAL_DIR=%~dp0..\..\..\spatial

set DOMAIN_ENVIRONMENT_VAR=
for %%A in (%*) do (
if "%%A"=="--China" set DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
)
call :MarkEndOfBlock "Setup variables"

call :MarkStartOfBlock "Clean folders"
Expand Down Expand Up @@ -86,15 +89,15 @@ call :MarkStartOfBlock "Create folders"
call :MarkEndOfBlock "Create folders"

call :MarkStartOfBlock "Retrieve dependencies"
spatial package retrieve tools schema_compiler-x86_64-win32 %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\tools\schema_compiler-x86_64-win32.zip"
spatial package retrieve schema standard_library %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\schema\standard_library.zip"
spatial package retrieve worker_sdk c-dynamic-x86-msvc_md-win32 %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\c-dynamic-x86-msvc_md-win32.zip"
spatial package retrieve worker_sdk c-dynamic-x86_64-msvc_md-win32 %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\c-dynamic-x86_64-msvc_md-win32.zip"
spatial package retrieve worker_sdk c-dynamic-x86_64-gcc_libstdcpp-linux %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\c-dynamic-x86_64-gcc_libstdcpp-linux.zip"
spatial package retrieve worker_sdk c-static-fullylinked-arm-clang_libcpp-ios %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\c-static-fullylinked-arm-clang_libcpp-ios.zip"
spatial package retrieve worker_sdk core-dynamic-x86_64-linux %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\core-dynamic-x86_64-linux.zip"
spatial package retrieve worker_sdk csharp %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\csharp.zip"
spatial package retrieve spot spot-win64 %PINNED_SPOT_VERSION% "%BINARIES_DIR%\Programs\spot.exe"
spatial package retrieve tools schema_compiler-x86_64-win32 %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\tools\schema_compiler-x86_64-win32.zip"
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
spatial package retrieve schema standard_library %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\schema\standard_library.zip"
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
spatial package retrieve worker_sdk c-dynamic-x86-msvc_md-win32 %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\worker_sdk\c-dynamic-x86-msvc_md-win32.zip"
spatial package retrieve worker_sdk c-dynamic-x86_64-msvc_md-win32 %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\worker_sdk\c-dynamic-x86_64-msvc_md-win32.zip"
spatial package retrieve worker_sdk c-dynamic-x86_64-gcc_libstdcpp-linux %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\worker_sdk\c-dynamic-x86_64-gcc_libstdcpp-linux.zip"
spatial package retrieve worker_sdk c-static-fullylinked-arm-clang_libcpp-ios %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\worker_sdk\c-static-fullylinked-arm-clang_libcpp-ios.zip"
spatial package retrieve worker_sdk core-dynamic-x86_64-linux %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\worker_sdk\core-dynamic-x86_64-linux.zip"
spatial package retrieve worker_sdk csharp %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\worker_sdk\csharp.zip"
spatial package retrieve spot spot-win64 %PINNED_SPOT_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%BINARIES_DIR%\Programs\spot.exe"
call :MarkEndOfBlock "Retrieve dependencies"

call :MarkStartOfBlock "Unpack dependencies"
Expand Down
22 changes: 13 additions & 9 deletions Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ markStartOfBlock "Setup variables"
BINARIES_DIR="$(dirname "$0")/SpatialGDK/Binaries/ThirdParty/Improbable"
SCHEMA_COPY_DIR="$(dirname "$0")/../../../spatial/schema/unreal/gdk"
SCHEMA_STD_COPY_DIR="$(dirname "$0")/../../../spatial/build/dependencies/schema/standard_library"
DOMAIN_ENVIRONMENT_VAR=
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
if [[ "$*" == "--China" ]]; then
DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production
fi
markEndOfBlock "Setup variables"

markStartOfBlock "Clean folders"
Expand All @@ -86,15 +90,15 @@ markStartOfBlock "Create folders"
markEndOfBlock "Create folders"

markStartOfBlock "Retrieve dependencies"
spatial package retrieve tools schema_compiler-x86_64-win32 $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/tools/schema_compiler-x86_64-win32.zip
spatial package retrieve schema standard_library $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/schema/standard_library.zip
spatial package retrieve worker_sdk c-dynamic-x86-msvc_md-win32 $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/worker_sdk/c-dynamic-x86-msvc_md-win32.zip
spatial package retrieve worker_sdk c-dynamic-x86_64-msvc_md-win32 $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/worker_sdk/c-dynamic-x86_64-msvc_md-win32.zip
spatial package retrieve worker_sdk c-dynamic-x86_64-gcc_libstdcpp-linux $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/worker_sdk/c-dynamic-x86_64-gcc_libstdcpp-linux.zip
spatial package retrieve worker_sdk c-dynamic-x86_64-clang_libcpp-macos $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/worker_sdk/c-dynamic-x86_64-clang_libcpp-macos.zip
spatial package retrieve worker_sdk c-static-fullylinked-arm-clang_libcpp-ios $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/worker_sdk/c-static-fullylinked-arm-clang_libcpp-ios.zip
spatial package retrieve worker_sdk core-dynamic-x86_64-linux $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/worker_sdk/core-dynamic-x86_64-linux.zip
spatial package retrieve worker_sdk csharp $PINNED_CORE_SDK_VERSION $CORE_SDK_DIR/worker_sdk/csharp.zip
spatial package retrieve tools schema_compiler-x86_64-win32 $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/tools/schema_compiler-x86_64-win32.zip
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
spatial package retrieve schema standard_library $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/schema/standard_library.zip
spatial package retrieve worker_sdk c-dynamic-x86-msvc_md-win32 $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/worker_sdk/c-dynamic-x86-msvc_md-win32.zip
spatial package retrieve worker_sdk c-dynamic-x86_64-msvc_md-win32 $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/worker_sdk/c-dynamic-x86_64-msvc_md-win32.zip
spatial package retrieve worker_sdk c-dynamic-x86_64-gcc_libstdcpp-linux $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/worker_sdk/c-dynamic-x86_64-gcc_libstdcpp-linux.zip
spatial package retrieve worker_sdk c-dynamic-x86_64-clang_libcpp-macos $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/worker_sdk/c-dynamic-x86_64-clang_libcpp-macos.zip
spatial package retrieve worker_sdk c-static-fullylinked-arm-clang_libcpp-ios $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/worker_sdk/c-static-fullylinked-arm-clang_libcpp-ios.zip
spatial package retrieve worker_sdk core-dynamic-x86_64-linux $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/worker_sdk/core-dynamic-x86_64-linux.zip
spatial package retrieve worker_sdk csharp $PINNED_CORE_SDK_VERSION $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/worker_sdk/csharp.zip
markEndOfBlock "Retrieve dependencies"

markStartOfBlock "Unpack dependencies"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Security.Cryptography;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using Improbable.SpatialOS.Platform.Common;
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
using Improbable.SpatialOS.Deployment.V1Alpha1;
using Improbable.SpatialOS.PlayerAuth.V2Alpha1;
using Improbable.SpatialOS.Snapshot.V1Alpha1;
Expand All @@ -22,6 +23,8 @@ internal class DeploymentLauncher

private const string CoordinatorWorkerName = "SimulatedPlayerCoordinator";

private const string CHINA_ENDPOINT_URL = "platform-cn-production.api.spatialoschina.com";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure this is the right endpoint, didi @Helcaraxan confirm this was the one?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been platform.api.spatialoschina.com. The production environment does not appears in the URL.


private static string UploadSnapshot(SnapshotServiceClient client, string snapshotPath, string projectName,
string deploymentName)
{
Expand Down Expand Up @@ -77,6 +80,15 @@ private static string UploadSnapshot(SnapshotServiceClient client, string snapsh

return confirmUploadResponse.Snapshot.Id;
}

private static PlatformApiEndpoint GetApiEndpoint(string region)
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
{
if (region == "CN")
{
return new PlatformApiEndpoint(CHINA_ENDPOINT_URL, 443);
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
}
return null; // Use default
}

private static int CreateDeployment(string[] args)
{
Expand Down Expand Up @@ -109,7 +121,7 @@ private static int CreateDeployment(string[] args)

try
{
var deploymentServiceClient = DeploymentServiceClient.Create();
var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(mainDeploymentRegion));

if (DeploymentExists(deploymentServiceClient, projectName, mainDeploymentName))
{
Expand Down Expand Up @@ -220,7 +232,7 @@ private static void StopDeploymentByName(DeploymentServiceClient deploymentServi
private static Operation<Deployment, CreateDeploymentMetadata> CreateMainDeploymentAsync(DeploymentServiceClient deploymentServiceClient,
bool launchSimPlayerDeployment, string projectName, string assemblyName, string mainDeploymentName, string mainDeploymentJsonPath, string mainDeploymentSnapshotPath, string regionCode)
{
var snapshotServiceClient = SnapshotServiceClient.Create();
var snapshotServiceClient = SnapshotServiceClient.Create(GetApiEndpoint(regionCode));

// Upload snapshots.
var mainSnapshotId = UploadSnapshot(snapshotServiceClient, mainDeploymentSnapshotPath, projectName,
Expand Down Expand Up @@ -268,7 +280,7 @@ private static Operation<Deployment, CreateDeploymentMetadata> CreateMainDeploym
private static Operation<Deployment, CreateDeploymentMetadata> CreateSimPlayerDeploymentAsync(DeploymentServiceClient deploymentServiceClient,
string projectName, string assemblyName, string mainDeploymentName, string simDeploymentName, string simDeploymentJsonPath, string regionCode, int simNumPlayers)
{
var playerAuthServiceClient = PlayerAuthServiceClient.Create();
var playerAuthServiceClient = PlayerAuthServiceClient.Create(GetApiEndpoint(regionCode));

// Create development authentication token used by the simulated players.
var dat = playerAuthServiceClient.CreateDevelopmentAuthenticationToken(
Expand Down Expand Up @@ -356,8 +368,9 @@ private static Operation<Deployment, CreateDeploymentMetadata> CreateSimPlayerDe
private static int StopDeployments(string[] args)
joshuahuburn marked this conversation as resolved.
Show resolved Hide resolved
{
var projectName = args[1];
var regionCode = args[2];

var deploymentServiceClient = DeploymentServiceClient.Create();
var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode));
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved

if (args.Length == 3)
{
Expand Down Expand Up @@ -407,8 +420,9 @@ private static void StopDeploymentById(DeploymentServiceClient client, string pr
private static int ListDeployments(string[] args)
{
var projectName = args[1];
var regionCode = args[2];

var deploymentServiceClient = DeploymentServiceClient.Create();
var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode));
var activeDeployments = ListLaunchedActiveDeployments(deploymentServiceClient, projectName);

foreach (var deployment in activeDeployments)
Expand Down Expand Up @@ -462,20 +476,20 @@ private static void ShowUsage()
{
Console.WriteLine("Usage:");
Console.WriteLine("DeploymentLauncher create <project-name> <assembly-name> <main-deployment-name> <main-deployment-json> <main-deployment-snapshot> <main-deployment-region> [<sim-deployment-name> <sim-deployment-json> <sim-deployment-region> <num-sim-players>]");
Console.WriteLine($" Starts a cloud deployment, with optionally a simulated player deployment. The deployments can be started in different regions ('EU', 'US' and 'AP').");
Console.WriteLine("DeploymentLauncher stop <project-name> [deployment-id]");
Console.WriteLine($" Starts a cloud deployment, with optionally a simulated player deployment. The deployments can be started in different regions ('EU', 'US', 'AP' and 'CN').");
Console.WriteLine("DeploymentLauncher stop <project-name> <main-deployment-region> [deployment-id]");
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
Console.WriteLine(" Stops the specified deployment within the project.");
Console.WriteLine(" If no deployment id argument is specified, all active deployments started by the deployment launcher in the project will be stopped.");
Console.WriteLine("DeploymentLauncher list <project-name>");
Console.WriteLine("DeploymentLauncher list <project-name> <main-deployment-region>");
Console.WriteLine(" Lists all active deployments within the specified project that are started by the deployment launcher.");
}

private static int Main(string[] args)
{
if (args.Length == 0 ||
args[0] == "create" && (args.Length != 11 && args.Length != 7) ||
improbable-danny marked this conversation as resolved.
Show resolved Hide resolved
args[0] == "stop" && (args.Length != 2 && args.Length != 3) ||
args[0] == "list" && args.Length != 2)
args[0] == "stop" && (args.Length != 3 && args.Length != 4) ||
args[0] == "list" && args.Length != 3)
{
ShowUsage();
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ bool SpatialGDKCloudStop()
const USpatialGDKEditorSettings* SpatialGDKSettings = GetDefault<USpatialGDKEditorSettings>();

const FString CmdExecutable = TEXT("cmd.exe");
const FString LauncherCmdArguments = TEXT("/c DeploymentLauncher.exe stop");
const FString LauncherCmdArguments = FString::Printf(
TEXT("/c DeploymentLauncher.exe stop %s"),
*SpatialGDKSettings->GetPrimaryRegionCode().ToString()
);

FProcHandle DeploymentLauncherProcHandle = FPlatformProcess::CreateProc(
*CmdExecutable, *LauncherCmdArguments, true, false, false, nullptr, 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ USpatialGDKEditorSettings::USpatialGDKEditorSettings(const FObjectInitializer& O
, PrimaryDeploymentRegionCode(ERegionCode::US)
, SimulatedPlayerLaunchConfigPath(FSpatialGDKServicesModule::GetSpatialGDKPluginDirectory(TEXT("SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/WorkerCoordinator/SpatialConfig/cloud_launch_sim_player_deployment.json")))
, SimulatedPlayerDeploymentRegionCode(ERegionCode::US)
, bRunningInChina(false)
{
SpatialOSLaunchConfig.FilePath = GetSpatialOSLaunchConfig();
SpatialOSSnapshotFile = GetSpatialOSSnapshotFile();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ namespace ERegionCode
US = 1,
EU,
AP,
CN
};
}

Expand Down Expand Up @@ -297,7 +298,10 @@ class SPATIALGDKEDITOR_API USpatialGDKEditorSettings : public UObject

UPROPERTY(EditAnywhere, config, Category = "Simulated Players", meta = (EditCondition = "bSimulatedPlayersIsEnabled", ConfigRestartRequired = false, DisplayName = "Number of simulated players"))
uint32 NumberOfSimulatedPlayers;


UPROPERTY(EditAnywhere, Config, Category = "Region settings", meta = (ConfigRestartRequired = true, DisplayName = "Running in China"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ConfigRestartRequired really true here?

Copy link
Contributor Author

@improbable-danny improbable-danny Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vaguely remember there being a callback for changed properties so i'll investigate that because that would prevent the restart - it's because the deployment code can't read directly from the setting (used in LocalDeploymentManager) which is set on startup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replied on another thread with info here https://github.com/spatialos/UnrealGDK/pull/1531/files#r352600670

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I understand this correctly, a restart would also be required because we start our services on editor startup, and we don't want to over-complicate things by adding logic to restart the service in a different environment upon toggling this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's right - Josh suggested that we can get access to the settings once we have added service settings or something accessible by the services project on the dev branch

bool bRunningInChina;

static bool IsAssemblyNameValid(const FString& Name);
static bool IsProjectNameValid(const FString& Name);
static bool IsDeploymentNameValid(const FString& Name);
Expand Down Expand Up @@ -452,4 +456,6 @@ class SPATIALGDKEDITOR_API USpatialGDKEditorSettings : public UObject
}

bool IsDeploymentConfigurationValid() const;

FORCEINLINE bool IsRunningInChina() const { return bRunningInChina; }
};
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void FSpatialGDKEditorToolbarModule::StartupModule()
FSpatialGDKServicesModule& GDKServices = FModuleManager::GetModuleChecked<FSpatialGDKServicesModule>("SpatialGDKServices");
LocalDeploymentManager = GDKServices.GetLocalDeploymentManager();
LocalDeploymentManager->SetAutoDeploy(GetDefault<USpatialGDKEditorSettings>()->bAutoStartLocalDeployment);
LocalDeploymentManager->SetInChina(GetDefault<USpatialGDKEditorSettings>()->IsRunningInChina());

// Bind the play button delegate to starting a local spatial deployment.
if (!UEditorEngine::TryStartSpatialDeployment.IsBound() && GetDefault<USpatialGDKEditorSettings>()->bAutoStartLocalDeployment)
Expand Down
Loading