diff --git a/README.md b/README.md
index 13755c6..e5f012e 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,23 @@
-# Wizards! (SpatialOS)
+# SpatialOS SDK for Unity Wizards Tutorial
-
+**New from October 2018: The SpatialOS GDK for Unity**
+Check out the alpha release of our [SpatialOS Game Development Kit (GDK) for Unity](https://docs.improbable.io/unity/latest/welcome). Using the Unity Entity Component System (ECS), the GDK is the next evolution in developing SpatialOS games in Unity. The SpatialOS GDK for Unity is designed to replace the SpatialOS SDK for Unity and we recommend using it over using the SDK for new game projects. See our [blog post anouncement](https://improbable.io/games/blog/spatialos-gdk-for-unity-launch?utm_medium=docs&utm_source=onboarding&utm_campaign=spatialos-gdk-unity-launch&utm_content=10-oct) for more information.
-*****
+---
+
+> **Important notice:** We are retiring the Wizards project! This repository will remain in place, but we no longer recommend Wizards as part of your path to learning about SpatialOS. For a better experience, get hands-on with the [Pirates tutorial](https://github.com/spatialos/PiratesTutorial), learn the [core concepts of SpatialOS](https://docs.improbable.io/reference/latest/shared/concepts/spatialos), and read about tools for [running a live game](https://docs.improbable.io/reference/latest/shared/operate/inspector).
-*Copyright (C) 2017 Improbable Worlds Limited. All rights reserved.*
-- [Guide](https://docs.improbable.io/reference/13.0/shared/get-started/tour)
-- *GitHub repository*: https://github.com/spatialos/Wizards/
+
+
+
+- [Guide](https://docs.improbable.io/reference/13.0/shared/get-started/tour) (Website docs)
*****
### Introduction
-This repository contains a demo project built with [SpatialOS](http://www.spatialos.com).
+This repository contains a demo project built with [SpatialOS](https://docs.improbable.io/reference/13.0/shared/concepts/spatialos).
It demonstrates how to use SpatialOS to build a large and compelling simulated world.
The project serves as a starting point for the [hands-on SpatialOS product demo](https://docs.improbable.io/reference/13.0/shared/get-started/tour).
@@ -22,6 +26,16 @@ The main documentation for SpatialOS can be found [here](https://spatialos.impro
If you run into problems, or want to give us feedback, please visit the [SpatialOS forums](https://forums.improbable.io/).
+---
+
+**New from June 2018: The SpatialOS Unity GDK**
+Check out the pre-alpha release of our new Unity GDK: [source code on GitHub](https://github.com/spatialos/UnityGDK). Using the Unity Entity Component System (ECS), the GDK is the next evolution in SpatialOS Unity game development. See our [blog post on ECS-powered multiplayer](https://improbable.io/games/blog/unity-gdk-our-first-steps) for more information.
+
+
+**Note:** The pre-alpha GDK version is available for evaluation and feedback only. It's not yet game-development ready.
+
+---
+
#### To use the repository
* Make sure you have access to SpatialOS
@@ -36,3 +50,8 @@ If you run into problems, or want to give us feedback, please visit the [Spatial
* Update spatialos.json: edit the "name" parameter from `your_project_name_here` to your spatialOS project name and save it
* Upload the assembly: run `spatial cloud upload my_wizards_assembly`
* Launch the deployment: run `spatial cloud launch my_wizards_assembly default_launch.json my_wizards_deployment --snapshot=./snapshots/default.snapshot`
+
+
+
+---
+*Copyright (C) 2018 Improbable Worlds Limited. All rights reserved.*
diff --git a/spatialos.json b/spatialos.json
index 9b6809c..54f926f 100644
--- a/spatialos.json
+++ b/spatialos.json
@@ -1,8 +1,8 @@
{
"name": "your_project_name_here",
"project_version": "1.0.0",
- "sdk_version": "13.0.1",
+ "sdk_version": "13.3.0",
"dependencies": [
- {"name": "standard_library", "version": "13.0.1"}
+ {"name": "standard_library", "version": "13.3.0"}
]
}
diff --git a/workers/unity/Assets/Gamelogic/HQ/HQSpawnBarracksBehaviour.cs b/workers/unity/Assets/Gamelogic/HQ/HQSpawnBarracksBehaviour.cs
index 07c457b..56523e5 100644
--- a/workers/unity/Assets/Gamelogic/HQ/HQSpawnBarracksBehaviour.cs
+++ b/workers/unity/Assets/Gamelogic/HQ/HQSpawnBarracksBehaviour.cs
@@ -117,7 +117,7 @@ private void SpawnUnconstructedBarracksAtRandomLocation()
var teamId = teamAssignment.Data.teamId;
var template = EntityTemplateFactory.CreateBarracksTemplate(spawnPosition.ToCoordinates(), BarracksState.UNDER_CONSTRUCTION, teamId);
- SpatialOS.Commands.CreateEntity(hqInfo, template, new System.TimeSpan(0, 0, 30))
+ SpatialOS.Commands.CreateEntity(hqInfo, template, new System.TimeSpan(0, 0, 5))
.OnFailure(_ =>
{
Debug.LogWarning("HQ failed to spawn barracks due to timeout.");
diff --git a/workers/unity/Assets/Gamelogic/NPC/Lumberjack/LumberjackHarvestingState.cs b/workers/unity/Assets/Gamelogic/NPC/Lumberjack/LumberjackHarvestingState.cs
index 9ebbc65..7f72901 100644
--- a/workers/unity/Assets/Gamelogic/NPC/Lumberjack/LumberjackHarvestingState.cs
+++ b/workers/unity/Assets/Gamelogic/NPC/Lumberjack/LumberjackHarvestingState.cs
@@ -80,7 +80,7 @@ private void AttemptToHarvestTree()
new HarvestRequest(parentBehaviour.gameObject.EntityId()),
Owner.Data.targetEntityId,
OnHarvestResponse,
- new System.TimeSpan(0, 0, 30));
+ new System.TimeSpan(0, 0, 5));
}
else
{
diff --git a/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/EditorResourcePreparer.cs b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/EditorResourcePreparer.cs
new file mode 100644
index 0000000..cae58ec
--- /dev/null
+++ b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/EditorResourcePreparer.cs
@@ -0,0 +1,56 @@
+// Copyright (c) Improbable Worlds Ltd, All Rights Reserved
+
+using Improbable.MinimalBuildSystem.Prefabs;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+using UnityEditor;
+using UnityEditor.SceneManagement;
+
+namespace Improbable.Unity.MinimalBuildSystem
+{
+ public static class EditorResourcePreparer
+ {
+ [InitializeOnLoadMethod]
+ static void SetupPlaymodeCallbacks()
+ {
+ EditorApplication.playModeStateChanged += PrepareEntityPrefabs;
+ EditorSceneManager.sceneOpened += SafetyCheckForPlatform;
+ }
+
+ private static void SafetyCheckForPlatform(Scene scene, OpenSceneMode mode)
+ {
+ // As the platform is not set by default, show a warning to the user when they still need to change this
+ var provider = Object.FindObjectOfType();
+ if (provider != null)
+ {
+ var workerPlatform = provider.platform;
+ if (workerPlatform == 0)
+ {
+ Debug.LogWarning("The BasicTemplateProvider instance has an invalid WorkerPlatform set.", provider);
+ }
+ }
+ }
+
+ private static void PrepareEntityPrefabs(PlayModeStateChange state)
+ {
+ // Only do this when we go from edit mode to play mode
+ if (state != PlayModeStateChange.ExitingEditMode)
+ {
+ return;
+ }
+
+ // Only export if the scene uses a BasicTemplateProvider
+ var provider = Object.FindObjectOfType();
+ if (provider != null)
+ {
+
+ // Get worker platform
+ var workerPlatform = provider.platform;
+ Debug.LogFormat("Preparing EntityPrefabs for {0}", workerPlatform.ToString());
+
+ // Start prefab export
+ EntityPrefabs.Export(workerPlatform);
+ }
+ }
+ }
+}
diff --git a/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/EditorResourcePreparer.cs.meta b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/EditorResourcePreparer.cs.meta
new file mode 100644
index 0000000..1bf9f62
--- /dev/null
+++ b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/EditorResourcePreparer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c1cf47f5910a08347b88457f195fd438
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/WorkerBuilder.cs b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/WorkerBuilder.cs
index 366651b..de990dc 100644
--- a/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/WorkerBuilder.cs
+++ b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Editor/WorkerBuilder.cs
@@ -206,7 +206,25 @@ private static void BuildWorkerForTarget(WorkerPlatform workerPlatform, BuildTar
locationPathName = workerBuildData.BuildScratchDirectory
};
- BuildPipeline.BuildPlayer(buildPlayerOptions);
+ var buildConfigString = string.Format("WorkerPlatform={0};BuildTarget={1};BuildOptions={2}", workerPlatform,
+ buildTarget, buildOptions);
+
+ var buildErrorMessage = BuildPipeline.BuildPlayer(buildPlayerOptions);
+
+#if UNITY_2018_1_OR_NEWER
+ if (buildErrorMessage.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
+ {
+ throw new ApplicationException(string.Format("Failed to build player {0} due to {1} errors", buildConfigString,
+ buildErrorMessage.summary.totalErrors));
+ }
+#else
+ if (!string.IsNullOrEmpty(buildErrorMessage))
+ {
+ throw new ApplicationException(string.Format("Failed to build player {0} due to {1}", buildConfigString,
+ buildErrorMessage));
+ }
+#endif
+ Debug.LogFormat("Built player {0} into {1}", buildConfigString, workerBuildData.BuildScratchDirectory);
var zipPath = Path.GetFullPath(Path.Combine(PlayerBuildDirectory, workerBuildData.PackageName));
diff --git a/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Runtime/BasicTemplateProvider.cs b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Runtime/BasicTemplateProvider.cs
index b588359..55d25fb 100644
--- a/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Runtime/BasicTemplateProvider.cs
+++ b/workers/unity/Assets/Plugins/Improbable/.Modules/MinimalBuildSystem/Runtime/BasicTemplateProvider.cs
@@ -2,9 +2,8 @@
using System;
using Improbable.Assets;
+using Improbable.Unity;
using Improbable.Unity.Assets;
-using Improbable.Unity.Configuration;
-using Improbable.Unity.Core;
using Improbable.Unity.Entity;
using UnityEngine;
@@ -12,8 +11,7 @@ namespace Improbable.MinimalBuildSystem.Prefabs
{
public class BasicTemplateProvider : MonoBehaviour, IEntityTemplateProvider
{
- // These can be overridden on the command line.
- public bool UseLocalPrefabs = true;
+ public WorkerPlatform platform;
// The template provider can't be instantiated during construction as Application.isEditor doesn't work.
private IEntityTemplateProvider templateProvider;
@@ -34,26 +32,11 @@ private IEntityTemplateProvider TemplateProvider
private IAssetLoader InitializeAssetLoader()
{
-#if UNITY_EDITOR
- UseLocalPrefabs =
- SpatialOS.Configuration.GetCommandLineValue(CommandLineConfigNames.UseLocalPrefabs, UseLocalPrefabs);
- if (UseLocalPrefabs)
- {
- return new PrefabGameObjectLoader();
- }
-#endif
return new ResourceGameObjectLoader();
}
private IEntityTemplateProvider InitializeTemplateProvider(IAssetLoader gameObjectLoader)
{
-#if UNITY_EDITOR
- if (UseLocalPrefabs)
- {
- return new AssetDatabaseTemplateProvider(
- new CachingAssetDatabase(new PreprocessingGameObjectLoader(gameObjectLoader)));
- }
-#endif
return new AssetDatabaseTemplateProvider(new CachingAssetDatabase(gameObjectLoader));
}
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/Linux/Plugins/x86_64/libCoreSdkDll.so b/workers/unity/Assets/Plugins/Improbable/Core/Linux/Plugins/x86_64/libCoreSdkDll.so
old mode 100644
new mode 100755
index 2ecd388..de5128c
Binary files a/workers/unity/Assets/Plugins/Improbable/Core/Linux/Plugins/x86_64/libCoreSdkDll.so and b/workers/unity/Assets/Plugins/Improbable/Core/Linux/Plugins/x86_64/libCoreSdkDll.so differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/Info.plist b/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/Info.plist
old mode 100644
new mode 100755
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/Info.plist.meta b/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/Info.plist.meta
deleted file mode 100644
index 03965f1..0000000
--- a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/Info.plist.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: 454722f13a3fe744bad00223df741884
-timeCreated: 1526304032
-licenseType: Pro
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS/CoreSdkDll b/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS/CoreSdkDll
old mode 100644
new mode 100755
index 83c4350..39c05fa
Binary files a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS/CoreSdkDll and b/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS/CoreSdkDll differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS/CoreSdkDll.meta b/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS/CoreSdkDll.meta
deleted file mode 100644
index 713a03b..0000000
--- a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS/CoreSdkDll.meta
+++ /dev/null
@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: fe6b280e738d85444a077d7388eff0b4
-timeCreated: 1526304033
-licenseType: Pro
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.dll b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.dll
index 4d3e379..f270614 100644
Binary files a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.dll and b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.dll differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.lib b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.lib
index 6cb6580..4a43640 100644
Binary files a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.lib and b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86/CoreSdkDll.lib differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.dll b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.dll
index 25cead0..ce57ae4 100644
Binary files a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.dll and b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.dll differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.lib b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.lib
index 896d6f4..f0850f3 100644
Binary files a/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.lib and b/workers/unity/Assets/Plugins/Improbable/Core/Windows/Plugins/x86_64/CoreSdkDll.lib differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll
index 6dc447e..2552894 100644
Binary files a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll and b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll.meta b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll.meta
index 7a5af20..3dbc868 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll.meta
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.dll.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: f44fb4b626fe048998e488cfd2923afe
+guid: 9881c021029a04a8e80b2e673cf3f89a
PluginImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml
index 649a636..fcd1f42 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml
@@ -5,433 +5,433 @@
-
- Object for sending asynchronous responses to command requests.
- Upon receiving an incoming command request, a user-defined callback containing a user-submitted strategy for responding to the request is invoked.
-
-
+
+ Object for sending asynchronous responses to command requests.
+ Upon receiving an incoming command request, a user-defined callback containing a user-submitted strategy for responding to the request is invoked.
+
+
-
- Type definition: user defined callback function returning a command response given a command request.
-
-
+
+ Type definition: user defined callback function returning a command response given a command request.
+
+
-
- Constructor method that sets the callback field.
-
-
+
+ Constructor method that sets the callback field.
+
+
-
- Respond to an incoming command request asynchronously by invoking the user-defined callback.
- The logic defined in the callback needs to eventually lead to an invokation of responseHandle.Respond().
-
-
+
+ Respond to an incoming command request asynchronously by invoking the user-defined callback.
+ The logic defined in the callback needs to eventually lead to an invokation of responseHandle.Respond().
+
+
-
- Interface abstracting evidence class for a command on a component.
-
- Command metaclass
- Payload of the Command
- Return type of the Command
-
+
+ Interface abstracting evidence class for a command on a component.
+
+ Command metaclass
+ Payload of the Command
+ Return type of the Command
+
-
- Creates an ICommandRequest object appropriate for the command's request type.
-
-
+
+ Creates an ICommandRequest object appropriate for the command's request type.
+
+
-
- Creates an ICommandResponse object appropriate for the command's response type.
-
-
+
+ Creates an ICommandResponse object appropriate for the command's response type.
+
+
-
- Extracts the command response from ICommandResponse object.
-
-
+
+ Extracts the command response from ICommandResponse object.
+
+
-
- Extracts the command response from ICommandResponse object.
-
-
+
+ Extracts the command response from ICommandResponse object.
+
+
-
- Internal name of the command to be invoked.
-
-
+
+ Internal name of the command to be invoked.
+
+
-
- Evidence class for a command on a component.
-
-
- Payload of the Command
- Return type of the Command
-
+
+ Evidence class for a command on a component.
+
+
+ Payload of the Command
+ Return type of the Command
+
-
- ComponentId of the component the command should be invoked on.
-
-
+
+ ComponentId of the component the command should be invoked on.
+
+
-
- Internal name of the command to be invoked.
-
-
+
+ Internal name of the command to be invoked.
+
+
-
- Creates an ICommandRequest object appropriate for the command's request type.
-
-
+
+ Creates an ICommandRequest object appropriate for the command's request type.
+
+
-
- Creates an ICommandResponse object appropriate for the command's response type.
-
-
+
+ Creates an ICommandResponse object appropriate for the command's response type.
+
+
-
- Extracts the command request from ICommandResponse object.
-
-
+
+ Extracts the command request from ICommandResponse object.
+
+
-
- Extracts the command response from ICommandResponse object.
-
-
+
+ Extracts the command response from ICommandResponse object.
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
- Marks an interface as the Reader Interface for use by visualizers.
-
-
+
+ Marks an interface as the Reader Interface for use by visualizers.
+
+
-
- Marks an interface as the Writer Interface for use by visualizers.
-
-
+
+ Marks an interface as the Writer Interface for use by visualizers.
+
+
-
- Associates a unique component Id with a specific interface.
-
-
+
+ Associates a unique component Id with a specific interface.
+
+
-
- The unique identifier.
-
-
+
+ The unique identifier.
+
+
-
- Creates an instance of the attribute.
-
-
+
+ Creates an instance of the attribute.
+
+
-
- Metadata for the incoming command request.
-
-
+
+ Metadata for the incoming command request.
+
+
-
- Creates an instance of CommandRequestMetadata.
-
-
+
+ Creates an instance of CommandRequestMetadata.
+
+
-
-
+
+
-
-
+
+
-
- Contains callbacks that are invoked in response to events registered by calling
- IComponentFactory.RegisterWithConnection().
-
-
+
+ Contains callbacks that are invoked in response to events registered by calling
+ IComponentFactory.RegisterWithConnection().
+
+
-
- Contains an object with no callbacks specified.
-
-
+
+ Contains an object with no callbacks specified.
+
+
-
- Invoked after a component has been added.
-
-
- Provides the EntityId the component belongs to, the metaclass of the component,
- and the concrete implementation of the component.
-
-
+
+ Invoked after a component has been added.
+
+
+ Provides the EntityId the component belongs to, the metaclass of the component,
+ and the concrete implementation of the component.
+
+
-
- Invoked after a component has been removed.
-
-
- Provides the EntityId the component belongs to, the metaclass of the component,
- and the concrete implementation of the component.
-
-
+
+ Invoked after a component has been removed.
+
+
+ Provides the EntityId the component belongs to, the metaclass of the component,
+ and the concrete implementation of the component.
+
+
-
- Invoked after authority over the component has been granted or revoked.
-
-
- Provides the EntityId the component belongs to, the metaclass of the component,
- whether or authority is granted (true) or revoked (false), and the concrete
- implementation of the component.
-
-
+
+ Invoked after authority over the component has been granted or revoked.
+
+
+ Provides the EntityId the component belongs to, the metaclass of the component,
+ whether or authority is granted (true) or revoked (false), and the concrete
+ implementation of the component.
+
+
-
- Invoked after the component has been updated.
-
-
- Provides the EntityId the component belongs to, the meta class of the component,
- and the concrete implementation of the component.
-
-
+
+ Invoked after the component has been updated.
+
+
+ Provides the EntityId the component belongs to, the meta class of the component,
+ and the concrete implementation of the component.
+
+
-
- Handles callbacks for events.
-
-
-
+
+ Handles callbacks for events.
+
+
+
-
-
+
+
-
-
+
+
-
- Invokes callbacks with every member of a given object list.
-
-
-
+
+ Invokes callbacks with every member of a given object list.
+
+
+
-
- Invokes callbacks with a given data item.
-
-
-
+
+ Invokes callbacks with a given data item.
+
+
+
-
- Object holding an ICommandResponder.
- Exposed to the user by calling [component name].Writer.On[command name].
- Defines the user facing interface for registering/deregistering synchronous/asynchronous command response strategies.
-
-
+
+ Object holding an ICommandResponder.
+ Exposed to the user by calling [component name].Writer.On[command name].
+ Defines the user facing interface for registering/deregistering synchronous/asynchronous command response strategies.
+
+
-
- Register a user-defined synchronous callback for responding to an incoming command request.
- A CommandResponderWrapper can only have one ICommandResponder registered at the same time.
-
-
- If a response is already registered.
-
-
+
+ Register a user-defined synchronous callback for responding to an incoming command request.
+ A CommandResponderWrapper can only have one ICommandResponder registered at the same time.
+
+
+ If a response is already registered.
+
+
-
- Register a user-defined asynchronous callback for responding to an incoming command request.
- A CommandResponderWrapper can only have one ICommandResponder registered at the same time.
-
-
- If a response is already registered.
-
-
+
+ Register a user-defined asynchronous callback for responding to an incoming command request.
+ A CommandResponderWrapper can only have one ICommandResponder registered at the same time.
+
+
+ If a response is already registered.
+
+
-
- De-register a user-defined callback for responding to an incoming command request.
-
-
+
+ De-register a user-defined callback for responding to an incoming command request.
+
+
-
- Invokes the commandResponder member fields SendResponse() method upon receiving a command request to send a response.
-
-
+
+ Invokes the commandResponder member fields SendResponse() method upon receiving a command request to send a response.
+
+
-
- Interface type for objects that respond to incoming command requests given a user-defined callback.
-
-
+
+ Interface type for objects that respond to incoming command requests given a user-defined callback.
+
+
-
- Send a response to an incoming command request given a ResponseHandle corresponding to said request.
-
-
+
+ Send a response to an incoming command request given a ResponseHandle corresponding to said request.
+
+
-
- Handles callbacks for events.
-
-
-
+
+ Handles callbacks for events.
+
+
+
-
- Registers an event callback.
-
-
+
+ Registers an event callback.
+
+
-
- Removes a registered event callback.
-
-
+
+ Removes a registered event callback.
+
+
-
- Handles user-registered callbacks.
-
-
-
+
+ Handles user-registered callbacks.
+
+
+
-
- Creates an instance of UserCallbackHandler.
-
-
-
+
+ Creates an instance of UserCallbackHandler.
+
+
+
-
-
+
+
-
- This class provides a stable, reference-counted memoiser. While the reference count for a particular
- computation is > 0, the returned results of Add and Remove will return the same object as a result.
- As the reference count is explicit, each call to Add must be matched with a call to Remove. Not calling
- Remove will cause the class to not clean up its references. Calling Remove without an Add results in an error.
-
-
+
+ This class provides a stable, reference-counted memoiser. While the reference count for a particular
+ computation is > 0, the returned results of Add and Remove will return the same object as a result.
+ As the reference count is explicit, each call to Add must be matched with a call to Remove. Not calling
+ Remove will cause the class to not clean up its references. Calling Remove without an Add results in an error.
+
+
-
- Metadata for the incoming command request.
-
-
+
+ Metadata for the incoming command request.
+
+
-
- WorkerId of the caller.
-
-
+
+ WorkerId of the caller.
+
+
-
- Attribute set of the caller.
-
-
+
+ Attribute set of the caller.
+
+
-
- An interface that allows for component meta classes to receive events
- on a per-entity basis.
-
-
+
+ An interface that allows for component meta classes to receive events
+ on a per-entity basis.
+
+
-
- Call this once for each associated meta class to receive callbacks.
- These callbacks will be called for the lifetime of the dispatcher object.
-
-
+
+ Call this once for each associated meta class to receive callbacks.
+ These callbacks will be called for the lifetime of the dispatcher object.
+
+
-
- Call this once for each associated meta class when the connection is disposed of.
-
-
+
+ Call this once for each associated meta class when the connection is disposed of.
+
+
-
- Returns an instance of the derived metaclass associated with the entity.
-
-
+
+ Returns an instance of the derived metaclass associated with the entity.
+
+
-
- This method no longer does anything and should not be used.
- Removes all event handlers from the instance associated with entityId.
-
-
+
+ This method no longer does anything and should not be used.
+ Removes all event handlers from the instance associated with entityId.
+
+
-
- An interface for writers, allowing identification of them as an (entity, component) pair.
-
-
+
+ An interface for writers, allowing identification of them as an (entity, component) pair.
+
+
-
- The unique component Id.
-
-
+
+ The unique component Id.
+
+
-
- The entityId associated with the writer instance.
-
-
+
+ The entityId associated with the writer instance.
+
+
-
- Handles property changed callbacks.
-
-
-
+
+ Handles property changed callbacks.
+
+
+
-
- Registers a property callback.
-
-
+
+ Registers a property callback.
+
+
-
- Registers a property callback and invokes it immediately with the current value.
-
-
-
+
+ Registers a property callback and invokes it immediately with the current value.
+
+
+
-
- Removes a registered property callback.
-
-
+
+ Removes a registered property callback.
+
+
-
- Object for sending synchronous responses to command requests.
- Upon receiving an incoming command request, a response is composed with the help of a user-defined callback and sent back to the requester immediately.
-
-
+
+ Object for sending synchronous responses to command requests.
+ Upon receiving an incoming command request, a response is composed with the help of a user-defined callback and sent back to the requester immediately.
+
+
-
- Type definition: user defined callback function returning a command response given a command request.
-
-
+
+ Type definition: user defined callback function returning a command response given a command request.
+
+
-
- Constructor method that sets the callback field.
-
-
+
+ Constructor method that sets the callback field.
+
+
-
- Respond to an incoming command request synchronously by sending back a command response immediately.
-
-
+
+ Respond to an incoming command request synchronously by sending back a command response immediately.
+
+
-
- Object passed to objects handling the command requests.
-
-
+
+ Object passed to objects handling the command requests.
+
+
-
- Payload sent by the entity sending the command.
-
-
+
+ Payload sent by the entity sending the command.
+
+
-
- Metadata for this command invocation instance.
-
-
+
+ Metadata for this command invocation instance.
+
+
-
- Creates a ResponseHandle. Called from generated code.
-
-
+
+ Creates a ResponseHandle. Called from generated code.
+
+
-
- Sends the response to command request.
-
-
-
+
+ Sends the response to command request.
+
+
+
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml.meta b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml.meta
index 087474d..d3d876c 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml.meta
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.Framework.xml.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 3814222838dbb497b92c44beb19b01f1
+guid: 97a3b1fc2bb044bf281e5c0d92411933
TextScriptImporter:
externalObjects: {}
userData:
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll
old mode 100644
new mode 100755
index 04eb516..5bd141e
Binary files a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll and b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll differ
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll.meta b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll.meta
index 04bcedc..8b2148c 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll.meta
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.dll.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 7752f3da0b6ef45b9bdd962b12aaf6ac
+guid: 2e2044bf6884c4e27a75e3562ced4faf
PluginImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml
old mode 100644
new mode 100755
index 8667646..3db9486
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml
@@ -248,6 +248,18 @@
Invokes the global client error hook to handle an exception.
+
+
+ Exception used to represent an error when a component metaclass is unregistered. A helper
+ used to construct an ArgumentException with a predefined error message.
+
+
+
+
+ Exception used to represent an error when a command metaclass is unregistered. A helper
+ used to construct an ArgumentException with a predefined error message.
+
+
Interface representing a particular component. The generated code will contain a metaclass
@@ -498,8 +510,11 @@
Sends an acknowledgement of the receipt of an AuthorityLossImminent authority change for a
component. Sending the acknowledgement signifies that this worker is ready to lose authority
- over the component.
+ over the component for the given entity.
+
+ If a component is unregistered.
+
@@ -513,6 +528,9 @@
modify it later. The legacyCallbackSemantics parameter is deprecated and exists for
legacy compatibility only. It will be removed soon and should not be used.
+
+ If a component is unregistered.
+
@@ -526,6 +544,9 @@
sent; SendCommandRequest(request.DeepCopy()) if you intend to modify the object
later.
+
+ If a component is unregistered.
+
@@ -538,6 +559,9 @@
is sent; SendCommandResponse(response.DeepCopy()) if you intend to modify the
object later.
+
+ If a component is unregistered.
+
@@ -549,6 +573,9 @@
The calling worker will receive a command response with status code
StatusCode.ApplicationError.
+
+ If a component is unregistered.
+
@@ -560,6 +587,16 @@
Note that logs from any previous protocol logging sessions will be overwritten.
+
+
+ A struct to contain constants that can be shared in Improbable.Worker.
+
+
+
+
+ Constant used to alter between static/dynamic linking.
+
+
The request was successfully executed and returned a response.
@@ -876,9 +913,6 @@
This object should not be modified concurrently by multiple threads.
-
-
-
Registers a callback to be invoked when the Connection has disconnected and can no
@@ -948,12 +982,18 @@
Registers a callback to be invoked when a particular component is added to an existing
entity in the worker's view of the sumulation.
+
+ If a component is unregistered.
+
Registers a callback to be invoked when a particular component is removed from an
existing entity in the worker's view of the simulation.
+
+ If a component is unregistered.
+
@@ -961,23 +1001,35 @@
particular component for some entity, or when the worker's authority over that component
is revoked.
+
+ If a component is unregistered.
+
Registers a callback to be invoked when a particular component is updated for an entity.
+
+ If a component is unregistered.
+
Registers a callback to be invoked when a command request is received for a particular
component.
+
+ If a component is unregistered.
+
Registers a callback to be invoked when a command response is received for a particular
component.
+
+ If a component is unregistered.
+
@@ -1012,6 +1064,9 @@
Returns the component ID of a given component.
+
+ If a component is unregistered.
+
@@ -1048,23 +1103,35 @@
Retrieves data for the given component. Returns an empty option if the entity does not have the
given component.
+
+ If a component is unregistered.
+
Creates the given component with initial data. Has no effect if the entity already has
the given component.
+
+ If a component is unregistered.
+
Applies an update to the given component. Has no effect if the entity does not have the
given component.
+
+ If a component is unregistered.
+
Removes a component.
+
+ If a component is unregistered.
+
@@ -1207,6 +1274,47 @@
A future object for the connection.
+
+
+ A client which can be used to connect to a SpatialOS deployment via a locator service.
+ This is the new flow used to connect a local worker to a cloud deployment using a player
+ identity token and login token.
+
+
+ This object should not be used concurrently by multiple threads.
+
+
+
+
+ Creates a client for the locator service.
+
+ The hostname of the locator service. Typically
+ "locator.improbable.io".
+ The parameters for the locator service.
+
+
+
+
+
+
+ Parameters used to authenticate. Usually obtained from a game authentication server.
+
+
+
+
+ Parameters for configuring logging.
+
+
+
+
+ Whether to use an insecure (non-TLS) connection for local development.
+
+
+
+
+ Whether to enable logging for the Locator flow.
+
+
A histogram metric tracks observations of a given value by bucket. This corresponds to a
@@ -1330,6 +1438,16 @@
Connection parameters specific to TCP connections.
+
+
+ Timeout for the connection to SpatialOS to be established.
+
+
+
+
+ Default timeout for worker commands if one is not specified when command is sent.
+
+
Log file names are prefixed with this prefix, are numbered, and have the extension .log.
@@ -1346,6 +1464,21 @@
Once the size of a log file reaches this size, a new log file is created.
+
+
+ Thread affinity mask for all SpatialOS threads related to receiving and processing ops.
+
+
+
+
+ Thread affinity mask for all SpatialOS threads related to sending ops.
+
+
+
+
+ Thread affinity mask for all temporary, short-lived SpatialOS threads.
+
+
Worker type (platform).
@@ -1392,6 +1525,14 @@
Whether to enable protocol logging at startup.
+
+
+ Parameters for configuring thread affinity. Affinity masks are bit masks where
+ having 1 in the nth least significant position means the thread will be permitted to
+ run on the nth core. If an affinity mask is set to zero, the group of threads using
+ that mask will have no thread affinity.
+
+
The token would typically be provided on the command-line by the SpatialOS
@@ -1430,6 +1571,16 @@
Parameters used if the CredentialsType is Steam.
+
+
+ Parameters for configuring logging.
+
+
+
+
+ Whether to enable logging for the Locator flow.
+
+
Base class for entity query constraints.
@@ -1587,6 +1738,9 @@
Helper function that checks if the worker has authority over a particular component of a
particular entity.
+
+ If a component is unregistered.
+
@@ -1603,11 +1757,16 @@
Registers that a call is exited to update the state of the map accordingly.
-
+
+
+ Class providing methods similar to System.Diagnostics.Contract in .NET 4.0.
+
+
+
- Checks that a disposableObject representing an unmanaged handle is not disposed
- (assuming that in such a context it can no longer be used). If the handle has been
- disposed of, this throws an ObjectDisposedException. Otherwise, nothing happens.
+ Throws the exception with the parameter paramName
+ that caused the exception and the exception message passed to the method if
+ is false.
@@ -1642,11 +1801,15 @@
- Returns the component ID associated with a metaclass.
+ Returns the component ID associated with a component metaclass.
+ Returns null if the metaclass is unknown.
+
+
+
+
+ Returns the component ID associated with a command metaclass.
+ Returns null if the metaclass is unknown.
-
- is not a known metaclass.
-
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml.meta b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml.meta
index 14bf5e4..b0f6f57 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml.meta
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Dll/Improbable.WorkerSdkCsharp.xml.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 138032453b3de44b6a1cb0f47d379d98
+guid: 13080b7e93ff3430e8f881f28cdc1bc3
TextScriptImporter:
externalObjects: {}
userData:
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents.meta b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Editor/EditorAddons.meta
similarity index 60%
rename from workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents.meta
rename to workers/unity/Assets/Plugins/Improbable/Sdk/Src/Editor/EditorAddons.meta
index a5181e9..c9027b6 100644
--- a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents.meta
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Editor/EditorAddons.meta
@@ -1,10 +1,9 @@
fileFormatVersion: 2
-guid: 89664e4770bbebb489f2419a3fa9dac7
+guid: 39ec62496ded7374ea8721d0ccaf2165
folderAsset: yes
-timeCreated: 1526304032
+timeCreated: 1515168837
licenseType: Pro
DefaultImporter:
- externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Commands/ComponentCommander.cs b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Commands/ComponentCommander.cs
index 68f5e92..30d5c16 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Commands/ComponentCommander.cs
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Commands/ComponentCommander.cs
@@ -13,7 +13,7 @@ namespace Improbable.Unity.Core
{
class ComponentCommander : IComponentCommander
{
- private const uint DefaultCommandTimeoutMs = 1000;
+ public const uint DefaultCommandTimeoutMs = 1000;
private readonly HashSet commandResponseThunksRegistered;
private readonly Dictionary requestIdToCallback;
@@ -94,7 +94,7 @@ private Option SendGenericCommand(CommandCallback ca
return new Option();
}
- var timeoutMs = timeout.HasValue ? (uint) timeout.Value.Milliseconds : DefaultCommandTimeoutMs;
+ var timeoutMs = timeout.HasValue ? (uint) timeout.Value.TotalMilliseconds : DefaultCommandTimeoutMs;
var requestId = sendRequestWithTimeoutMs(timeoutMs);
requestIdToCallback.Add(requestId, callbackWrapper);
return requestId;
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/CommandLineConfigNames.cs b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/CommandLineConfigNames.cs
index 187fbb6..bc9c92b 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/CommandLineConfigNames.cs
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/CommandLineConfigNames.cs
@@ -17,6 +17,5 @@ public static class CommandLineConfigNames
public const string MaxAssetLoadingRetries = "maxAssetLoadingRetries";
public const string RefreshToken = "refreshToken";
public const string UseLocalPrefabs = "useLocalPrefabs";
- public const string UseExternalIpForBridge = "useExternalIpForBridge";
}
}
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/Defaults.cs b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/Defaults.cs
index 71b535a..d7a0961 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/Defaults.cs
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/Defaults.cs
@@ -34,7 +34,6 @@ public static class Defaults
public const bool ShowDebugTraces = false;
public const byte TcpMultiplexLevel = Worker.Defaults.TcpMultiplexLevel;
- public const bool UseExternalIp = false;
public const bool UseInstrumentation = true;
[Obsolete("As of 12.1, this no longer does anything, and will be removed in a future release.")]
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/WorkerConfiguration.cs b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/WorkerConfiguration.cs
index 0583ed3..1c06533 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/WorkerConfiguration.cs
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Configuration/WorkerConfiguration.cs
@@ -104,7 +104,7 @@ public WorkerPlatform EnginePlatform
public byte TcpMultiplexLevel { get; private set; }
- public bool UseExternalIp { get; private set; }
+ public bool UseExternalIp { get; set; }
public bool UseInstrumentation { get; private set; }
@@ -201,7 +201,7 @@ public WorkerConfiguration(WorkerConfigurationData data, IList commandLi
SendQueueCapacity = data.Networking.SendQueueCapacity;
SteamToken = GetCommandLineValue(EditableConfigNames.SteamToken, data.Networking.SteamToken);
TcpMultiplexLevel = GetCommandLineValue(EditableConfigNames.TcpMultiplexLevel, data.Networking.TcpMultiplexLevel);
- UseExternalIp = GetCommandLineValue(CommandLineConfigNames.UseExternalIpForBridge, Defaults.UseExternalIp) == false; // DEV-1120: The flag is flipped for legacy reasons.
+ UseExternalIp = WorkerPlatform == WorkerPlatform.UnityClient;
UseInstrumentation = GetCommandLineValue(EditableConfigNames.UseInstrumentation, data.Debugging.UseInstrumentation);
UsePrefabPooling = GetCommandLineValue(EditableConfigNames.UsePrefabPooling, data.Unity.UsePrefabPooling);
diff --git a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Core/WorkerConnection.cs b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Core/WorkerConnection.cs
index 6a6765c..ca82c1d 100644
--- a/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Core/WorkerConnection.cs
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Core/WorkerConnection.cs
@@ -16,6 +16,7 @@ namespace Improbable.Unity.Core
public class WorkerConnection
{
private const int ReturnImmediatelyMillis = 0;
+ private static int workerConnectionIndex = 1;
///
/// True if a valid connection exists to SpatialOS.
@@ -175,7 +176,24 @@ private static IEnumerator ConnectToLocatorAsync(WorkerConnectionParameters para
private static IEnumerator ConnectToReceptionistAsync(WorkerConnectionParameters parameters, Action onConnection)
{
- var connectionFuture = Worker.Connection.ConnectAsync(parameters.ReceptionistHost, parameters.ReceptionistPort, parameters.WorkerId, parameters.ConnectionParameters);
+ // Creating a new worker ID per connection attempt.
+ // This is because if the connection fails it will be impossible to reconnect without
+ // restarting the application.
+ string uniqueWorkerId;
+
+ if (WorkerTypeUtils.FromWorkerName(parameters.ConnectionParameters.WorkerType) == WorkerPlatform.UnityWorker)
+ {
+ // for UnityWorker, the worker ID should be unique as it will be incremented in the command line arguments.
+ uniqueWorkerId = parameters.WorkerId;
+ }
+ else
+ {
+ uniqueWorkerId = string.Format("{0}-{1}", parameters.WorkerId, workerConnectionIndex);
+
+ workerConnectionIndex++;
+ }
+
+ var connectionFuture = Worker.Connection.ConnectAsync(parameters.ReceptionistHost, parameters.ReceptionistPort, uniqueWorkerId, parameters.ConnectionParameters);
// ReSharper disable once AccessToDisposedClosure
var wait = new WaitUntil(() => connectionFuture.Get(ReturnImmediatelyMillis).HasValue);
diff --git a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS.meta b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Unity.meta
similarity index 60%
rename from workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS.meta
rename to workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Unity.meta
index 8c075e2..52f1faf 100644
--- a/workers/unity/Assets/Plugins/Improbable/Core/OSX/CoreSdkDll.bundle/Contents/MacOS.meta
+++ b/workers/unity/Assets/Plugins/Improbable/Sdk/Src/Unity/Unity.meta
@@ -1,10 +1,9 @@
fileFormatVersion: 2
-guid: bc7b19d3a038ff04d82845e71fe7bfeb
+guid: 62c2d3638a93f0d48a69124481b9e216
folderAsset: yes
-timeCreated: 1526304033
+timeCreated: 1471954949
licenseType: Pro
DefaultImporter:
- externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
diff --git a/workers/unity/Improbable/bin/CodeGenerator.dll b/workers/unity/Improbable/bin/CodeGenerator.dll
old mode 100644
new mode 100755
diff --git a/workers/unity/Improbable/bin/Improbable.TextTemplating.dll b/workers/unity/Improbable/bin/Improbable.TextTemplating.dll
old mode 100644
new mode 100755
diff --git a/workers/unity/Improbable/bin/Mono.TextTemplating.dll b/workers/unity/Improbable/bin/Mono.TextTemplating.dll
old mode 100644
new mode 100755
diff --git a/workers/unity/Improbable/bin/Newtonsoft.Json.dll b/workers/unity/Improbable/bin/Newtonsoft.Json.dll
old mode 100644
new mode 100755
diff --git a/workers/unity/Improbable/bin/UnityCodeGenerator.exe b/workers/unity/Improbable/bin/UnityCodeGenerator.exe
old mode 100644
new mode 100755
index 32b38be..27b039c
Binary files a/workers/unity/Improbable/bin/UnityCodeGenerator.exe and b/workers/unity/Improbable/bin/UnityCodeGenerator.exe differ
diff --git a/workers/unity/Improbable/bin/macos/unity-csharp-invoker b/workers/unity/Improbable/bin/macos/unity-csharp-invoker
index 0f8c346..c618189 100755
Binary files a/workers/unity/Improbable/bin/macos/unity-csharp-invoker and b/workers/unity/Improbable/bin/macos/unity-csharp-invoker differ
diff --git a/workers/unity/Improbable/bin/macos/unity-invoker b/workers/unity/Improbable/bin/macos/unity-invoker
index 20d28ad..1d5dd91 100755
Binary files a/workers/unity/Improbable/bin/macos/unity-invoker and b/workers/unity/Improbable/bin/macos/unity-invoker differ
diff --git a/workers/unity/Improbable/bin/macos/unity-mono-invoker b/workers/unity/Improbable/bin/macos/unity-mono-invoker
index 80afb71..75e386e 100755
Binary files a/workers/unity/Improbable/bin/macos/unity-mono-invoker and b/workers/unity/Improbable/bin/macos/unity-mono-invoker differ
diff --git a/workers/unity/Improbable/bin/windows/clean.exe b/workers/unity/Improbable/bin/windows/clean.exe
old mode 100644
new mode 100755
diff --git a/workers/unity/Improbable/bin/windows/unity-csharp-invoker.exe b/workers/unity/Improbable/bin/windows/unity-csharp-invoker.exe
old mode 100644
new mode 100755
index c167945..2d89b9b
Binary files a/workers/unity/Improbable/bin/windows/unity-csharp-invoker.exe and b/workers/unity/Improbable/bin/windows/unity-csharp-invoker.exe differ
diff --git a/workers/unity/Improbable/bin/windows/unity-invoker.exe b/workers/unity/Improbable/bin/windows/unity-invoker.exe
old mode 100644
new mode 100755
index 4519b0f..1733fae
Binary files a/workers/unity/Improbable/bin/windows/unity-invoker.exe and b/workers/unity/Improbable/bin/windows/unity-invoker.exe differ
diff --git a/workers/unity/Improbable/bin/windows/unity-mono-invoker.exe b/workers/unity/Improbable/bin/windows/unity-mono-invoker.exe
old mode 100644
new mode 100755
index bbc6a03..504fa7b
Binary files a/workers/unity/Improbable/bin/windows/unity-mono-invoker.exe and b/workers/unity/Improbable/bin/windows/unity-mono-invoker.exe differ
diff --git a/workers/unity/Improbable/bin/windows/unity-zip.exe b/workers/unity/Improbable/bin/windows/unity-zip.exe
old mode 100644
new mode 100755
diff --git a/workers/unity/Improbable/build_script/spatialos.unity.client.build.experimental.json b/workers/unity/Improbable/build_script/spatialos.unity.client.build.experimental.json
index f92542c..dcdc186 100644
--- a/workers/unity/Improbable/build_script/spatialos.unity.client.build.experimental.json
+++ b/workers/unity/Improbable/build_script/spatialos.unity.client.build.experimental.json
@@ -12,7 +12,7 @@
"--output=.spatialos/generated/std",
"--language=csharp",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -25,7 +25,7 @@
"--language=csharp",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -37,7 +37,7 @@
"--output=.spatialos/json/std",
"--language=ast_json",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -50,7 +50,7 @@
"--language=ast_json",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
diff --git a/workers/unity/Improbable/build_script/spatialos.unity.client.build.json b/workers/unity/Improbable/build_script/spatialos.unity.client.build.json
index c1d7c16..1309207 100644
--- a/workers/unity/Improbable/build_script/spatialos.unity.client.build.json
+++ b/workers/unity/Improbable/build_script/spatialos.unity.client.build.json
@@ -12,7 +12,7 @@
"--output=.spatialos/generated/std",
"--language=csharp",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -25,7 +25,7 @@
"--language=csharp",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -37,7 +37,7 @@
"--output=.spatialos/json/std",
"--language=ast_json",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -50,7 +50,7 @@
"--language=ast_json",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
diff --git a/workers/unity/Improbable/build_script/spatialos.unity.worker.build.experimental.json b/workers/unity/Improbable/build_script/spatialos.unity.worker.build.experimental.json
index d48ea30..f0353c6 100644
--- a/workers/unity/Improbable/build_script/spatialos.unity.worker.build.experimental.json
+++ b/workers/unity/Improbable/build_script/spatialos.unity.worker.build.experimental.json
@@ -12,7 +12,7 @@
"--output=.spatialos/generated/std",
"--language=csharp",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -25,7 +25,7 @@
"--language=csharp",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -37,7 +37,7 @@
"--output=.spatialos/json/std",
"--language=ast_json",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -50,7 +50,7 @@
"--language=ast_json",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
diff --git a/workers/unity/Improbable/build_script/spatialos.unity.worker.build.json b/workers/unity/Improbable/build_script/spatialos.unity.worker.build.json
index 2366328..594bfa8 100644
--- a/workers/unity/Improbable/build_script/spatialos.unity.worker.build.json
+++ b/workers/unity/Improbable/build_script/spatialos.unity.worker.build.json
@@ -12,7 +12,7 @@
"--output=.spatialos/generated/std",
"--language=csharp",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -25,7 +25,7 @@
"--language=csharp",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -37,7 +37,7 @@
"--output=.spatialos/json/std",
"--language=ast_json",
"--input=../../build/dependencies/schema/standard_library",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
@@ -50,7 +50,7 @@
"--language=ast_json",
"--input=../../schema",
"--repository=../../build/dependencies/schema",
- "--version=13.0.0"
+ "--version=13.3.0"
]
},
{
diff --git a/workers/unity/spatialos.UnityWorker.worker.json b/workers/unity/spatialos.UnityWorker.worker.json
index 658bc1c..5efe136 100644
--- a/workers/unity/spatialos.UnityWorker.worker.json
+++ b/workers/unity/spatialos.UnityWorker.worker.json
@@ -34,8 +34,6 @@
"${IMPROBABLE_WORKER_NAME}",
"+workerId",
"${IMPROBABLE_WORKER_ID}",
- "+useExternalIpForBridge",
- "true",
"+infraServicesUrl",
"${IMPROBABLE_API_URL}",
"+assemblyName",
@@ -62,8 +60,6 @@
"${IMPROBABLE_WORKER_NAME}",
"+workerId",
"${IMPROBABLE_WORKER_ID}",
- "+useExternalIpForBridge",
- "true",
"+infraServicesUrl",
"${IMPROBABLE_API_URL}",
"+assemblyName",
@@ -90,8 +86,6 @@
"${IMPROBABLE_WORKER_NAME}",
"+workerId",
"${IMPROBABLE_WORKER_ID}",
- "+useExternalIpForBridge",
- "true",
"+infraServicesUrl",
"${IMPROBABLE_API_URL}",
"+assemblyName",
diff --git a/workers/unity/spatialos.unity.client.build.json b/workers/unity/spatialos.unity.client.build.json
deleted file mode 100644
index dbea38d..0000000
--- a/workers/unity/spatialos.unity.client.build.json
+++ /dev/null
@@ -1,147 +0,0 @@
-{
- "tasks": [
- {
- "name": "Codegen",
- "steps": [
- {
- "name": "Dependencies",
- "arguments": [
- "worker_package",
- "unpack"
- ]
- },
- {
- "name": "C# standard library",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_std",
- "--output=.spatialos/generated/std",
- "--language=csharp",
- "--input=../../build/dependencies/schema/standard_library"
- ]
- },
- {
- "name": "C#",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_usr",
- "--output=.spatialos/generated/usr",
- "--language=csharp",
- "--input=../../schema",
- "--repository=../../build/dependencies/schema"
- ]
- },
- {
- "name": "Json AST standard library",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_json_std",
- "--output=.spatialos/json/std",
- "--language=ast_json",
- "--input=../../build/dependencies/schema/standard_library"
- ]
- },
- {
- "name": "Json AST",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_json_usr",
- "--output=.spatialos/json/usr",
- "--language=ast_json",
- "--input=../../schema",
- "--repository=../../build/dependencies/schema"
- ]
- },
- {
- "name": "Unity Code Generation",
- "description": "Generates Unity MonoBehaviours, readers and writers from the project schema.",
- "arguments": [
- "invoke",
- "unity-mono",
- ".spatialos/bin/UnityCodeGenerator.exe",
- "--",
- "--json-dir=.spatialos/json",
- "--unity-component-output-dir=Assets/Plugins/Improbable/Generated/Components",
- "--unity-editor-component-output-dir=Assets/Plugins/Improbable/Editor/Generated/Components",
- "--reader-writer-output-dir=.spatialos/generated/readers_writers"
- ]
- },
- {
- "name": "Compile generated scripts",
- "description": "Compiles the generated code into a single DLL for Unity to consume. Assumes the location of dependencies based on their location in the spatialos_worker_packages.json",
- "arguments": [
- "invoke",
- "unity-csharp-compiler",
- "--unity-reference=UnityEngine.dll",
- "--",
- "-lib:Assets/Plugins/Improbable/Sdk/Dll",
- "-reference:Improbable.WorkerSdkCsharp.dll,Improbable.WorkerSdkCsharp.Framework.dll",
- "-target:library",
- "-debug",
- "-unsafe",
- "-nowarn:1591",
- "-recurse:.spatialos/generated/*.cs",
- "-out:Assets/Plugins/Improbable/Sdk/Dll/Generated.Code.dll",
- "-doc:Assets/Plugins/Improbable/Sdk/Dll/Generated.Code.xml"
- ]
- }
- ]
- },
- {
- "name": "Build",
- "steps": [
- {
- "name": "Codegen",
- "arguments": [
- "invoke-task",
- "Codegen"
- ]
- },
- {
- "name": "UnityClient workers",
- "arguments": [
- "invoke",
- "unity",
- "Improbable.Unity.EditorTools.Build.SimpleBuildSystem.Build",
- "+buildWorkerTypes",
- "UnityClient"
- ]
- }
- ]
- },
- {
- "name": "Clean",
- "steps": [
- {
- "name": "All Unity clients and prefabs",
- "arguments": [
- "invoke",
- "unity",
- "Improbable.Unity.EditorTools.Build.SimpleBuildSystem.Clean",
- "--allow_fail"
- ]
- },
- {
- "name": "Dependencies",
- "arguments": [
- "worker_package",
- "clean"
- ]
- },
- {
- "name": "Generated C# code",
- "arguments": [
- "process_schema",
- "clean",
- ".spatialos",
- "Assets/Plugins/Improbable/Sdk/Dll/Generated.Code.dll"
- ]
- }
- ]
- }
- ]
-}
diff --git a/workers/unity/spatialos.unity.worker.build.json b/workers/unity/spatialos.unity.worker.build.json
deleted file mode 100644
index 01fbfcc..0000000
--- a/workers/unity/spatialos.unity.worker.build.json
+++ /dev/null
@@ -1,147 +0,0 @@
-{
- "tasks": [
- {
- "name": "Codegen",
- "steps": [
- {
- "name": "Dependencies",
- "arguments": [
- "worker_package",
- "unpack"
- ]
- },
- {
- "name": "C# standard library",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_std",
- "--output=.spatialos/generated/std",
- "--language=csharp",
- "--input=../../build/dependencies/schema/standard_library"
- ]
- },
- {
- "name": "C#",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_usr",
- "--output=.spatialos/generated/usr",
- "--language=csharp",
- "--input=../../schema",
- "--repository=../../build/dependencies/schema"
- ]
- },
- {
- "name": "Json AST standard library",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_json_std",
- "--output=.spatialos/json/std",
- "--language=ast_json",
- "--input=../../build/dependencies/schema/standard_library"
- ]
- },
- {
- "name": "Json AST",
- "arguments": [
- "process_schema",
- "generate",
- "--cachePath=.spatialos/schema_codegen_cache_json_usr",
- "--output=.spatialos/json/usr",
- "--language=ast_json",
- "--input=../../schema",
- "--repository=../../build/dependencies/schema"
- ]
- },
- {
- "name": "Unity Code Generation",
- "description": "Generates Unity MonoBehaviours, readers and writers from the project schema.",
- "arguments": [
- "invoke",
- "unity-mono",
- ".spatialos/bin/UnityCodeGenerator.exe",
- "--",
- "--json-dir=.spatialos/json",
- "--unity-component-output-dir=Assets/Plugins/Improbable/Generated/Components",
- "--unity-editor-component-output-dir=Assets/Plugins/Improbable/Editor/Generated/Components",
- "--reader-writer-output-dir=.spatialos/generated/readers_writers"
- ]
- },
- {
- "name": "Compile generated scripts",
- "description": "Compiles the generated code into a single DLL for Unity to consume. Assumes the location of dependencies based on their location in the spatialos_worker_packages.json",
- "arguments": [
- "invoke",
- "unity-csharp-compiler",
- "--unity-reference=UnityEngine.dll",
- "--",
- "-lib:Assets/Plugins/Improbable/Sdk/Dll",
- "-reference:Improbable.WorkerSdkCsharp.dll,Improbable.WorkerSdkCsharp.Framework.dll",
- "-target:library",
- "-debug",
- "-unsafe",
- "-nowarn:1591",
- "-recurse:.spatialos/generated/*.cs",
- "-out:Assets/Plugins/Improbable/Sdk/Dll/Generated.Code.dll",
- "-doc:Assets/Plugins/Improbable/Sdk/Dll/Generated.Code.xml"
- ]
- }
- ]
- },
- {
- "name": "Build",
- "steps": [
- {
- "name": "Codegen",
- "arguments": [
- "invoke-task",
- "Codegen"
- ]
- },
- {
- "name": "UnityWorker workers",
- "arguments": [
- "invoke",
- "unity",
- "Improbable.Unity.EditorTools.Build.SimpleBuildSystem.Build",
- "+buildWorkerTypes",
- "UnityWorker"
- ]
- }
- ]
- },
- {
- "name": "Clean",
- "steps": [
- {
- "name": "All Unity workers and prefabs",
- "arguments": [
- "invoke",
- "unity",
- "Improbable.Unity.EditorTools.Build.SimpleBuildSystem.Clean",
- "--allow_fail"
- ]
- },
- {
- "name": "Dependencies",
- "arguments": [
- "worker_package",
- "clean"
- ]
- },
- {
- "name": "Generated C# code",
- "arguments": [
- "process_schema",
- "clean",
- ".spatialos",
- "Assets/Plugins/Improbable/Sdk/Dll/Generated.Code.dll"
- ]
- }
- ]
- }
- ]
-}