Skip to content

Commit 8f50f14

Browse files
update
Don't auto-start the session owner when running codec tests.
1 parent bf33c89 commit 8f50f14

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,14 @@ private IEnumerator StartSessionOwner()
10571057
VerboseDebug("Session owner connected and approved.");
10581058
}
10591059

1060+
/// <summary>
1061+
/// Determines whether the session owner will be auto-started prior to any other client
1062+
/// </summary>
1063+
internal virtual bool ShouldAutoStartSessionOwner()
1064+
{
1065+
return true;
1066+
}
1067+
10601068
/// <summary>
10611069
/// This starts the server and clients as long as <see cref="CanStartServerAndClients"/>
10621070
/// returns true.
@@ -1067,7 +1075,7 @@ protected IEnumerator StartServerAndClients()
10671075
{
10681076
VerboseDebug($"Entering {nameof(StartServerAndClients)}");
10691077

1070-
if (m_UseCmbService)
1078+
if (m_UseCmbService && ShouldAutoStartSessionOwner())
10711079
{
10721080
VerboseDebug("Using a distributed authority CMB Server for connection.");
10731081
yield return StartSessionOwner();

com.unity.netcode.gameobjects/Tests/Runtime/DistributedAuthority/DistributedAuthorityCodecTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ public void TestAuthorityRpc(byte[] _)
6868
}
6969
}
7070

71+
/// <summary>
72+
/// Don't auto start the session owner for codec tests
73+
/// </summary>
74+
internal override bool ShouldAutoStartSessionOwner()
75+
{
76+
return false;
77+
}
78+
7179
protected override void OnOneTimeSetup()
7280
{
7381
// Prevents the tests from running if no CMB Service is detected

0 commit comments

Comments
 (0)