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

Commit 1bc9acc

Browse files
zeroZshadowPaul Balaji
authored andcommitted
Change default network type to ModularUDP with Compression (#1212)
1 parent b386cda commit 1bc9acc

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Generated Worker ID's for local development are now smaller and easier to read for debugging. [#1197](https://github.com/spatialos/gdk-for-unity/pull/1197)
1919
- Upgraded to Worker SDK 14.2.1. [#1208](https://github.com/spatialos/gdk-for-unity/pull/1208)
2020
- Versioning scheme for the SDK and Mobile SDK packages have now changed to align with the GDK for Unity version.
21+
- Changed the default network type to ModularUDP with packet compression. [#1212](https://github.com/spatialos/gdk-for-unity/pull/1212)
2122

2223
### Fixed
2324

workers/unity/Assets/Playground/Scripts/Worker/ClientWorkerConnector.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using Improbable.Gdk.Core;
3-
using Improbable.Worker.CInterop;
43
using UnityEngine;
54

65
namespace Playground
@@ -20,7 +19,6 @@ private async void Start()
2019

2120
var connParams = CreateConnectionParameters(WorkerUtils.UnityClient);
2221
connParams.Network.UseExternalIp = UseExternalIp;
23-
connParams.Network.ConnectionType = NetworkConnectionType.RakNet;
2422

2523
var builder = new SpatialOSConnectionHandlerBuilder()
2624
.SetConnectionParameters(connParams);

workers/unity/Assets/Playground/Scripts/Worker/MobileClientWorkerConnector.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using Improbable.Gdk.Core;
33
using Improbable.Gdk.Mobile;
4-
using Improbable.Worker.CInterop;
54
using UnityEngine;
65

76
namespace Playground

workers/unity/Packages/io.improbable.gdk.core/Worker/WorkerConnector.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Threading;
77
using System.Threading.Tasks;
88
using Improbable.Worker.CInterop;
9+
using Improbable.Worker.CInterop.Alpha;
910
using Unity.Entities;
1011
using UnityEditor;
1112
using UnityEngine;
@@ -211,7 +212,16 @@ protected ConnectionParameters CreateConnectionParameters(string workerType, ICo
211212
var @params = new ConnectionParameters
212213
{
213214
WorkerType = workerType,
214-
DefaultComponentVtable = new ComponentVtable()
215+
DefaultComponentVtable = new ComponentVtable(),
216+
Network =
217+
{
218+
ConnectionType = NetworkConnectionType.ModularUdp,
219+
ModularUdp =
220+
{
221+
DownstreamCompression = new CompressionParameters(),
222+
UpstreamCompression = new CompressionParameters(),
223+
}
224+
}
215225
};
216226

217227
initializer?.Initialize(@params);

0 commit comments

Comments
 (0)