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

Commit c0ecc5c

Browse files
author
gkassabli
authored
Switching to KCP on mobile worker + use small connection timeout (#693)
* Switching to KCP on mobile worker + use small connection timeout * Bump timeout to 10s * Adding KCP-specific parameters
1 parent dcb31fa commit c0ecc5c

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

mobile_launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"template": "small",
2+
"template": "small_entity_db_v2",
33
"world": {
44
"chunkEdgeLengthMeters": 50,
55
"snapshots": {

workers/unity/Packages/com.improbable.gdk.mobile/Worker/MobileWorkerConnector.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Improbable.Gdk.Mobile
99
public abstract class MobileWorkerConnector : WorkerConnector
1010
{
1111
[SerializeField] private string DevelopmentAuthToken;
12-
12+
1313
protected abstract string GetHostIp();
1414

1515
protected override ConnectionParameters GetConnectionParameters(string workerType, ConnectionService service)
@@ -19,8 +19,22 @@ protected override ConnectionParameters GetConnectionParameters(string workerTyp
1919
WorkerType = workerType,
2020
Network =
2121
{
22-
ConnectionType = NetworkConnectionType.Tcp,
22+
ConnectionType = NetworkConnectionType.Kcp,
2323
UseExternalIp = true,
24+
Kcp = new KcpNetworkParameters
25+
{
26+
EarlyRetransmission = true,
27+
NonConcessionalFlowControl = true,
28+
FastRetransmission = true,
29+
UpdateIntervalMillis = 10,
30+
WindowSize = 1000,
31+
MinRtoMillis = 10,
32+
Heartbeat = new HeartbeatParameters()
33+
{
34+
IntervalMillis = 5000,
35+
TimeoutMillis = 10000,
36+
}
37+
}
2438
},
2539
EnableProtocolLoggingAtStartup = false,
2640
DefaultComponentVtable = new ComponentVtable(),
@@ -55,7 +69,7 @@ protected override AlphaLocatorConfig GetAlphaLocatorConfig(string workerType)
5569
{
5670
PlayerIdentity = new PlayerIdentityCredentials
5771
{
58-
PlayerIdentityToken = pit,
72+
PlayerIdentityToken = pit,
5973
LoginToken = loginToken,
6074
},
6175
UseInsecureConnection = false,

0 commit comments

Comments
 (0)