Skip to content

Commit 0223325

Browse files
Merge branch 'develop-2.0.0' into reference/pvp-133-132-130-issues
2 parents d47fe47 + 48a045a commit 0223325

File tree

65 files changed

+1085
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1085
-473
lines changed

.yamato/_triggers.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ pull_request_trigger:
5050
- .yamato/_run-all.yml#run_all_package_tests_trunk
5151
# Run package EditMode and Playmode package tests on minimum supported editor (6000.0 in case of NGOv2.X)
5252
- .yamato/_run-all.yml#run_all_package_tests_6000
53-
# Run project EditMode and PLaymode project tests on trunk
53+
# Run project EditMode and Playmode project tests on trunk
5454
- .yamato/_run-all.yml#run_all_project_tests_trunk
55-
# Run project EditMode and PLaymode project tests on minimum supported editor (6000.0 in case of NGOv2.X)
55+
# Run project EditMode and Playmode project tests on minimum supported editor (6000.0 in case of NGOv2.X)
5656
- .yamato/_run-all.yml#run_all_project_tests_6000
57-
# Run standalone test. We run it only on Ubuntu since it's the fastest machine, and it was noted that for example distribution on macOS is taking 40m since we switched to Apple Silicon
57+
# Run standalone test. Run windows standalone tests as this is our most common platform, and run ubuntu rust tests.
5858
# Coverage on other standalone machines is present in Nightly job so it's enough to not run all of them for PRs
59-
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_ubuntu_il2cpp_6000.0
59+
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_win_il2cpp_6000.0
60+
- .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_6000.0
6061
triggers:
6162
cancel_old_ci: true
6263
pull_requests:
@@ -133,4 +134,4 @@ develop_weekly_trunk:
133134
# Build player for webgl platform on trunk
134135
- .yamato/_run-all.yml#run_all_webgl_builds
135136
# Run code coverage test
136-
- .yamato/code-coverage.yml#code_coverage_ubuntu_trunk
137+
- .yamato/code-coverage.yml#code_coverage_ubuntu_trunk
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file.
2+
---
3+
4+
# DESCRIPTION--------------------------------------------------------------------------
5+
# This job is responsible test validation against the CMB Service.
6+
# This job runs on the default test_platform which is Ubuntu.
7+
# This job runs the standalone desktop tests and ignores all tests that are not related to the CMB Service.
8+
# Those tests cover both PlayMode and EditMode tests from package test assemblies.
9+
# This is only needed in NGOv2.X since NGOv1.X does not use the CMB Service.
10+
11+
# CONFIGURATION STRUCTURE--------------------------------------------------------------
12+
# Jobs are generated using nested loops (separate build phase and run phase). Worth noting that run phase uses the build as dependency:
13+
# 1. For all desktop platform (Windows, macOS, Ubuntu)
14+
# 2. For all supported Unity Editor versions (for NGOv2.X this means 6000.0+ editors)
15+
# 3. For the default project.
16+
# 4. For all scripting backends (mono, il2cpp)
17+
18+
# TECHNICAL CONSIDERATIONS---------------------------------------------------------------
19+
# For desktop devices a split is into two phases is not required but we use it for consistency with setup of others standalone platforms:
20+
# 1. Build Phase: Creates standalone players for desktop platforms
21+
# 2. Run Phase: Executes runtime tests on actual desktop devices
22+
# The Run phase uses build job as dependency
23+
24+
# Note: The build phase for this test is imported from the desktop standalone tests as the CMB Service test is a subset of the desktop standalone tests.
25+
26+
#-----------------------------------------------------------------------------------
27+
28+
29+
# CMB SERVICE RUN PHASE CONFIGURATION------------------------------------------------------------------------------------
30+
{% for project in projects.default -%}
31+
{% for platform in test_platforms.default -%}
32+
{% for editor in validation_editors.all -%}
33+
{% for backend in scripting_backends -%}
34+
cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}:
35+
name : CMB Service Test - NGO {{ project.name }} - [{{ platform.name }}, {{ editor }}, {{ backend }}]
36+
agent:
37+
type: {{ platform.type }}::GPU
38+
image: {{ platform.image }}
39+
flavor: {{ platform.flavor }}
40+
41+
variables:
42+
# The echo server is a "mock" server that is only used to test encoding/decoding of messages.
43+
# It is used by the DistributedAuthorityCodecTests. These are tests that are built and maintained by the CMB service team.
44+
ECHO_SERVER_PORT: "7788"
45+
# Set this to ensure the DistributedAuthorityCodecTests will fail if they cannot connect to the echo server.
46+
# The default is to ignore the codec tests if the echo server fails to connect
47+
ENSURE_CODEC_TESTS: "true"
48+
49+
# When USE_CMB_SERVICE is set to true, any C# tests configured to use the DA host will instead use the CMB service.
50+
USE_CMB_SERVICE: "true"
51+
# This is the port on which to run the full standalone CMB service.
52+
# The port needs to be different from the echo server port as two processes cannot bind to same port.
53+
CMB_SERVICE_PORT: "7799"
54+
55+
commands:
56+
# run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server)
57+
- ./Tools/CI/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT
58+
59+
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models
60+
- UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=1800
61+
artifacts:
62+
logs:
63+
paths:
64+
- "test-results/**/*"
65+
dependencies:
66+
- .yamato/desktop-standalone-tests.yml#desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{ editor }}
67+
{% endfor -%}
68+
{% endfor -%}
69+
{% endfor -%}
70+
{% endfor -%}

.yamato/desktop-standalone-tests.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,30 +77,7 @@ desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
7777
model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile). In this case it's specifically for macOS (if used for win/ubuntu then it will cause rust server to fail connecting)
7878
{% endif %}
7979

80-
# Set additional variables for running the echo server (This is needed ONLY for NGOv2.X because relates to Distributed Authority)
81-
{% if platform.name != "win" %} # Issues with win and mac are tracked in MTT-11606
82-
variables:
83-
# The echo server is a "mock" server that is only used to test encoding/decoding of messages.
84-
# It is used by the DistributedAuthorityCodecTests. These are tests that are built and maintained by the CMB service team.
85-
ECHO_SERVER_PORT: "7788"
86-
# Set this to ensure the DistributedAuthorityCodecTests will fail if they cannot connect to the echo server.
87-
# The default is to ignore the codec tests if the echo server fails to connect
88-
ENSURE_CODEC_TESTS: "true"
89-
90-
# When USE_CMB_SERVICE is set to true, any C# tests configured to use the DA host will instead use the CMB service.
91-
USE_CMB_SERVICE: "true"
92-
# This is the port on which to run the full standalone CMB service.
93-
# The port needs to be different from the echo server port as two processes cannot bind to same port.
94-
CMB_SERVICE_PORT: "7799"
95-
{% endif %}
96-
9780
commands:
98-
# If ubuntu, run rust echo server (This is needed ONLY for NGOv2.X because relates to Distributed Authority)
99-
{% if platform.name != "win" %} # Issues with win and mac are tracked in MTT-11606
100-
# run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server)
101-
- ./Tools/CI/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT
102-
{% endif %}
103-
10481
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %} {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models
10582
- UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --reruncount=1 --clean-library-on-rerun --timeout=1800
10683
artifacts:

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1010

1111
### Added
1212

13+
- When using UnityTransport >=2.4 and Unity >= 6000.1.0a1, SetConnectionData will accept a fully qualified hostname instead of an IP as a connect address on the client side. (#3441)
1314

1415
### Fixed
1516

com.unity.netcode.gameobjects/Runtime/Messaging/Messages/ConnectionApprovedMessage.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,12 @@ public void Handle(ref NetworkContext context)
273273
// Stop the client-side approval timeout coroutine since we are approved.
274274
networkManager.ConnectionManager.StopClientApprovalCoroutine();
275275

276-
networkManager.ConnectionManager.ConnectedClientIds.Clear();
277276
foreach (var clientId in ConnectedClientIds)
278277
{
279-
if (!networkManager.ConnectionManager.ConnectedClientIds.Contains(clientId))
278+
// DANGO-TODO: Revisit the entire connection sequence and determine why we would need to check both cases as we shouldn't have to =or= we could
279+
// try removing this after the Rust server connection sequence stuff is resolved. (Might be only needed if scene management is disabled)
280+
// If there is any disconnect between the connection sequence of Ids vs ConnectedClients, then add the client.
281+
if (!networkManager.ConnectionManager.ConnectedClientIds.Contains(clientId) || !networkManager.ConnectionManager.ConnectedClients.ContainsKey(clientId))
280282
{
281283
networkManager.ConnectionManager.AddClient(clientId);
282284
}

com.unity.netcode.gameobjects/Runtime/SceneManagement/NetworkSceneManager.cs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,30 +2595,26 @@ private void HandleSessionOwnerEvent(uint sceneEventId, ulong clientId)
25952595
case SceneEventType.SynchronizeComplete:
25962596
{
25972597
// At this point the client is considered fully "connected"
2598-
if ((NetworkManager.DistributedAuthorityMode && NetworkManager.LocalClient.IsSessionOwner) || !NetworkManager.DistributedAuthorityMode)
2598+
// Make sure we have a NetworkClient for this synchronized client
2599+
if (!NetworkManager.ConnectedClients.ContainsKey(clientId))
25992600
{
2600-
// Notify the local server that a client has finished synchronizing
2601-
OnSceneEvent?.Invoke(new SceneEvent()
2602-
{
2603-
SceneEventType = sceneEventData.SceneEventType,
2604-
SceneName = string.Empty,
2605-
ClientId = clientId
2606-
});
2607-
if (NetworkManager.ConnectedClients.ContainsKey(clientId))
2608-
{
2609-
NetworkManager.ConnectedClients[clientId].IsConnected = true;
2610-
}
2601+
NetworkManager.ConnectionManager.AddClient(clientId);
26112602
}
2612-
else
2603+
// Mark this client as being connected
2604+
NetworkManager.ConnectedClients[clientId].IsConnected = true;
2605+
2606+
// Notify the local server that a client has finished synchronizing
2607+
OnSceneEvent?.Invoke(new SceneEvent()
26132608
{
2614-
// Notify the local server that a client has finished synchronizing
2615-
OnSceneEvent?.Invoke(new SceneEvent()
2616-
{
2617-
SceneEventType = sceneEventData.SceneEventType,
2618-
SceneName = string.Empty,
2619-
ClientId = clientId
2620-
});
2609+
SceneEventType = sceneEventData.SceneEventType,
2610+
SceneName = string.Empty,
2611+
ClientId = clientId
2612+
});
26212613

2614+
// For non-authority clients in a distributed authority session, we show hidden objects,
2615+
// we distribute NetworkObjects, and then we end the scene event.
2616+
if (NetworkManager.DistributedAuthorityMode && !NetworkManager.LocalClient.IsSessionOwner)
2617+
{
26222618
// Show any NetworkObjects that are:
26232619
// - Hidden from the session owner
26242620
// - Owned by this client

com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ internal NetworkObject GetNetworkObjectToSpawn(uint globalObjectIdHash, ulong ow
831831
{
832832
if (NetworkLog.CurrentLogLevel <= LogLevel.Error)
833833
{
834-
NetworkLog.LogError($"Failed to create object locally. [{nameof(globalObjectIdHash)}={globalObjectIdHash}]. {nameof(NetworkPrefab)} could not be found. Is the prefab registered with {nameof(NetworkManager)}?");
834+
NetworkLog.LogError($"Failed to create object locally. [{nameof(globalObjectIdHash)}={globalObjectIdHash}]. {nameof(NetworkPrefab)} could not be found. Is the prefab registered with {NetworkManager.name}?");
835835
}
836836
}
837837
else

0 commit comments

Comments
 (0)