Граф коммитов

2726 Коммитов

Автор SHA1 Сообщение Дата
Simon Lemay 906d0b8c4a
feat!: Handle relay allocation timeouts [MTT-3706] (#1994) 2022-06-21 14:51:30 -05:00
Simon Lemay 4e218bdacf
chore: Update UTP dependency to 1.1.0 (#2025) 2022-06-21 18:03:01 +00:00
zain-mecklai ea14f2fa93
test: Limit platforms until all the other platforms are ready (#2021) 2022-06-16 15:53:26 +01:00
zain-mecklai 20304f1cb6
test: Update asmdef for the tests to match the product (#2016) 2022-06-15 18:57:42 +00:00
Noel Stephens f0631414e5
fix: Dynamically spawned NetworkObject throws exception due to no scene of origin handle [MTT-3852] (#2017) 2022-06-14 20:30:10 +00:00
zain-mecklai 08e09c22fc
test: Added ability to switch the transport to UTP from the command line (#1991) 2022-06-14 19:35:07 +00:00
ashwini cf7f737adb
chore: Run validation tests on all supported editors and desktop platforms (#2013) 2022-06-14 18:03:36 +00:00
Simon Lemay f9228d27ea
fix: Clear UnityTransport reliable receive queues on shutdown (#2011) 2022-06-14 02:02:23 +00:00
ashwini 399ab96306
chore: add 2022.2 into the testing matrix (#2012) 2022-06-13 17:44:07 +00:00
Noel Stephens 352db12e4c
fix: observers not being cleared on despawning NetworkObject (#2009) 2022-06-10 20:06:34 +01:00
ashwini 1c4f3ef41f
chore: Add .buginfo [skip ci] (#2008)
chore: Add .buginfo
2022-06-09 14:28:42 -04:00
Noel Stephens d23f93dba5
fix: NetworkAnimator does not work using the server authoritative model [MTT-3745] (#2003) 2022-06-09 12:01:04 +00:00
Cosmin a0b6aa19ce
feat: Allow passing an allocator for FastBufferReader's internal handle when using Allocator.None [MTT-3534] (#1966) 2022-06-09 10:13:03 +00:00
Noel Stephens c0c6b02cd4
fix: soft synchronization error occurs on late-joining client when an in-scene placed NetworkObject has been parented to another dynamically spawned NetworkObject [MTT-3615] (#1985) 2022-06-09 08:48:36 +00:00
Noel Stephens 79ab5b6ebc
style: fixing spelling issue `OnIsServerAuthoritatitive()` -> `OnIsServerAuthoritative` (#2006) 2022-06-09 08:58:33 +01:00
JS Fauteux 7f5dc1c2dc
fix: Packet loss now returns the value of the current frame instead of connection lifetime (#2004) 2022-06-08 20:59:34 +00:00
Noel Stephens 6d7c00e3cd
fix: NetcodeIntegrationTest remove extra OnNewClientCreated call (#2005) 2022-06-08 20:28:30 +01:00
Fatih Mar 9199f828af chore: update `testproject/.gitignore` 2022-06-07 21:47:13 +01:00
Jeffrey Rainy 55c1e62f41
refactor!: connection approval (#2002) 2022-06-07 20:27:15 +01:00
Kitty Draper fd816c51ea
fix: mono cecil compatibility and UNET removal fixes for 2022.2.0a13 and above (#2000) 2022-06-07 18:13:18 +01:00
ashwini 472d51b345
fix: update api xmldoc for SendNamedMessage [skip ci] (#2001) 2022-06-06 23:10:30 +01:00
Noel Stephens fef6b190be
fix: NetworkSceneManager Data Pool Test failures on console - switch (#1986) 2022-06-06 19:52:34 +00:00
Kitty Draper 98d190e709
fix: Fixed enum networkvariables throwing exceptions (#1999) 2022-06-06 19:54:49 +01:00
Sam Bellomo 9f950ceb66
fix: Removing useless drawline from NetworkTransform that shouldn't have ended up here for so long (#1988) 2022-05-27 18:57:45 +01:00
zain-mecklai 5e76d8e1d4
test: remote config support for multiprocesstestscene (#1931)
* integrate multi-machine testing code

* Reconfigure how host/client ip/port is set

* PR feedback

* Undetected compilation error

* update to use async await

* use async await

* Use async/await and avoid call to Wait()

* Clean up whitespace as well as remove calls to Wait()

* only whitespace

* attempt to move setting up StartClient to support async config

* Continued experiments

* Start client after the configuration has been set

* Use notifications and callbacks instead of waits to enable TestCoordinator when the connection is complete

* Make startclient call explicit

* Test Coordinator cleanup for INotifyPropertyChanged

* Fix whitespace

* Fix whitespace, simplify

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2022-05-25 18:00:48 -05:00
Kitty Draper ae28805fa7
fix: remove ilpp for network variable [MTT-3438] (#1976)
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-05-25 19:21:10 +00:00
Noel Stephens 71b76e7598
fix: OnSceneEvent should raise Unload events for all scenes not just additive scenes [MTT-3580] (#1975)
* fix

MTT-3580
This resolves the issue with the active scene and any additively loaded scenes not sending scene event notifications to inform the user that the scenes did, indeed, unload.

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* test - NetworkSceneManagerEventNotifications - update

Added some additional tests for switch scene notifications for additively loaded scenes and the currently active scene.

* update

Minor update to NetworkSceneManager.SceneUnloadEventHandler to deal with the scenario where a scene is unloaded but NetworkManager has already shutdown.

* update

Final changelog update.
MTT-3580

* update

Added some shutdown code to make sure SceneUnloadEventHandler cleans up after itself in the event a large scene is in the middle of loading and the player exits the current game-session.

Cleaned up some comments.
Cleaned up some debug output in the NetworkSceneManagerEventNotifications test.
2022-05-25 15:26:36 +00:00
Noel Stephens 39a244854e
fix: NetworkAnimator does not update animator's parameters unless the animator's layer changes [MTT-3492] (#1946)
* fix

Fix for animators that have one layer and handle most animation state changes via properties.

* test and style

Adding an integration test to validate the changes.
Updated comments in NetworkAnimator.

* style

MTT-3492
Remove namespace references I was not using.

* style

only applying changes required for asmdef file.

* update and test

Removed the duplicate tracking for parameters.
Added the ability to make it owner or server authoritative.
Included triggers in this update.
Added test for triggers.

* style

* update

removing unused parameter state class

* update and fix

This updates the manual animation test so we can visually see NetworkAnimator working properly.
This fixes the issue where late joining clients would not be updated to the NetworkAnimator's state.
This fixes some test project asset related issues including to make sure we are always set to run in the background and have a target fps of 120.

* update and fix

This fixes the issue where it would sometimes not clean up/dispose the "cache" native array.
This improves the client synchronization (as best for the current way that we write information).

Manual Test Updates:
This fixes an issue with scale as well as getting other players to join and distribute evenly.
This fixes the issue with the prefab asset itself (scale issue impacted pulse).
Increased send/receive buffer sizes (we send a lot of data for animations currently)

* update

Making CleanUp private.

* fix

This lost its parameters for some reason...

* fix

Missed adding the trigger state back.

* test

This verifies that late joining clients get synchronized to the current NetworkAnimator state.
This also fixes the issue where stopping a client during an integration test always meant that you wanted to delete it.  Now, you have the option to not destroy in the event you want to stop a client, do some stuff, and then reconnect the client.

* test and style

Minor tweak and additional check that the AnimatorTestHelper instances equals the TotalClient count (more of a sanity check).
Added some comments and removed some LFs.

* Test and Style

I hooked up the TriggerTest to the wrong state.  Fixed issue by creating a new state that is activated by the test trigger.
Changing the warning to an actual error in TriggerTest (i.e. if that happens the test should fail).

* Update

This includes several adjustments to improve performance.
-Parameters are now sent separately
-New internal NetworkAnimatorStateChangeHandler that changes when:
  -It detects changes to the Animator
  -The server-side client forwarded RPC messages are processed here
-Removed the OwnerAuthoritative public bool

This also include integration test adjustments in order to be able to create and join a new client on the fly during a test.

* fix

This got test running locally in a stand alone testrunner build.
Going to give this a shot in Yamato land.

* wip

Sorting out the issue with server-side owner late joining client synchronization.  This version works with all tests ==but== the server-side owner late joining client portion... still trying to find this bug.

* fix

This reverts Triggers back to being set by an RPC (better to separate for now).
This also fixes minor issues with a player joining right in the middle of a transition.
This also fixes issue where trigger paths were not being set when transitioning (still could use more work).
This fixes the issue with the NetworkAnimator failing on the late joining player test where the late joining player could join while an Animator is in the middle of a transition.

* style

* style

* update

This improves upon the synchronization of a late joining client when connected while an animation is in the middle of a transition (it doesn't fix the issue completely, but is closer to being synchronized with the source animation)

* update

Removing VerboseDebug information

* Test

Added a small profiling test to profile where we spend time.
(sending RPCs)

* update - optimize

Optimizing how we send parameter updates.  Now we only send the parameters that changed.
This also avoids some smaller allocations by reusing a ClientRpcParams instance and a List<ulong> to hold the client ids to send to.

* style

updating a missed whitespace

* update

MTT-3492 MTT-2644
Updating what was fixed in the change log.

* update

Minor tweaks suggested by Fatih.
2022-05-25 09:42:57 -05:00
Noel Stephens b9946cd4d3
fix: NetworkBehaviourReference throws type case exception when using TryGet [NCCBUG-167] (#1984)
* fix

NCCBUG-167
This fixes the issue with the type (T) casting throwing an exception when the type is not found (i.e. trying to cast a type to null will asset...trying to get the result of getting a type as (T) will still return null.

* update

adding the changelog entry

* test

This test verifies the fix.

* update

adding PR number to the change log entry
2022-05-24 20:44:54 -05:00
Noel Stephens 75c646ad91
fix: LoadEventCompleted scene event not invoked when a client disconnects before finishing loading a scene [MTT-3396] (#1973)
* test

This allows me to test this bug to verify it is no longer happening.

* fix

This fixes the issue where if a client disconnects during a scene event it would not get completed.
This will also fix an exception on the client side where if the client was disconnected during a scene event while in the middle of loading or unloading a scene it will not try to continue processing the event.

* test

This includes the integration test that validates the fix.
This also includes some minor adjustments to the integration test scene handler to account for handling a client disconnecting in the middle of a scene loading event.

* Update CHANGELOG.md

* update

MTT-3396
Adding additional code that tracks the initial clients that were connected when the scene event starts in order to provide an accurate list of clients that timed out during scene loading.
Cleaned up some of the code in the integration test as well as added additional comments.

* Update CHANGELOG.md

* Update com.unity.netcode.gameobjects/Runtime/SceneManagement/SceneEventProgress.cs

Co-authored-by: LPLafontaineB <louisphilippe.lb@unity.com>

* fix

Fixing an issue where if a virtual mac machine was running slower than expected it would time out on certain deferred message tests.  The primary area impacted was WaitForMessageOfTypeReceived which seemed to not use the DefaultTimeout value but 0.5s as the maximum time it would wait for the message.
This just changes the timeout to the Default timeout for WaitForMessageOfTypeReceived and I noticed WaitForMessageOfTypeHandled used 0.5s for the default time out period and set that to use the DefaultTimeout.

* fix

increasing the timeout period.

Co-authored-by: LPLafontaineB <louisphilippe.lb@unity.com>
2022-05-23 17:37:30 -05:00
Jeffrey Rainy 8a109faf9f
chore: making NetworkTransform's interpolation bounds configurable. (#1979)
* chore: making NetworkTransform's interpolation bounds configurable.
Fixes an intermittent test breakage due to extrapolation bringing us out-of-bounds

* style: coding standard adjustments
2022-05-20 18:08:10 -04:00
Albin Corén a4edf1818d
test: Nested NetworkObjects in prefabs throws a warning [MTT-2976] (#1969)
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-05-19 17:02:42 +01:00
Kitty Draper e58355d765
feat: Add "RemoveNetworkPrefab" which is necessary for certain addressables implementations (#1950)
* feat: Add "RemoveNetworkPrefab" which is necessary for certain addressables implementations

* changelog

* tests

* - Added XMLDoc
- Enforced not removing prefabs when ForceSamePrefabs is enabled.

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-05-18 22:49:49 +00:00
Kitty Draper 7b7ab49255
fix: restore native fixed string support (#1961)
* WIP

* Finished implementation, fixed tests, added some new tests.

* Standards

* changelog

* Added some requested comments.

* Added some comments.
2022-05-18 22:23:16 +00:00
Noel Stephens c09a3deabf
fix: NetworkSceneManager add do not load during callback note in xml documentation [MTT-3495] (#1974)
* update

xml documentation to be included in API documentation that one should not try to start a new scene event within a scene event notification callback.

* update

one more location just to make sure.

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

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-05-17 13:41:27 +00:00
Jeffrey Rainy eaf781e4dd
fix: preventing issues with game code registering multiple `ConnectionApprovalCallback`s [MTT-3496] (#1972)
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-05-17 13:04:29 +00:00
Kitty Draper 6d54e2878b
feat: Addressables tests (#1895) 2022-05-11 20:10:24 +00:00
Noel Stephens 3b853e0682
fix: DestroyGameObject message changes updated for NetworkObject.NetworkHide - MTT-3552 (#1960)
* fix

MTT-3552
This fixes the issue with NetworkHide not being updated to changes in DestroyObjectMessage.

* test

This updates the NetworkShowHideTests to verify the GameObject is indeed destroyed on the client side when hidden.
It also fixes a few other potential timing issues and cleaned up some of the code to leverage from more recent updates to NetcodeIntegrationTest.
2022-05-11 19:37:55 +00:00
ashwini d07865424a
chore: Bump package version to pre.9 (#1957) 2022-05-11 00:33:12 +01:00
ashwini b42ea68095
chore: Add Standalone Tests for IL2CPP backend (#1923) 2022-05-10 03:47:03 +00:00
Noel Stephens d949e99ea8
fix: Endless warning dialogs when NetworkBehaviour is added to NetworkManager - MTT-3252 (#1947)
* fix

MTT-3252
This fixes the endless dialog loop issue.

* style

updating comments and the dialog text copy.

* Update CHANGELOG.md

Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
2022-05-10 00:00:42 +00:00
Kitty Draper 9a8cb2637e
fix: Fixed compile failure when compiled against com.unity.nuget.mono-cecil >= 1.11.4 (#1920)
* fix: compile fails on Unity 2022.2.0a11 due to breaking API change in Cecil

* Updated to base version define on Cecil instead of Unity.

* changelog
2022-05-09 23:14:08 +00:00
Noel Stephens b712d1cad2
fix: NetworkSceneManager does not synchronize despawned in-scene placed NetworkObjects [MTT-2924] (#1898)
* fix

MTT-2924
This is the first pass at solving the issue where late joining clients are not synchronized properly with despawned in-scene NetworkObjects.

* Update CHANGELOG.md

* Update CHANGELOG.md

* fix

This allows for respawning of in-scene placed NetworkObjects without having to register them with the NetworkManager.

* Update CHANGELOG.md

* style

* Update CHANGELOG.md

* style

whitespace fixes.

* fix

Passing the entire SceneObject structure as opposed to adding more parameters to the NetworkSpawnManager.HasPrefab method in order to be able to extract the NetworkSceneHandle and include the in-scene placed NetworkObjects as part of the "prefabs to search for".

* update

This is some work towards integration tests where clients might be able to actually load scenes as opposed to fake loading them

* fix

Fixed some minor issues with tests.
Updated HiddenVariableTests as it needed some timing related adjustments.

* Update NetworkSceneManagerEventDataPoolTest.cs

* style

* style

* test - integration test clients now load scenes

This update allows for clients to load scenes and synchronize in-scene placed NetworkObjects during integration testing.

* test - fix

Now that clients are loading scenes, needed to make some minor adjustments.

* test - fix

Realized I don't need to simulate client loading delay unless the client is blocked from loading.
Also had to adjust whether the metrics tests waited for the client or not when loading.

* fix

Fixes an issue that can occur where this becomes enabled in test runner and will throw an exception if target is null.

* fix - NetworkSceneManager.GetSceneRelativeInSceneNetworkObject

GetSceneRelativeInSceneNetworkObject needed to get the sceneHandle before checking for it existing in the ScenePlacedObjects.

* fix - AddDespawnedInSceneNetworkObjects

AddDespawnedInSceneNetworkObjects needed to only return despawned NetworkObjects belonging to the NetworkManager.

* test - fix - Integration test client scene loading

This fixes some of the last edge case scenarios such as:
- Not loading scenes for clients when a non-NetcodeIntegrationTest based integration test is running since this does require some additional management and cleanup.
- Assuring that in-scene NetworkObjects have the right NetworkManager assigned when loaded
- Added a check to assure that it didn't time out while waiting for all clients to connect
- Increased the NetcodeIntegrationTestHelpers default timeout to 2s vs 1s (clients loading scenes can slow down when things happen)
- NetcodeIntegrationTests now unload all scenes loaded (but the test runner scene) during teardown and onetimeteardown.

* test update

Just adding timeout checks in both NetworkVariableTests and TimeMultiInstanceTest

* test assets

Updating some of the assets used for integration testing now that clients are loading scenes too.

* test fix

Changing the scenes being loaded to avoid integration test specific SDK architecture related issues.

* test fix

An early shutdown was not needed here

* test fix

Disabling the audio listener in the EmptyScene to reduce console spam during integration tests.

* test fix

Fixing edge case timing issue with MessageOrdering.

* test InScenePlacedNetworkObjects

This is the integration test for this PR.
It tests late joining client synchronization with despawned NetworkObjects and tests that in-scene placed NetworkObjects do not need to be registered with the NetworkManager to be spawned.

* fix

Don't throw an exception when calling GetObservers or IsNetworkVisibleTo when the NetworkObject is not spawned.

* fix

fixing typo/mistake for the scene to be unloaded.

* style

* Update ObjectNameIdentifier.cs

* style

* style

updating comments and removing LFs and some commented out code.

* update and style

updating comments and minor final tweaks.

* update

minor changes suggested by Jeffrey R.

* update

removing scene management specific code from places where scene management is disabled.

* style

updated some comments

* fix

Fixing an issue where CheckValueOnClient was crashing.  Integration test timing did change slightly now that clients load scenes, so it was possible that the key would not exist by the time it was being checked.

* fix  consoles

reducing the number of clients from 9 to 4 in some of the NetworkSceneManager related tests as I think it impacted performance enough to cause clients to take longer than the default timeout of 2 seconds.

* fix

Hopefully this will fix the issue with Xbox Scarlett

* test - fix

Removing m_CanCheckLoadUnloadEvents as that was a sanity check while I was testing clients loading scenes.  This could possibly fix an edge case scenario issue where a message might get ignored.

* update

removing NetworkSceneHandle from NetworkObject as it was not needed.

* Update CHANGELOG.md

* update

Removing wait for clients to unload scenes and unloading them via SceneManager as the test has already completed and this is more clean up than anything else.

* test update

Removed the crazy code in ObjectNameIdentifier for adding tag information and simplified it by storing the original name and using that each time it needs to regenerate the tag information.
Moved where the NetworkManager name and tag information is applied to get the right client id.
Added additional debug information.

* style

* test

Testing with verbose mode to see why this passes on Windows 10 in a stand alone build and in the editor but fails on Yamato desktops.

* test

adding more debug info.

* test fix

Looks like the scene isn't really loaded when it says it is loaded.
Moving when the NetworkSceneManager's callback is invoked and adding delay before invoking.

* test fix

Making some additional modifications to see if it was when the NetworkSceneManager scene Load/Unload event action is invoked and reducing the number of clients to 1.

* Test Fix

Minor tweaks and merging develop into this branch.

* test fix

Found a bug in some recent changes that would cause a crash under specific scenarios.

* fix

* test and style

Went back through some of the changed files and removed some code no longer needed, extended some of the verbose debug info for any future debugging purposes, and updated some of the comments.

* style

removing commented out code.
2022-05-09 17:36:33 -05:00
Jeffrey Rainy 4a5c86fc1f
fix: cleaning up connected clients upon shutdown [MTT-1573] (#1945)
* chore: cleaning up connected clients upon shutdown [MTT-1573]

* chore: cleaning up connected clients upon shutdown [MTT-1573] changelog

* Update com.unity.netcode.gameobjects/CHANGELOG.md

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-05-09 20:26:04 +00:00
Jeffrey Rainy ad68997168
fix: allowing quick NetworkHide and NetworkShow [MTT-3488] (#1944)
* fix: allowing quick NetworkHide and NetworkShow [MTT-3488]

* fix: allowing quick NetworkHide and NetworkShow [MTT-3488] changelog and tests

* fix: allowing quick NetworkHide and NetworkShow [MTT-3488] test timing based on ticks
2022-05-09 15:52:55 -04:00
Jeffrey Rainy b8b6dfcd41
fix: Clearing TransportEvent delegate event when failing to host. [MTT-3421] (#1938)
* fix: Clearing TransportEvent delegate event when failing to host. Fixes an issue where hosting again after hosting with invalid params would result in doubly-delivered messages followed by time-out

* fix: Clearing TransportEvent delegate (changelog)
2022-05-05 18:19:00 -04:00
ashwini 4c59869e94
fix: typo (#1937) 2022-05-05 19:27:58 +01:00
Fatih Mar 8401fd6583
chore: update `CODEOWNERS` (#1935) 2022-05-05 09:20:40 -07:00
Jesse Olmer 5240ad27d8
docs: NetworkConfig.ClientConnectionBufferTimeout xmldoc clarifications [skip ci] (#1927)
Add more detail to where in the process the setting takes effect, how it relates to transport-level timeouts and indicates that it's a server-side setting only.
2022-05-05 08:39:42 -07:00
ashwini 98a0e80d2f
fix: Fix code coverage config name in nightly trigger (#1933) 2022-05-04 18:10:29 -04:00