From d86a79df10b71ec9bb549da7a7f59e90d6fc302a Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Wed, 27 Nov 2019 10:15:59 +0000 Subject: [PATCH 01/25] Adding API endpoints for China. .NET upgraded to 4.6.1 to link to new Platform SDK --- .../DeploymentLauncher/DeploymentLauncher.cs | 22 ++++++++++++++----- .../DeploymentLauncher.csproj | 4 ++-- .../Public/SpatialGDKEditorSettings.h | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index d85ef32607..f730c67aca 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -8,6 +8,7 @@ using System.Security.Cryptography; using Google.LongRunning; using Google.Protobuf.WellKnownTypes; +using Improbable.SpatialOS.Platform.Common; using Improbable.SpatialOS.Deployment.V1Alpha1; using Improbable.SpatialOS.PlayerAuth.V2Alpha1; using Improbable.SpatialOS.Snapshot.V1Alpha1; @@ -77,6 +78,14 @@ private static string UploadSnapshot(SnapshotServiceClient client, string snapsh return confirmUploadResponse.Snapshot.Id; } + private static PlatformApiEndpoint GetApiEndpoint(string region) + { + if(region == "CN") + { + return new PlatformApiEndpoint("api.cn-production.spatialoschina.com", 443); + } + return null; // Use default + } private static int CreateDeployment(string[] args) { @@ -109,7 +118,7 @@ private static int CreateDeployment(string[] args) try { - var deploymentServiceClient = DeploymentServiceClient.Create(); + var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(mainDeploymentRegion)); if (DeploymentExists(deploymentServiceClient, projectName, mainDeploymentName)) { @@ -220,7 +229,7 @@ private static void StopDeploymentByName(DeploymentServiceClient deploymentServi private static Operation 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, @@ -268,7 +277,7 @@ private static Operation CreateMainDeploym private static Operation 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( @@ -356,8 +365,8 @@ private static Operation CreateSimPlayerDe private static int StopDeployments(string[] args) { var projectName = args[1]; - - var deploymentServiceClient = DeploymentServiceClient.Create(); + var regionCode = args[6]; + var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode)); if (args.Length == 3) { @@ -407,8 +416,9 @@ private static void StopDeploymentById(DeploymentServiceClient client, string pr private static int ListDeployments(string[] args) { var projectName = args[1]; + var regionCode = args[6]; - var deploymentServiceClient = DeploymentServiceClient.Create(); + var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode)); var activeDeployments = ListLaunchedActiveDeployments(deploymentServiceClient, projectName); foreach (var deployment in activeDeployments) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj index 4ba3f2bd08..29022f23a1 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj @@ -9,7 +9,7 @@ Properties DeploymentLauncher DeploymentLauncher - v4.5.1 + v4.6.1 512 true @@ -43,7 +43,7 @@ - 13.7.1 + 14.2.1 12.0.1 diff --git a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h index 35de44d74e..9f97e97046 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h +++ b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h @@ -207,6 +207,7 @@ namespace ERegionCode US = 1, EU, AP, + CN }; } From 39191ff9f1177c72bd141cd6f502689bec6104ea Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Wed, 27 Nov 2019 10:15:59 +0000 Subject: [PATCH 02/25] Adding API endpoints for China. .NET upgraded to 4.6.1 to link to new Platform SDK --- .../DeploymentLauncher/DeploymentLauncher.cs | 22 ++++++++++++++----- .../DeploymentLauncher.csproj | 4 ++-- .../Public/SpatialGDKEditorSettings.h | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index d85ef32607..f730c67aca 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -8,6 +8,7 @@ using System.Security.Cryptography; using Google.LongRunning; using Google.Protobuf.WellKnownTypes; +using Improbable.SpatialOS.Platform.Common; using Improbable.SpatialOS.Deployment.V1Alpha1; using Improbable.SpatialOS.PlayerAuth.V2Alpha1; using Improbable.SpatialOS.Snapshot.V1Alpha1; @@ -77,6 +78,14 @@ private static string UploadSnapshot(SnapshotServiceClient client, string snapsh return confirmUploadResponse.Snapshot.Id; } + private static PlatformApiEndpoint GetApiEndpoint(string region) + { + if(region == "CN") + { + return new PlatformApiEndpoint("api.cn-production.spatialoschina.com", 443); + } + return null; // Use default + } private static int CreateDeployment(string[] args) { @@ -109,7 +118,7 @@ private static int CreateDeployment(string[] args) try { - var deploymentServiceClient = DeploymentServiceClient.Create(); + var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(mainDeploymentRegion)); if (DeploymentExists(deploymentServiceClient, projectName, mainDeploymentName)) { @@ -220,7 +229,7 @@ private static void StopDeploymentByName(DeploymentServiceClient deploymentServi private static Operation 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, @@ -268,7 +277,7 @@ private static Operation CreateMainDeploym private static Operation 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( @@ -356,8 +365,8 @@ private static Operation CreateSimPlayerDe private static int StopDeployments(string[] args) { var projectName = args[1]; - - var deploymentServiceClient = DeploymentServiceClient.Create(); + var regionCode = args[6]; + var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode)); if (args.Length == 3) { @@ -407,8 +416,9 @@ private static void StopDeploymentById(DeploymentServiceClient client, string pr private static int ListDeployments(string[] args) { var projectName = args[1]; + var regionCode = args[6]; - var deploymentServiceClient = DeploymentServiceClient.Create(); + var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode)); var activeDeployments = ListLaunchedActiveDeployments(deploymentServiceClient, projectName); foreach (var deployment in activeDeployments) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj index 4ba3f2bd08..29022f23a1 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj @@ -9,7 +9,7 @@ Properties DeploymentLauncher DeploymentLauncher - v4.5.1 + v4.6.1 512 true @@ -43,7 +43,7 @@ - 13.7.1 + 14.2.1 12.0.1 diff --git a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h index 35de44d74e..9f97e97046 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h +++ b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h @@ -207,6 +207,7 @@ namespace ERegionCode US = 1, EU, AP, + CN }; } From 0110a63052c641d5a5de6cf0016427f2f76a8581 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Wed, 27 Nov 2019 11:39:11 +0000 Subject: [PATCH 03/25] Added release note --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7360a54cf4..40cb8196b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ 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 +- Adding CN endpoints to DeploymentLauncher ## [`0.6.2`] - 2019-10-10 From 08ca4ba2924323c63f95b3e040227523b1380d8c Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Wed, 27 Nov 2019 12:07:44 +0000 Subject: [PATCH 04/25] Update CHANGELOG.md Co-Authored-By: Oliver Balaam --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40cb8196b6..3d23ed524e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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 -- Adding CN endpoints to DeploymentLauncher +- You can now launch cloud deployments in China by specifying the `CN` region in the Deployment Launcher. ## [`0.6.2`] - 2019-10-10 From 59897b7dafb2195ebb37e9825c76b4c7805bbb6f Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Wed, 27 Nov 2019 14:03:43 +0000 Subject: [PATCH 05/25] FIxes from review --- CHANGELOG.md | 2 +- .../DeploymentLauncher/DeploymentLauncher.cs | 14 +++++++------- .../DeploymentLauncher/DeploymentLauncher.csproj | 4 ++-- .../Private/SpatialGDKEditorCloudLauncher.cpp | 5 ++++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40cb8196b6..3d23ed524e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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 -- Adding CN endpoints to DeploymentLauncher +- You can now launch cloud deployments in China by specifying the `CN` region in the Deployment Launcher. ## [`0.6.2`] - 2019-10-10 diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index f730c67aca..797a56a58d 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -365,7 +365,7 @@ private static Operation CreateSimPlayerDe private static int StopDeployments(string[] args) { var projectName = args[1]; - var regionCode = args[6]; + var regionCode = args[2]; var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode)); if (args.Length == 3) @@ -416,7 +416,7 @@ private static void StopDeploymentById(DeploymentServiceClient client, string pr private static int ListDeployments(string[] args) { var projectName = args[1]; - var regionCode = args[6]; + var regionCode = args[2]; var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode)); var activeDeployments = ListLaunchedActiveDeployments(deploymentServiceClient, projectName); @@ -472,11 +472,11 @@ private static void ShowUsage() { Console.WriteLine("Usage:"); Console.WriteLine("DeploymentLauncher create [ ]"); - 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 [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 [deployment-id]"); 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 "); + Console.WriteLine("DeploymentLauncher list "); Console.WriteLine(" Lists all active deployments within the specified project that are started by the deployment launcher."); } @@ -484,8 +484,8 @@ private static int Main(string[] args) { if (args.Length == 0 || args[0] == "create" && (args.Length != 11 && args.Length != 7) || - 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; diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj index 29022f23a1..4ba3f2bd08 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.csproj @@ -9,7 +9,7 @@ Properties DeploymentLauncher DeploymentLauncher - v4.6.1 + v4.5.1 512 true @@ -43,7 +43,7 @@ - 14.2.1 + 13.7.1 12.0.1 diff --git a/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorCloudLauncher.cpp b/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorCloudLauncher.cpp index 87ab7fc1b6..c4c4433c24 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorCloudLauncher.cpp +++ b/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorCloudLauncher.cpp @@ -50,7 +50,10 @@ bool SpatialGDKCloudStop() const USpatialGDKEditorSettings* SpatialGDKSettings = GetDefault(); 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, From ffd320b52c53cce149f4687524b62767f2150163 Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Wed, 27 Nov 2019 14:08:42 +0000 Subject: [PATCH 06/25] Update SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs Co-Authored-By: Michael Samiec --- .../DeploymentLauncher/DeploymentLauncher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index 797a56a58d..c765727f18 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -80,7 +80,7 @@ private static string UploadSnapshot(SnapshotServiceClient client, string snapsh } private static PlatformApiEndpoint GetApiEndpoint(string region) { - if(region == "CN") + if (region == "CN") { return new PlatformApiEndpoint("api.cn-production.spatialoschina.com", 443); } From 7e9296005c6ac0c6298fb217a687a9c893192dd4 Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Wed, 27 Nov 2019 14:09:34 +0000 Subject: [PATCH 07/25] Update SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs Co-Authored-By: Michael Samiec --- .../DeploymentLauncher/DeploymentLauncher.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index c765727f18..7d55e05f91 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -78,6 +78,7 @@ private static string UploadSnapshot(SnapshotServiceClient client, string snapsh return confirmUploadResponse.Snapshot.Id; } + private static PlatformApiEndpoint GetApiEndpoint(string region) { if (region == "CN") From 88cf1271c0ef8b64f175d20c9dd793f212f41717 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Wed, 27 Nov 2019 14:09:34 +0000 Subject: [PATCH 08/25] Update SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs Co-Authored-By: Michael Samiec --- .../DeploymentLauncher/DeploymentLauncher.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index c765727f18..7d55e05f91 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -78,6 +78,7 @@ private static string UploadSnapshot(SnapshotServiceClient client, string snapsh return confirmUploadResponse.Snapshot.Id; } + private static PlatformApiEndpoint GetApiEndpoint(string region) { if (region == "CN") From bd336b34724fb68a8b9d0623eb1a2f6f6d4158db Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Thu, 28 Nov 2019 11:37:04 +0000 Subject: [PATCH 09/25] Updating spatial version --- .../SpatialGDKServices/Private/LocalDeploymentManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp b/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp index 52b4d642f9..22651d5e7e 100644 --- a/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp +++ b/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp @@ -20,7 +20,7 @@ DEFINE_LOG_CATEGORY(LogSpatialDeploymentManager); static const FString SpatialExe(TEXT("spatial.exe")); -static const FString SpatialServiceVersion(TEXT("20190716.094149.1b6d448edd")); +static const FString SpatialServiceVersion(TEXT("20191128.003423.475a3c1edb")); FLocalDeploymentManager::FLocalDeploymentManager() : bLocalDeploymentRunning(false) From 0f0fd0e079271a69b54254c7dae236832009bf19 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Thu, 28 Nov 2019 14:58:45 +0000 Subject: [PATCH 10/25] Modifying Setup.bat to respect china endpoints Adding endpoint settings to LocalDeploymentManager --- Setup.bat | 24 ++++++++++------- .../Private/SpatialGDKEditorSettings.cpp | 1 + .../Public/SpatialGDKEditorSettings.h | 7 ++++- .../Private/SpatialGDKEditorToolbar.cpp | 1 + .../Private/LocalDeploymentManager.cpp | 26 ++++++++++++++++--- .../Public/LocalDeploymentManager.h | 3 +++ 6 files changed, 47 insertions(+), 15 deletions(-) diff --git a/Setup.bat b/Setup.bat index d17758a503..2cf24e6a23 100644 --- a/Setup.bat +++ b/Setup.bat @@ -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 + ) call :MarkEndOfBlock "Setup variables" call :MarkStartOfBlock "Clean folders" @@ -85,16 +88,17 @@ 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% "%CORE_SDK_DIR%\tools\schema_compiler-x86_64-win32.zip" %DOMAIN_ENVIRONMENT_VAR% + spatial package retrieve schema standard_library %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\schema\standard_library.zip" %DOMAIN_ENVIRONMENT_VAR% + 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" %DOMAIN_ENVIRONMENT_VAR% + 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" %DOMAIN_ENVIRONMENT_VAR% + 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" %DOMAIN_ENVIRONMENT_VAR% + 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" %DOMAIN_ENVIRONMENT_VAR% + 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" %DOMAIN_ENVIRONMENT_VAR% + spatial package retrieve worker_sdk csharp %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\csharp.zip" %DOMAIN_ENVIRONMENT_VAR% + spatial package retrieve spot spot-win64 %PINNED_SPOT_VERSION% "%BINARIES_DIR%\Programs\spot.exe" %DOMAIN_ENVIRONMENT_VAR% call :MarkEndOfBlock "Retrieve dependencies" call :MarkStartOfBlock "Unpack dependencies" diff --git a/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp b/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp index 53a7708456..a1c387b240 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp +++ b/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp @@ -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(); diff --git a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h index 9f97e97046..35c8cf4e23 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h +++ b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h @@ -298,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")) + bool bRunningInChina; + static bool IsAssemblyNameValid(const FString& Name); static bool IsProjectNameValid(const FString& Name); static bool IsDeploymentNameValid(const FString& Name); @@ -453,4 +456,6 @@ class SPATIALGDKEDITOR_API USpatialGDKEditorSettings : public UObject } bool IsDeploymentConfigurationValid() const; + + bool IsRunningInChina() const { return bRunningInChina; } }; diff --git a/SpatialGDK/Source/SpatialGDKEditorToolbar/Private/SpatialGDKEditorToolbar.cpp b/SpatialGDK/Source/SpatialGDKEditorToolbar/Private/SpatialGDKEditorToolbar.cpp index d982ff5f42..7aad6273ee 100644 --- a/SpatialGDK/Source/SpatialGDKEditorToolbar/Private/SpatialGDKEditorToolbar.cpp +++ b/SpatialGDK/Source/SpatialGDKEditorToolbar/Private/SpatialGDKEditorToolbar.cpp @@ -73,6 +73,7 @@ void FSpatialGDKEditorToolbarModule::StartupModule() FSpatialGDKServicesModule& GDKServices = FModuleManager::GetModuleChecked("SpatialGDKServices"); LocalDeploymentManager = GDKServices.GetLocalDeploymentManager(); LocalDeploymentManager->SetAutoDeploy(GetDefault()->bAutoStartLocalDeployment); + LocalDeploymentManager->SetInChina(GetDefault()->IsRunningInChina()); // Bind the play button delegate to starting a local spatial deployment. if (!UEditorEngine::TryStartSpatialDeployment.IsBound() && GetDefault()->bAutoStartLocalDeployment) diff --git a/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp b/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp index 22651d5e7e..10ca0b5829 100644 --- a/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp +++ b/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp @@ -22,6 +22,18 @@ DEFINE_LOG_CATEGORY(LogSpatialDeploymentManager); static const FString SpatialExe(TEXT("spatial.exe")); static const FString SpatialServiceVersion(TEXT("20191128.003423.475a3c1edb")); +namespace +{ + FString GetDomainEnvironmentStr(bool bIsInChina) + { + FString DomainEnvironmentStr; + if (bIsInChina) + { + DomainEnvironmentStr = FString::Printf(TEXT("--domain=%s --environment=%s"), TEXT("spatialoschina.com"), TEXT("cn-production")); + } + return DomainEnvironmentStr; + } +} FLocalDeploymentManager::FLocalDeploymentManager() : bLocalDeploymentRunning(false) , bSpatialServiceRunning(false) @@ -34,6 +46,7 @@ FLocalDeploymentManager::FLocalDeploymentManager() // Get the project name from the spatialos.json. ProjectName = GetProjectName(); + #if PLATFORM_WINDOWS // Don't kick off background processes when running commandlets if (IsRunningCommandlet() == false) @@ -57,6 +70,11 @@ FLocalDeploymentManager::FLocalDeploymentManager() #endif } +void FLocalDeploymentManager::SetInChina(bool bChinaEnabled) +{ + bIsInChina = bChinaEnabled; +} + const FString FLocalDeploymentManager::GetSpotExe() { return FSpatialGDKServicesModule::GetSpatialGDKPluginDirectory(TEXT("SpatialGDK/Binaries/ThirdParty/Improbable/Programs/spot.exe")); @@ -122,7 +140,7 @@ void FLocalDeploymentManager::WorkerBuildConfigAsync() { AsyncTask(ENamedThreads::AnyBackgroundThreadNormalTask, [this] { - FString BuildConfigArgs = TEXT("worker build build-config"); + FString BuildConfigArgs = FString::Printf(TEXT("worker build build-config %s"), *GetDomainEnvironmentStr(bIsInChina)); FString WorkerBuildConfigResult; int32 ExitCode; ExecuteAndReadOutput(SpatialExe, BuildConfigArgs, FSpatialGDKServicesModule::GetSpatialOSDirectory(), WorkerBuildConfigResult, ExitCode); @@ -368,7 +386,7 @@ bool FLocalDeploymentManager::TryStartSpatialService() bStartingSpatialService = true; - FString SpatialServiceStartArgs = FString::Printf(TEXT("service start --version=%s"), *SpatialServiceVersion); + FString SpatialServiceStartArgs = FString::Printf(TEXT("service start --version=%s %s"), *SpatialServiceVersion, *GetDomainEnvironmentStr(bIsInChina)); FString ServiceStartResult; int32 ExitCode; ExecuteAndReadOutput(SpatialExe, SpatialServiceStartArgs, FSpatialGDKServicesModule::GetSpatialOSDirectory(), ServiceStartResult, ExitCode); @@ -400,7 +418,7 @@ bool FLocalDeploymentManager::TryStopSpatialService() { bStoppingSpatialService = true; - FString SpatialServiceStartArgs = TEXT("service stop"); + FString SpatialServiceStartArgs = FString::Printf(TEXT("service stop %s"), *GetDomainEnvironmentStr(bIsInChina)); FString ServiceStopResult; int32 ExitCode; ExecuteAndReadOutput(SpatialExe, SpatialServiceStartArgs, FSpatialGDKServicesModule::GetSpatialOSDirectory(), ServiceStopResult, ExitCode); @@ -490,7 +508,7 @@ bool FLocalDeploymentManager::GetLocalDeploymentStatus() bool FLocalDeploymentManager::GetServiceStatus() { - FString SpatialServiceStatusArgs = TEXT("service status"); + FString SpatialServiceStatusArgs = FString::Printf(TEXT("service status %s"), *GetDomainEnvironmentStr(bIsInChina)); FString ServiceStatusResult; int32 ExitCode; ExecuteAndReadOutput(SpatialExe, SpatialServiceStatusArgs, FSpatialGDKServicesModule::GetSpatialOSDirectory(), ServiceStatusResult, ExitCode); diff --git a/SpatialGDK/Source/SpatialGDKServices/Public/LocalDeploymentManager.h b/SpatialGDK/Source/SpatialGDKServices/Public/LocalDeploymentManager.h index 936838b2da..96fb82cd90 100644 --- a/SpatialGDK/Source/SpatialGDKServices/Public/LocalDeploymentManager.h +++ b/SpatialGDK/Source/SpatialGDKServices/Public/LocalDeploymentManager.h @@ -17,6 +17,8 @@ class FLocalDeploymentManager public: FLocalDeploymentManager(); + void SPATIALGDKSERVICES_API SetInChina(bool IsInChina); + void SPATIALGDKSERVICES_API RefreshServiceStatus(); bool SPATIALGDKSERVICES_API TryStartLocalDeployment(FString LaunchConfig, FString LaunchArgs); @@ -83,4 +85,5 @@ class FLocalDeploymentManager bool bRedeployRequired = false; bool bAutoDeploy = false; + bool bIsInChina = false; }; From 96e12041de28b8d813c17d2165bfa5ffe55f6edb Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Thu, 28 Nov 2019 15:53:09 +0000 Subject: [PATCH 11/25] Changing china flag to capital --- Setup.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Setup.bat b/Setup.bat index 2cf24e6a23..5d76376601 100644 --- a/Setup.bat +++ b/Setup.bat @@ -59,7 +59,7 @@ call :MarkStartOfBlock "Setup variables" 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 + IF "%%A"=="/China" set DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production ) call :MarkEndOfBlock "Setup variables" From 6dcbffaf06ff05feccd3b40f2aee6dee100b42f4 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Fri, 29 Nov 2019 14:51:33 +0000 Subject: [PATCH 12/25] Fixed URL based on the console --- .../DeploymentLauncher/DeploymentLauncher.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index 7d55e05f91..151a89f7d4 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -81,9 +81,9 @@ private static string UploadSnapshot(SnapshotServiceClient client, string snapsh private static PlatformApiEndpoint GetApiEndpoint(string region) { - if (region == "CN") + if (region == "CN") { - return new PlatformApiEndpoint("api.cn-production.spatialoschina.com", 443); + return new PlatformApiEndpoint("platform-cn-production.api.spatialoschina.com", 443); } return null; // Use default } From f61e7477ac2b83048f52f525760f8f4b9424463b Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Mon, 2 Dec 2019 11:18:49 +0000 Subject: [PATCH 13/25] Update Setup.bat Fixing whitespace --- Setup.bat | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Setup.bat b/Setup.bat index 5d76376601..09d060ae8b 100644 --- a/Setup.bat +++ b/Setup.bat @@ -90,15 +90,15 @@ 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" %DOMAIN_ENVIRONMENT_VAR% - spatial package retrieve schema standard_library %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\schema\standard_library.zip" %DOMAIN_ENVIRONMENT_VAR% - 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" %DOMAIN_ENVIRONMENT_VAR% - 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" %DOMAIN_ENVIRONMENT_VAR% - 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" %DOMAIN_ENVIRONMENT_VAR% - 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" %DOMAIN_ENVIRONMENT_VAR% - 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" %DOMAIN_ENVIRONMENT_VAR% - spatial package retrieve worker_sdk csharp %PINNED_CORE_SDK_VERSION% "%CORE_SDK_DIR%\worker_sdk\csharp.zip" %DOMAIN_ENVIRONMENT_VAR% - spatial package retrieve spot spot-win64 %PINNED_SPOT_VERSION% "%BINARIES_DIR%\Programs\spot.exe" %DOMAIN_ENVIRONMENT_VAR% + 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" + 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-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" From fd39121f281059829c43718d79659df9b93de9b9 Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Mon, 2 Dec 2019 11:21:21 +0000 Subject: [PATCH 14/25] Apply suggestions from code review + Formatting suggestions Co-Authored-By: improbable-valentyn <32096431+improbable-valentyn@users.noreply.github.com> Co-Authored-By: Joshua Huburn <31517089+joshuahuburn@users.noreply.github.com> --- Setup.bat | 9 ++++----- .../DeploymentLauncher/DeploymentLauncher.cs | 1 + .../Private/LocalDeploymentManager.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Setup.bat b/Setup.bat index 09d060ae8b..38cda2b8f5 100644 --- a/Setup.bat +++ b/Setup.bat @@ -57,10 +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 - ) + set DOMAIN_ENVIRONMENT_VAR= + for %%A in (%*) do ( + if "%%A"=="/China" set DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production + ) call :MarkEndOfBlock "Setup variables" call :MarkStartOfBlock "Clean folders" @@ -88,7 +88,6 @@ 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% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\tools\schema_compiler-x86_64-win32.zip" spatial package retrieve schema standard_library %PINNED_CORE_SDK_VERSION% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\schema\standard_library.zip" diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index 151a89f7d4..be1a660e66 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -367,6 +367,7 @@ private static int StopDeployments(string[] args) { var projectName = args[1]; var regionCode = args[2]; + var deploymentServiceClient = DeploymentServiceClient.Create(GetApiEndpoint(regionCode)); if (args.Length == 3) diff --git a/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp b/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp index 10ca0b5829..b78bedae90 100644 --- a/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp +++ b/SpatialGDK/Source/SpatialGDKServices/Private/LocalDeploymentManager.cpp @@ -29,11 +29,12 @@ namespace FString DomainEnvironmentStr; if (bIsInChina) { - DomainEnvironmentStr = FString::Printf(TEXT("--domain=%s --environment=%s"), TEXT("spatialoschina.com"), TEXT("cn-production")); + DomainEnvironmentStr = TEXT("--domain=spatialoschina.com --environment=cn-production"); } return DomainEnvironmentStr; } -} +} // anonymous namespace + FLocalDeploymentManager::FLocalDeploymentManager() : bLocalDeploymentRunning(false) , bSpatialServiceRunning(false) @@ -46,7 +47,6 @@ FLocalDeploymentManager::FLocalDeploymentManager() // Get the project name from the spatialos.json. ProjectName = GetProjectName(); - #if PLATFORM_WINDOWS // Don't kick off background processes when running commandlets if (IsRunningCommandlet() == false) From 4748715dbfa7279e0e1923436560254cbeea4bae Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Mon, 2 Dec 2019 11:28:58 +0000 Subject: [PATCH 15/25] Update DeploymentLauncher.cs Whitespace fix --- .../DeploymentLauncher/DeploymentLauncher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index be1a660e66..cfca7f0766 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -474,7 +474,7 @@ private static void ShowUsage() { Console.WriteLine("Usage:"); Console.WriteLine("DeploymentLauncher create [ ]"); - 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($" 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 [deployment-id]"); 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."); From afb6dd0cddaf7b52f7a5e68c4c24f2a374846fd2 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Mon, 2 Dec 2019 14:07:33 +0000 Subject: [PATCH 16/25] Some items from the review --- .../DeploymentLauncher/DeploymentLauncher.cs | 4 +++- .../Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index 151a89f7d4..c3a7377bff 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -23,6 +23,8 @@ internal class DeploymentLauncher private const string CoordinatorWorkerName = "SimulatedPlayerCoordinator"; + private const string CHINA_ENDPOINT_URL = "platform-cn-production.api.spatialoschina.com"; + private static string UploadSnapshot(SnapshotServiceClient client, string snapshotPath, string projectName, string deploymentName) { @@ -83,7 +85,7 @@ private static PlatformApiEndpoint GetApiEndpoint(string region) { if (region == "CN") { - return new PlatformApiEndpoint("platform-cn-production.api.spatialoschina.com", 443); + return new PlatformApiEndpoint(CHINA_ENDPOINT_URL, 443); } return null; // Use default } diff --git a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h index 35c8cf4e23..61b1280702 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h +++ b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h @@ -457,5 +457,5 @@ class SPATIALGDKEDITOR_API USpatialGDKEditorSettings : public UObject bool IsDeploymentConfigurationValid() const; - bool IsRunningInChina() const { return bRunningInChina; } + FORCEINLINE bool IsRunningInChina() const { return bRunningInChina; } }; From 2e1c3830c12a00025d411f41da17f34378800858 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Mon, 2 Dec 2019 14:15:30 +0000 Subject: [PATCH 17/25] Changed comparison to case-insensitive and using --china to supply argument instead --- Setup.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Setup.bat b/Setup.bat index 38cda2b8f5..ef4de0b1e0 100644 --- a/Setup.bat +++ b/Setup.bat @@ -59,7 +59,7 @@ call :MarkStartOfBlock "Setup variables" 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 + if /I "%%A"=="--china" set DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production ) call :MarkEndOfBlock "Setup variables" From 1b7fd057c9818171f9d761b6b7a274d3254d5271 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Mon, 2 Dec 2019 14:44:59 +0000 Subject: [PATCH 18/25] Adding --China to shell script also --- Setup.bat | 2 +- Setup.sh | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Setup.bat b/Setup.bat index ef4de0b1e0..1b4e4a1b7e 100644 --- a/Setup.bat +++ b/Setup.bat @@ -59,7 +59,7 @@ call :MarkStartOfBlock "Setup variables" set SPATIAL_DIR=%~dp0..\..\..\spatial set DOMAIN_ENVIRONMENT_VAR= for %%A in (%*) do ( - if /I "%%A"=="--china" set DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production + if "%%A"=="--China" set DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production ) call :MarkEndOfBlock "Setup variables" diff --git a/Setup.sh b/Setup.sh index 46b30c4e9b..cb190ca060 100755 --- a/Setup.sh +++ b/Setup.sh @@ -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= + if [[ "$*" == "--China" ]]; then + DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production + fi markEndOfBlock "Setup variables" markStartOfBlock "Clean folders" @@ -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 + 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" From 0c63a81c8a08c09557a280eda79235d798fa1d46 Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Mon, 2 Dec 2019 14:49:49 +0000 Subject: [PATCH 19/25] Update CHANGELOG.md Added some more info China flags --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d23ed524e..09731c9fcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +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. +- 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 From 93ab8c8ac525f8cd953fb8d1366135dd7008ecdd Mon Sep 17 00:00:00 2001 From: Danny Birch <57946331+improbable-danny@users.noreply.github.com> Date: Tue, 3 Dec 2019 10:34:05 +0000 Subject: [PATCH 20/25] Apply suggestions from code review Tabs->spaces Co-Authored-By: improbable-valentyn <32096431+improbable-valentyn@users.noreply.github.com> --- Setup.bat | 2 +- Setup.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Setup.bat b/Setup.bat index 1b4e4a1b7e..f6d3ec0394 100644 --- a/Setup.bat +++ b/Setup.bat @@ -89,7 +89,7 @@ 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% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\tools\schema_compiler-x86_64-win32.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" 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" diff --git a/Setup.sh b/Setup.sh index cb190ca060..23df617346 100755 --- a/Setup.sh +++ b/Setup.sh @@ -67,7 +67,7 @@ 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= + DOMAIN_ENVIRONMENT_VAR= if [[ "$*" == "--China" ]]; then DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production fi @@ -90,7 +90,7 @@ markStartOfBlock "Create folders" markEndOfBlock "Create folders" markStartOfBlock "Retrieve dependencies" - 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 + 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 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 From 8f6cf483414f0e300f771f6f84702f309491d542 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Tue, 3 Dec 2019 11:00:44 +0000 Subject: [PATCH 21/25] + Command-line args changed to lowercase + Changed tabs->spaces + Sorted DeploymentManager includes --- Setup.bat | 2 +- Setup.sh | 20 +++++++++---------- .../DeploymentLauncher/DeploymentLauncher.cs | 17 ++++++++-------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Setup.bat b/Setup.bat index f6d3ec0394..3d8fd0ff06 100644 --- a/Setup.bat +++ b/Setup.bat @@ -59,7 +59,7 @@ call :MarkStartOfBlock "Setup variables" 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 + if "%%A"=="--china" set DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production ) call :MarkEndOfBlock "Setup variables" diff --git a/Setup.sh b/Setup.sh index 23df617346..4c12853890 100755 --- a/Setup.sh +++ b/Setup.sh @@ -68,7 +68,7 @@ markStartOfBlock "Setup variables" SCHEMA_COPY_DIR="$(dirname "$0")/../../../spatial/schema/unreal/gdk" SCHEMA_STD_COPY_DIR="$(dirname "$0")/../../../spatial/build/dependencies/schema/standard_library" DOMAIN_ENVIRONMENT_VAR= - if [[ "$*" == "--China" ]]; then + if [[ "$*" == "--china" ]]; then DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production fi markEndOfBlock "Setup variables" @@ -90,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 $DOMAIN_ENVIRONMENT_VAR $CORE_SDK_DIR/tools/schema_compiler-x86_64-win32.zip - 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 + 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 + 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" diff --git a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs index c850cf736c..f187b931ff 100644 --- a/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs +++ b/SpatialGDK/Build/Programs/Improbable.Unreal.Scripts/DeploymentLauncher/DeploymentLauncher.cs @@ -1,18 +1,18 @@ // Copyright (c) Improbable Worlds Ltd, All Rights Reserved -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Security.Cryptography; using Google.LongRunning; using Google.Protobuf.WellKnownTypes; -using Improbable.SpatialOS.Platform.Common; using Improbable.SpatialOS.Deployment.V1Alpha1; +using Improbable.SpatialOS.Platform.Common; using Improbable.SpatialOS.PlayerAuth.V2Alpha1; using Improbable.SpatialOS.Snapshot.V1Alpha1; using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Security.Cryptography; +using System; namespace Improbable { @@ -24,6 +24,7 @@ internal class DeploymentLauncher private const string CoordinatorWorkerName = "SimulatedPlayerCoordinator"; private const string CHINA_ENDPOINT_URL = "platform-cn-production.api.spatialoschina.com"; + private const int CHINA_ENDPOINT_PORT = 443; private static string UploadSnapshot(SnapshotServiceClient client, string snapshotPath, string projectName, string deploymentName) @@ -85,7 +86,7 @@ private static PlatformApiEndpoint GetApiEndpoint(string region) { if (region == "CN") { - return new PlatformApiEndpoint(CHINA_ENDPOINT_URL, 443); + return new PlatformApiEndpoint(CHINA_ENDPOINT_URL, CHINA_ENDPOINT_PORT); } return null; // Use default } From b2acc7ce7a897095866945200a391ffc5867ca17 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Tue, 3 Dec 2019 11:28:27 +0000 Subject: [PATCH 22/25] + Command-line args changed to lowercase + Changed tabs->spaces + Sorted DeploymentManager includes --- CHANGELOG.md | 2 +- .../Private/SpatialGDKEditorSettings.cpp | 2 +- .../Public/SpatialGDKEditorSettings.h | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09731c9fcb..b23fd94358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [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. +- Setup.bat and Setup.sh both accept --china which is required for running spatial commands the CN region. ## [`0.6.2`] - 2019-10-10 diff --git a/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp b/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp index a1c387b240..47e45cf161 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp +++ b/SpatialGDK/Source/SpatialGDKEditor/Private/SpatialGDKEditorSettings.cpp @@ -26,7 +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) + , ServicesRegion(EServicesRegion::Default) { SpatialOSLaunchConfig.FilePath = GetSpatialOSLaunchConfig(); SpatialOSSnapshotFile = GetSpatialOSSnapshotFile(); diff --git a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h index 61b1280702..91ced1bf26 100644 --- a/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h +++ b/SpatialGDK/Source/SpatialGDKEditor/Public/SpatialGDKEditorSettings.h @@ -211,6 +211,16 @@ namespace ERegionCode }; } +UENUM() +namespace EServicesRegion +{ + enum Type + { + Default, + CN + }; +} + UCLASS(config = SpatialGDKEditorSettings, defaultconfig) class SPATIALGDKEDITOR_API USpatialGDKEditorSettings : public UObject { @@ -299,8 +309,8 @@ 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")) - bool bRunningInChina; + UPROPERTY(EditAnywhere, Config, Category = "Region settings", meta = (ConfigRestartRequired = true, DisplayName = "Region where services are located")) + TEnumAsByte ServicesRegion; static bool IsAssemblyNameValid(const FString& Name); static bool IsProjectNameValid(const FString& Name); @@ -457,5 +467,5 @@ class SPATIALGDKEDITOR_API USpatialGDKEditorSettings : public UObject bool IsDeploymentConfigurationValid() const; - FORCEINLINE bool IsRunningInChina() const { return bRunningInChina; } + FORCEINLINE bool IsRunningInChina() const { return ServicesRegion == EServicesRegion::CN; } }; From 8265d84dc40b9af6adf719e9d224535e3584c2b2 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Tue, 3 Dec 2019 11:56:16 +0000 Subject: [PATCH 23/25] Fix spaces --- Setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Setup.sh b/Setup.sh index 4c12853890..bd57b15e8f 100755 --- a/Setup.sh +++ b/Setup.sh @@ -68,9 +68,9 @@ markStartOfBlock "Setup variables" SCHEMA_COPY_DIR="$(dirname "$0")/../../../spatial/schema/unreal/gdk" SCHEMA_STD_COPY_DIR="$(dirname "$0")/../../../spatial/build/dependencies/schema/standard_library" DOMAIN_ENVIRONMENT_VAR= - if [[ "$*" == "--china" ]]; then - DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production - fi + if [[ "$*" == "--china" ]]; then + DOMAIN_ENVIRONMENT_VAR=--domain spatialoschina.com --environment cn-production + fi markEndOfBlock "Setup variables" markStartOfBlock "Clean folders" From 7b705b529ddad830174e2840fd0044157fa563d4 Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Tue, 3 Dec 2019 11:59:11 +0000 Subject: [PATCH 24/25] Fixed formatting --- Setup.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Setup.bat b/Setup.bat index 3d8fd0ff06..6a36693695 100644 --- a/Setup.bat +++ b/Setup.bat @@ -89,7 +89,7 @@ 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% %DOMAIN_ENVIRONMENT_VAR% "%CORE_SDK_DIR%\tools\schema_compiler-x86_64-win32.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" 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" From 5b02826f1316824a973799ea7526caca5093bbcd Mon Sep 17 00:00:00 2001 From: Danny Birch Date: Tue, 3 Dec 2019 13:58:49 +0000 Subject: [PATCH 25/25] Updated spot version --- SpatialGDK/Extras/spot.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SpatialGDK/Extras/spot.version b/SpatialGDK/Extras/spot.version index 5729794af5..41e6f4ad6b 100644 --- a/SpatialGDK/Extras/spot.version +++ b/SpatialGDK/Extras/spot.version @@ -1 +1 @@ -20190626.145947.9ed060f1af \ No newline at end of file +20191029.144741.87a7d78768 \ No newline at end of file