Skip to content
This repository was archived by the owner on Dec 5, 2018. It is now read-only.

Commit f6b783e

Browse files
johnprobableMorrison Cole
authored andcommitted
Upgrade to 10.0.0
1 parent 96f0f87 commit f6b783e

20 files changed

+436
-122
lines changed

default_launch.json

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,39 @@
88
"dimensions": {
99
"xMeters": 8000,
1010
"zMeters": 8000
11-
},
12-
"legacyFlags": [
13-
{
14-
"name": "load_snapshot_at_startup",
15-
"value": "true"
16-
},
17-
{
18-
"name": "snapshot_storage_type",
19-
"value": "file"
20-
},
21-
{
22-
"name": "snapshot_source_file",
23-
"value": "snapshots/initial_world.snapshot"
24-
}
25-
]
11+
}
2612
},
2713
"workers": [
28-
{
29-
"worker_type": "UnityFSim",
30-
"load_balancing": {
31-
"static_hex_grid": {
32-
"worker_radius_meters": 5000.0,
33-
"grid_width": 1,
34-
"grid_height": 1
14+
{
15+
"worker_type": "UnityWorker",
16+
"load_balancing": {
17+
"dynamic_loadbalancer": {
18+
"worker_scaler_config": {
19+
"constant_config": {
20+
"num_workers": 4
21+
}
22+
},
23+
"worker_placer_config": {
24+
"random_params": {}
25+
},
26+
"loadbalancer_config": {
27+
"min_range_meters": 500.0,
28+
"max_range_meters": 5000.0,
29+
"speed_meters_per_second": 100.0,
30+
"expansion_time_millis": 60000
31+
}
32+
}
33+
},
34+
"permissions": [{
35+
"all": {}
36+
}]
37+
},
38+
{
39+
"worker_type": "UnityClient",
40+
"permissions": [{
41+
"all": {}
3542
}
36-
}
43+
]
3744
}
3845
]
39-
}
46+
}

deploy.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

spatialos.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "your_project_name_here",
3-
"project_version": "0.0.2",
4-
"sdk_version": "9.1.0",
3+
"project_version": "0.0.3",
4+
"sdk_version": "10.0.0",
55
"dependencies": [
6-
{"name": "WorkerSdkSchema", "version": "9.1.0"}
6+
{"name": "WorkerSdkSchema", "version": "10.0.0"}
77
]
88
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"tasks": [
3+
{
4+
"name": "Codegen",
5+
"steps": [
6+
{
7+
"name": "Scala",
8+
"arguments": [
9+
"process_schema",
10+
"generate",
11+
"--input=../../schema/",
12+
"--repository=../../build/dependencies/schema/",
13+
"--output=generated",
14+
"--language=scala"
15+
]
16+
}
17+
]
18+
},
19+
{
20+
"name": "Build",
21+
"steps": [
22+
{
23+
"name": "Codegen",
24+
"arguments": [
25+
"invoke-task",
26+
"Codegen"
27+
]
28+
},
29+
{
30+
"name": "scala",
31+
"arguments": [
32+
"invoke",
33+
"sbt",
34+
"workerPackage"
35+
]
36+
}
37+
]
38+
},
39+
{
40+
"name": "Clean",
41+
"steps": [
42+
{
43+
"name": "Scala",
44+
"arguments": [
45+
"invoke",
46+
"sbt",
47+
"clean"
48+
]
49+
},
50+
{
51+
"name": "Generated code",
52+
"arguments": [
53+
"process_schema",
54+
"clean",
55+
"generated"
56+
]
57+
}
58+
]
59+
}
60+
]
61+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"build": {
3-
"tasks_filename": "build.json",
3+
"tasks_filename": "spatialos.gsim.build.json",
44
"generated_build_scripts_type": "gsim"
55
}
66
}

workers/unity/Assets/Bootstrap.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public void Start()
1212
{
1313
SpatialOS.ApplyConfiguration(Configuration);
1414

15-
switch (SpatialOS.Configuration.EnginePlatform)
15+
switch (SpatialOS.Configuration.WorkerPlatform)
1616
{
17-
case EnginePlatform.FSim:
17+
case WorkerPlatform.UnityWorker:
1818
SpatialOS.OnDisconnected += reason => Application.Quit();
1919

2020
var targetFramerate = 120;
@@ -23,7 +23,7 @@ public void Start()
2323
Application.targetFrameRate = targetFramerate;
2424
Time.fixedDeltaTime = 1.0f / fixedFramerate;
2525
break;
26-
case EnginePlatform.Client:
26+
case WorkerPlatform.UnityClient:
2727
SpatialOS.OnConnected += OnConnected;
2828
break;
2929
}

workers/unity/Assets/Editor/SnapshotMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class SnapshotMenu : MonoBehaviour
1717
private static void GenerateSnapshotProgrammatically()
1818
{
1919
var snapshotEntities = new Dictionary<EntityId, SnapshotEntity>();
20-
var currentEntityId = 0;
20+
var currentEntityId = 1;
2121

2222
snapshotEntities.Add(new EntityId(currentEntityId++), ExampleEntityTemplate.GenerateExampleSnapshotEntityTemplate());
2323

workers/unity/Assets/EntityPrefabs/ExampleEntity.prefab.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workers/unity/Assets/EntityTemplates/ExampleEntityTemplate.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public static SnapshotEntity GenerateExampleSnapshotEntityTemplate()
2121

2222
var acl = Acl.Build()
2323
// Both FSim (server) workers and client workers granted read access over all states
24-
.SetReadAccess(CommonPredicates.PhysicsOrVisual)
24+
.SetReadAccess(CommonRequirementSets.PhysicsOrVisual)
2525
// Only FSim workers granted write access over WorldTransform component
26-
.SetWriteAccess<WorldTransform>(CommonPredicates.PhysicsOnly)
26+
.SetWriteAccess<WorldTransform>(CommonRequirementSets.PhysicsOnly)
2727
// Only client workers granted write access over Name component
28-
.SetWriteAccess<Name>(CommonPredicates.VisualOnly);
28+
.SetWriteAccess<Name>(CommonRequirementSets.VisualOnly);
2929

3030
exampleEntity.SetAcl(acl);
3131

-132 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)