Skip to content

Commit f566451

Browse files
Merge branch 'develop-2.0.0' into fix/v2.x/disconnect-event-notifications-2390
2 parents 1f2a521 + 42002f9 commit f566451

File tree

16 files changed

+602
-172
lines changed

16 files changed

+602
-172
lines changed

.github/pull_request_template.md

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,61 @@
1-
<!-- Replace this block with what this PR does and why. Describe what you'd like reviewers to know, how you applied the engineering principles, and any interesting tradeoffs made. Delete bullet points below that don't apply, and update the changelog section as appropriate. -->
1+
## Purpose of this PR
2+
[//]: # (
3+
Replace this block with what this PR does and why. Describe what you'd like reviewers to know, how you applied the engineering principles, and any interesting tradeoffs made.
4+
)
25

3-
<!-- Add short version of the JIRA ticket to the PR title (e.g. "feat: new shiny feature [MTT-123]") -->
6+
### Jira ticket
7+
_Link to related jira ticket ([Use the smart commits](https://support.atlassian.com/bitbucket-cloud/docs/use-smart-commits/))_
48

5-
## Changelog
9+
### Changelog
10+
[//]: # (updated with all public facing changes - API changes, UI/UX changes, behaviour changes, bug fixes. Remove if not relevant.)
611

712
- Added: The package whose Changelog should be added to should be in the header. Delete the changelog section entirely if it's not needed.
8-
- Fixed: If you update multiple packages, create a new section with a new header for the other package.
9-
- Removed/Deprecated/Changed: Each bullet should be prefixed with Added, Fixed, Removed, Deprecated, or Changed to indicate where the entry should go.
10-
11-
## Testing and Documentation
12-
13-
- No tests have been added.
14-
- Includes unit tests.
15-
- Includes integration tests.
16-
- No documentation changes or additions were necessary.
17-
- Includes documentation for previously-undocumented public API entry points.
18-
- Includes edits to existing public API documentation.
13+
- Fixed: If you update multiple packages, create a new section with a new header for the other package.
14+
- Removed/Deprecated/Changed: Each bullet should be prefixed with Added, Fixed, Removed, Deprecated, or Changed to indicate where the entry should go
1915

2016
<!-- Uncomment and mark items off with a * if this PR deprecates any API:
2117
### Deprecated API
2218
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter yyyy-mm-dd)` entry.
23-
- [ ] An [api updater] was added.
19+
- [ ] An [api updater](https://confluence.unity3d.com/display/DEV/Obsolete+API+updaters) was added.
2420
- [ ] Deprecation of the API is explained in the CHANGELOG.
2521
- [ ] The users can understand why this API was removed and what they should use instead.
2622
-->
2723

28-
## Backport
24+
## Documentation
25+
[//]: # (
26+
This section is REQUIRED and should mention what documentation changes were following the changes in this PR.
27+
We should always evaluate if the changes in this PR require any documentation changes.
28+
)
2929

30-
<!-- If this is a backport:
31-
- Add the following to the PR title: "\[Backport\] ..." .
32-
- Link to the original PR.
33-
If this needs a backport - state this here
34-
If a backport is not needed please provide the reason why.
35-
If the "Backports" section is not present it will lead to a CI test failure.
36-
-->
30+
- No documentation changes or additions were necessary.
31+
- Includes documentation for previously-undocumented public API entry points.
32+
- Includes edits to existing public API documentation.
33+
34+
## Testing & QA
35+
[//]: # (
36+
This section is REQUIRED and should describe how the changes were tested and how should they be tested when Playtesting for the release.
37+
It can range from "edge case covered by unit tests" to "manual testing required and new sample was added".
38+
Expectation is that PR creator does some manual testing and provides a summary of it here.)
39+
40+
### Functional Testing
41+
[//]: # (If checked, List manual tests that have been performed.)
42+
_Manual testing :_
43+
- [ ] `Manual testing done`
44+
45+
_Automated tests:_
46+
- [ ] `Covered by existing automated tests`
47+
- [ ] `Covered by new automated tests`
48+
49+
_Does the change require QA team to:_
50+
51+
- [ ] `Review automated tests`?
52+
- [ ] `Execute manual tests`?
53+
54+
If any boxes above are checked, please add QA as a PR reviewer.
55+
56+
## Backport
57+
[//]: # (
58+
This section is REQUIRED and should link to the PR that targets other NGO version which is either develop or develop-2.0.0 branch
59+
Add the following to the PR title: "\[Backport\] ..."
60+
If this is not needed, for example feature specific to NGOv2.X, then just mention this fact.
61+
)

.github/workflows/backport-verification.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This workflow is designed to verify that the pull request description contains a required sections that are important from quality perspective.
2+
# ## Backport section is important as a reminder to account for backports for anyone that works with NGO repository (to 1.X or 2.X branches respectively).
3+
# ## Testing & QA section is important to ensure that the PR has appropriate testing coverage and is important when QA will evaluate PRs before Playtesting for the release.
4+
# ## Documentation section is important to ensure that the documentation is updated with the changes made in the PR.
5+
6+
# If any of the sections is missing, the workflow will fail and block the PR from merging, prompting the developer to add those sections to the PR description.
7+
# The workflow is configured to run when PR is created as well as when it is edited which also counts simple description edits.
8+
9+
name: "NGO - PR Verification"
10+
11+
on:
12+
pull_request:
13+
types: [opened, edited, synchronize, reopened]
14+
branches:
15+
- develop
16+
- develop-2.0.0
17+
- release/*
18+
19+
jobs:
20+
pr-verification:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Check PR description
27+
uses: actions/github-script@v7
28+
with:
29+
script: |
30+
const pr = context.payload.pull_request;
31+
const body = pr.body || '';
32+
33+
// List of mandatory PR sections
34+
const requiredSections = [
35+
{
36+
header: '## Backport',
37+
description: 'PR description must include a "## Backport" section. Please add this section and provide information about this PR backport to develop or develop-2.0.0 branch respectively or explain why backport is not needed.'
38+
},
39+
{
40+
header: '## Testing & QA',
41+
description: 'PR description must include a "## Testing & QA" section. Please add this section and provide information about the testing performed for this PR. It can range from adding unit tests to full samples and is needed from QA side to analyze PRs while Playtesting for the release.'
42+
},
43+
{
44+
header: '## Documentation',
45+
description: 'PR description must include a "## Documentation" section. Please add this section and provide information about the documentation changes made in this PR. It is important to keep the documentation up to date with the code changes.'
46+
}
47+
];
48+
49+
const missing = requiredSections.filter(section => !body.includes(section.header));
50+
51+
if (missing.length > 0) {
52+
let message = 'PR description is missing the following required section(s):\n';
53+
54+
const missingDescriptions = missing.map(
55+
s => `- ${s.header}: ${s.description}`
56+
);
57+
58+
message += missingDescriptions.join('\n');
59+
message += '\n\nPlease add them to your PR description.';
60+
61+
core.setFailed(message);
62+
}

Tools/CI/run_cmb_service.sh

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,98 @@ echo "Starting with echo server on port: $echo_port and the cmb service on port:
6060

6161
# Setup -------------------------------------------------------------------------
6262

63+
64+
ThrewError=false
65+
66+
# Mimics "Try-Catch" where you have to check if an error occurred after invoking
67+
try() {
68+
ThrewError=false
69+
"$@" || throw "$@"
70+
}
71+
72+
# Invoked by try
73+
throw() {
74+
logError "An error occurred executing this command:$@"
75+
ThrewError=true
76+
}
77+
78+
# A way to log messages that are easy to distinguish from the rest of the logs
79+
logMessage(){
80+
printf "\n############################################\n"
81+
printf "$@\n"
82+
printf "############################################\n"
83+
}
84+
85+
# A way to log error messages that are easy to distinguish from the rest of the logs
86+
logError(){
87+
printf "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
88+
printf "$@\n"
89+
printf "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
90+
}
91+
92+
# Protocol Buffer Compiler ------------------------------------------------------
93+
94+
# Apply any updates
95+
logMessage "Updating modules..."
96+
sudo apt-get update
97+
98+
# Install Protocol Buffer Compiler (using apt-get)
99+
logMessage "Installing protocol bufffer compiler as SUDO..."
100+
try sudo apt-get install -y protobuf-compiler
101+
102+
# If the previous command failed, try without sudo
103+
if $ThrewError; then
104+
logMessage "Installing protocol bufffer compiler as shell assigned account..."
105+
apt-get install -y protobuf-compiler
106+
else
107+
logMessage "Protocol bufffer compiler was installed as sudo!"
108+
fi
109+
110+
# Add the PROTOC environment variable that points to the Protocol Buffer Compiler binary
111+
export PROTOC="/usr/bin/protoc"
112+
113+
# Validate the PROTOC env var by getting the protoc version
114+
try $PROTOC --version
115+
116+
if $ThrewError; then
117+
logError "Failed to properly run protoc!"
118+
exit -1
119+
else
120+
logMessage "Protocol Buffer Compiler Installed & ENV variables verified!\n PROTOC path is: $PROTOC"
121+
fi
122+
63123
# clone the cmb service repo
64124
git clone https://github.com/Unity-Technologies/mps-common-multiplayer-backend.git
125+
65126
# navigate to the cmb service directory
66127
cd ./mps-common-multiplayer-backend/runtime
67128

68129
# Install rust
69130
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
131+
70132
# Add the cargo bin directory to the PATH
71133
export PATH="$HOME/.cargo/bin:$PATH"
72134

73-
74135
# Echo server -------------------------------------------------------------------
75136

76137
# Build the echo server
138+
logMessage "Beginning echo server build..."
77139
cargo build --example ngo_echo_server
140+
78141
# Run the echo server in the background
142+
logMessage "Running echo server tests..."
79143
cargo run --example ngo_echo_server -- --port $echo_port &
80144

81-
82145
# CMB Service -------------------------------------------------------------------
83146

84147
# Build a release version of the standalone cmb service
148+
logMessage "Beginning service release build..."
85149
cargo build --release --locked
86150

87151
# Run the standalone service on an infinite loop in the background.
88152
# The infinite loop is required as the service will exit each time all connected clients disconnect.
89153
# This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits.
154+
logMessage "Running service integration tests..."
90155
while :; do
91156
./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m;
92157
done & # <- use & to run the entire loop in the background

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ Additional documentation and release notes are available at [Multiplayer Documen
1010

1111
### Added
1212

13+
- Added `AsNativeArray()` read‑only accessor to `NetworkList<T>` (#3567)
1314
- Added disconnection event notification handling capabilities where `NetworkTransport` derived custom transports can set the current disconnect event type (`NetworkTransport.DisconnectEvents`) that, if implemented, will provide more details on why the transport disconnected. (#3551)
1415
- Added protected method `NetworkTransport.SetDisconnectEvent` that a `NetworkTransport` derived custom transport can use to provide the disconnect event type that occurred. (#3551)
1516
- Added protected virtual method `NetworkTransport.OnGetDisconnectEventMessage` that, when overridden, a `NetworkTransport` derived custom transport can use to provide a customized extended message for each `NetworkTransport.DisconnectEvents` value. (#3551)
1617

1718
### Fixed
1819

20+
- Fixed issue where viewing a `NetworkBehaviour` with one or more `NetworkVariable` fields could throw an exception if running a distributed authority network topology with a local (DAHost) host and viewed on the host when the host is not the authority of the associated `NetworkObject`. (#3578)
21+
- Fixed issue when using a distributed authority network topology and viewing a `NetworkBehaviour` with one or more `NetworkVariable` fields in the inspector view would not show editable fields. (#3578)
1922
- Fixed issue where the disconnect event and provided message was too generic to know why the disconnect occurred. (#3551)
2023
- Fixed issue where `SendTo.NotMe` could cause an RPC to be delivered to the sender when connected to a live distributed authority session. (#3551)
2124

2225
### Changed
2326

27+
- Optimized `NetworkList<T>` indexer setter to skip operations when the new value equals the existing value, improving performance by avoiding unnecessary list events and network synchronization. (#3587)
2428
- Changed `UnityTransport` now handles setting the current disconnect notification type, via internal `UnityTransportNotificationHandler` class, while also providing extended informational messages for each disconnect event type. (#3551)
2529

2630
## [2.5.0] - 2025-08-01
@@ -30,10 +34,11 @@ Additional documentation and release notes are available at [Multiplayer Documen
3034
- Added serializer for `Pose` (#3546)
3135
- Added methods `GetDefaultNetworkSettings` and `GetDefaultPipelineConfigurations` to `UnityTransport`. These can be used to retrieve the default settings and pipeline stages that are used by `UnityTransport`. This is useful when providing a custom driver constructor through `UnityTransport.s_DriverConstructor`, since it allows reusing or tuning the existing configuration instead of trying to recreate it. This means a transport with a custom driver can now easily benefit from most of the features of `UnityTransport`, like integration with the Network Simulator and Network Profiler from the multiplayer tools package. (#3501)
3236
- Added mappings between `ClientId` and `TransportId`. (#3516)
33-
- Added `NetworkPrefabInstanceHandlerWithData<T>`, a variant of `INetworkPrefabInstanceHandler` that provides access to custom instantiation data directly within the `Instantiate()` method. (#3430)
37+
- Added `NetworkPrefabInstanceHandlerWithData<T>`, a variant of `INetworkPrefabInstanceHandler` that provides access to custom instantiation data directly within the `Instantiate()` method. (#3497)
3438

3539
### Fixed
3640

41+
- Removed allocation to the heap in NetworkBehaviourUpdate. (#3573)
3742
- Fixed issue where NetworkConfig.ConnectionData could cause the ConnectionRequestMessage to exceed the transport's MTU size and would result in a buffer overflow error. (#3564)
3843
- Fixed regression issue in v2.x where `NetworkObject.GetNetworkBehaviourAtOrderIndex` was converted from public to internal. (#3541)
3944
- Fixed ensuring OnValueChanged callback is still triggered on the authority when a collection changes and then reverts to the previous value in the same frame. (#3539)

com.unity.netcode.gameobjects/Documentation~/TableOfContents.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* [Ownership race conditions](basics/race-conditions.md)
3535
* [Spawning and despawning](spawn-despawn.md)
3636
* [Object spawning](basics/object-spawning.md)
37+
* [Network prefab handler](advanced-topics/network-prefab-handler.md)
3738
* [Object pooling](advanced-topics/object-pooling.md)
3839
* [Object visibility](basics/object-visibility.md)
3940
* [Spawning synchronization](basics/spawning-synchronization.md)
@@ -100,4 +101,4 @@
100101
* [NetworkObject parenting](samples/bossroom/networkobject-parenting.md)
101102
* [Optimizing Boss Room](samples/bossroom/optimizing-bossroom.md)
102103
* [NetworkRigidbody](samples/bossroom/networkrigidbody.md)
103-
* [Spawn NetworkObjects](samples/bossroom/spawn-networkobjects.md)
104+
* [Spawn NetworkObjects](samples/bossroom/spawn-networkobjects.md)

0 commit comments

Comments
 (0)