Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Brynes committed Aug 14, 2019
1 parent 9477a5f commit e246c54
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions UPGRADE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,80 @@
# Upgrade Guide

## From `0.2.6` to `0.2.7`

### Worker SDK `14.0.0` upgrade

There are a number of breaking changes to contend with for the Worker SDK upgrade:

#### Removal of `Vector3f` and `Vector3d`

These two schema types are no longer available in the schema standard library. You can replace their definitions by defining a schema file in your project:

```
package my_game;
type Vector3f {
float x = 1;
float y = 2;
float z = 3;
}
type Vector3d {
double x = 1;
double y = 2;
double z = 3;
}
```

And replacing the import of `improbable/vector.schema` and usage of `improbable.Vector3f`/`improbable.Vector3d` with the schema file you defined.

> Note that methods such as `Vector3f.ToUnityVector();` are no longer available and you'll need to reimplement them yourself as extension/static methods. You can find the old implementations here: [`Vector3f`](https://github.com/spatialos/gdk-for-unity/blob/0.2.6/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Partials/Improbable.Vector3f) and [`Vector3d`](https://github.com/spatialos/gdk-for-unity/blob/0.2.6/workers/unity/Packages/io.improbable.gdk.tools/.CodeGenerator/GdkCodeGenerator/Partials/Improbable.Vector3d).
>
> You will be unable to reimplement the operators since C# lacks the ability to define operations via extension methods.
>
> Note that the `Coordinates` type can be used as a replacement for `Vector3d` as they are structurally the same.
#### Connection flow changes

The `AlphaLocatorFlow` and the `LocatorFlow` have been merged. This means that your worker connectors may require some changes. Wherever you were previously using the `AlphaLocatorFlow` or the `ConnectionService.AlphaLocator` enum value, you should now be using the `LocatorFlow` and the `ConnectionService.Locator` enum value.

For example:

```csharp
var initializer = new CommandLineConnectionFlowInitializer();
switch (initializer.GetConnectionService())
{
case ConnectionService.Receptionist:
builder.SetConnectionFlow(new ReceptionistFlow(CreateNewWorkerId(WorkerUtils.UnityClient), initializer));
break;
case ConnectionService.Locator:
builder.SetConnectionFlow(new LocatorFlow(initializer));
break;
case ConnectionService.AlphaLocator:
builder.SetConnectionFlow(new AlphaLocatorFlow(initializer));
break;
default:
throw new ArgumentOutOfRangeException();
}
```

Would change into:

```csharp
var initializer = new CommandLineConnectionFlowInitializer();
switch (initializer.GetConnectionService())
{
case ConnectionService.Receptionist:
builder.SetConnectionFlow(new ReceptionistFlow(CreateNewWorkerId(WorkerUtils.UnityClient), initializer));
break;
case ConnectionService.Locator:
builder.SetConnectionFlow(new LocatorFlow(initializer));
break;
default:
throw new ArgumentOutOfRangeException();
}
```

## From `0.2.5` to `0.2.6`

### General changes
Expand Down

0 comments on commit e246c54

Please sign in to comment.