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

2726 Коммитов

Автор SHA1 Сообщение Дата
Jesse Olmer 91ee96ddeb
perf: Improve testproject DrawRay.cs performance (#2166)
Achieves a more GC friendly DrawRay debug code through caching the gameobject transform, reducing the engine calls to getTransform

Co-authored-by: Gustavo Santos <gustappsantos@gmail.com>
2022-08-30 07:50:04 -04:00
ashwini 6a46c38862
fix: Delete stray NetworkAnimator.meta file [MTT-4024] (#2153)
* fix:Delete stray NetworkAnimator.meta file

* Add changelog

Co-authored-by: Jesse Olmer <jesseo@unity3d.com>
2022-08-29 16:21:36 +00:00
Kitty Draper 61693575b3
fix: Client RPCs always reporting all RPCs as going to all clients, even when limited by ClientRpcParams [MTT-4468] (#2144)
* fix: Client RPCs always reporting all RPCs as going to all clients, even when limited by ClientRpcParams

* Changelog
2022-08-26 17:16:50 +00:00
Jeffrey Rainy 70e0a2f693
fix: #2147. Removing extra warning on despawning NetworkObjects with dirty NetworkVariables (#2151) 2022-08-25 22:27:59 -04:00
Fatih Mar cec81a3743
fix: update "Hello World" docs link 2022-08-25 19:33:23 +01:00
Kitty Draper 244d8d3485
fix: Don't let exceptions in OnNetworkSpawn/OnNetworkDespawn block processing of the next callback. [MTT-1378] (#1739)
* fix: Don't let exceptions in OnNetworkSpawn/OnNetworkDespawn block processing of the next callback.

* Standards and changelog.

* Standards fixes

* It would be good to check in the right file.

* I swear these tests passed before but I have no idea how.

Also review feedback.

* Address review feedback.

* Switched to LogAssert.Expect

* Updated tests to NetcodeIntegrationTest style

* Standards fix

* Rewrote tests according to feedback.

Also fixed merge issue with changelog.

* Test the behavior on both server and client

* style

fixing white space issue.

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

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

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-08-25 00:18:11 +00:00
Kitty Draper 2271d650cb
fix: Corrects memory leak in MessageRegistrationTests (#2148) 2022-08-24 23:20:09 +00:00
Jeffrey Rainy 8a5fd4546a
fix: splitting the internal and visible parts of OnNetworkSpawn (#2143)
* fix: splitting the internal and visible parts of OnNetworkSpawn

* fix: Not throwing an exception when NetworkVariable is written to before being spawned. Logging a warning instead

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2022-08-24 18:18:47 +00:00
Noel Stephens d977620c92
fix: TransformInterpolationTests Threshold Adjustment (#2145)
* fix

increasing the threshold slightly for consoles.

* style

adding additional error information.
2022-08-24 17:54:45 +00:00
Jeffrey Rainy b3c889cef5
fix: not sending all NetworkVariables (#2135)
* fix: not sending all NetworkVariables to all clients when a client connects to a server. (#1987)

* fix

This fixes the issue with some of the tests failing.
Disabled the tests where clients don't have a prefab defined.

* update

Fixing issues with the last 5 tests.

* update

Got another (of the five) test working.
Adding some helpers to assure the prefabs are spawned before trying to check them.
Updated some comments.

* test update

This resolves the remaining issues with the deferred message tests for this PR.

* test update

I believe this will fix the tests having instability issues as well.

Co-authored-by: NoelStephensUnity <73188597+NoelStephensUnity@users.noreply.github.com>
Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2022-08-24 12:26:29 -05:00
Kitty Draper e28eb2a344
fix: Adding FastBuffer extension methods for multiple instantiations of a generic type causes runtime errors [MTT-3063] (#2142)
Fixed RPC codegen failing to choose the correct extension methods for FastBufferReader and FastBufferWriter when the parameters were a generic type (i.e., List<int>) and extensions for multiple instantiations of that type have been defined (i.e., List<int> and List<string>)
2022-08-23 16:20:50 -07:00
ashwini ce1ab3ca94
chore: Bump NGO version to 1.0.1 (#2131) 2022-08-23 13:03:44 -07:00
Jeffrey Rainy 08f6f99c82
fix: prevent exception in Boss Room with NetworkAnimator (#2140)
fix: prevent exception in Boss Room with NetworkAnimator due to m_NetworkBehaviour being null
2022-08-22 16:46:02 -07:00
ashwini 63628c7c81
chore: Fix build test (#2139) 2022-08-22 22:40:04 +00:00
Noel Stephens 28109b4227
fix: NetworkTransform teleport interpolating from last position on non-authoritative side [NCCBUG-166] (#2110)
* fix

NetworkTransform was setting the value of m_Bitset but not resetting the individual bits if there was no deltas.  This would result in a gradually increasing message size over time when updating the NetworkTransform.

* update

migrating the assignment back down below the CanCommitToTransform

* fix

This resolves the issue where clients were applying every value marked to be synchronized even if the update didn't include specific axis values.

* test

This includes some fixes to prefabs that hadn't been updated to the more recent changes in NetworkTransform that limited the minimum threshold (i.e. they were set to 0 which causes issues)

* fix

Since we are now no longer sending the entire transform values, this addition prevents the non-authoritative side from making changes to the transform.

* style

removing whitespace

* update

Adding some test adjustments and including rotation to interpolation measurements.

* style

removing an unused namespace.

* style

fixing issue with reference to UnityEngine's Object after I removed the system namespace.

* fix

This includes the adjustments for client authoritative mode to work without sending RPCs.

* fix

This update fixes the issue where the authoritative side was interpolating when interpolate is enabled.
Now, the authoritative side no longer interpolates.

* manual test updates

These changes make the player client authoritative within the Samples Menu->Additive Scene Loading manual test/sample.

* update

reverting the change of m_Bitset to an internal.

* test update

updating test to account for reverting back to the private m_Bitset.

* update

Migrated the code that updates interpolators with the current value if the axis is not set into the AddInterpolatedState method as opposed to it being in the ApplyInterpolatedNetworkStateToTransform

* fix

First pass fix for teleporting.

* test manual

Manual test adjustments (still working on player motion controller from client side)

* manual test

Adjustments for the teleporting sample/manual test.
Still working on the new player cube motion model.

* test manual

Improved motion model (still could use some more work for client to server side).
Now packing data sent from client to host/server.
Added UI text that displays whether the instance is a server, host, or client.

* update

removing debug code

* fix

This fixes the last issues with teleporting and the updated player motion model.

* fix

Cleaning up how we handle transitioning to and from global and local space.
Minor adjustment to the validation test to assure the range of error being tested on the client side is the same as the delta position threshold range.

* update

Removing the NetworkTransformState Position, Rotation, and Scale since we are only sending the values that changed (i.e. if the x-axis of position was the only thing that was set and NetworkTransformState.Position was used, then the Y and Z axial values would be invalid).

* fix

removing code block no longer needed.

* style

removing a comment that was no longer needed.

* update

applying suggested changes

* update

replacing the GetReplicatedNetworkState() method with a getter ReplicatedNetworkState property.

* update

This is a new approach:
- Make in-between state updates additive
- Clear our state's Bitset value and prepare to capture any deltas for the next network tick period.

* update

Realized since we are back to additive (per network tick), we can now remove the non-authoritative interpolation work around for not having all values that changed within the associated NetworkTransformState's network tick period.

* update

Disposing the NetworkVariables when the NetworkTransform is destroyed.

* update

Suggestion updates and comment fixes.

* style

adding Sam's comment.

* style

updated comment to include what we are preserving.

* update

Removing the ApplyTransformValues and SetTransformValues as they are no longer needed.
Also, removing the associated properties.

* Test Manual

Updates to manual test related assets and scripts.
Removed the "make a pooled object invisible to hide the teleport interpolation issue" hack that would disable the render mesh when despawned and enable it shortly after it is spawned.
Increased tick rate to 32 in the additive scene loading test.
Fixing white space issues.

* update

Removing the unused serverTime addition as well.

* update

Renamed ApplyInterpolatedNetworkStateToTransform to ApplyAuthoritativeState.
(It didn't make sense if interpolation is disabled)

* tests update

This includes an updated NetworkTransformTests that tests both authority types while running in Server and Host modes.
This includes some updates to naming for easier identification of what each test does (in test runner and in code).

* Update

Minor adjustment where we don't need to send a local properties over the stack via parameters.

* test

Added interpolate enable/disable values to all tests.
Now, all NetworkTranaformTests are done with interpolation enabled and disabled.

* fix and update

Fixed another issue that was exposed while cleaning up the code base.
Was able to remove even more of the code added previously.
Some clean up as well as making one additional method private as opposed to protected to prevent us from having to release a minor version vs patch.
Also,  ApplyTransformToNetworkState, and ApplyTransformToNetworkStateWithInfo only return if the state is dirty (the rest can be determined from within the state itself).

ApplyLocalNetworkState, used for integration tests, now just returns the NetworkTransformState.

* fix

This fixes the issue with the memory leak message in the editor NetworkTimeTests  (very odd this fixed the issue).

* test manual

Switched over to an owner authoritative NetworkTransform that also includes the playermovement.
Adjusted the PlayerCube NetworkPrefab and minor adjustment to the CollideTeleporter.

* update

updating the changelog

* fix

Found a minor logic issue in ApplyTransformToNetworkStateWithInfo where the state dirty flag could be reset before end of the current network tick.  This could result in state being carried forward into the next network tick.  This resolves that issue.

* update

Minor adjustment to how we handle applying a rotation measurement on the non-authoritative side.
Removed a property not being used outside of a single method and added additional comments to the PlayerMovement component.

* update

This update includes the final changes required in order to support the previous NetworkTransform model where it was always server authoritative and client owners could direct/apply state via internal RPCs.  This also includes the ability for a server to apply/dictate state when running in client owner authority mode.

This includes updates to the NetworkTransform tests that validate all of these updates and increase the amount of coverage for NetworkTransform.

* style

moving new private m_ClientRpcParams and m_ClientIds up to the rest of the property declarations.
Adjusting comment

* test manual

Minor adjustments for the random player movers.
Applying the server authoritative player prefab back to be the default for the additive scene sample (this makes it easier to compare to main branch).

* style

removing a no longer needed comment.
adding note about future clean up for NetworkTransform.

* style

fixed spelling issue

* style

removing left over comment and spelling

* style

removing legacy/unused namespaces

* update

realized our CommitLocallyAndReplicate method was serving no purpose at this point.
added the assignment of NetworkTransformState to the ReplicatedNetworkState within TryCommit and removed CommitLocallyAndReplicate.

* update

removing legacy check for TryCommitTransformToServer that is no longer needed.

* update

removing m_Transform (no purpose for it)
Fixing minor grammar issue with a comment

* test manual update

removing additional IsOwner check.

* revert

reverting the changes I made to the editor test NetworkTimeTests as I just had Yamato crash again in a different area in NetworkTimeTests with the same memory leak error.

* style

replacing LF/CR

* Style

Improving comments
2022-08-18 13:00:30 -05:00
Kitty Draper 7b6bcc6274
fix: NCCBUG-175: BitReader/BitWriter Reading/writing more than 8 bits was producing the wrong result (#2130)
* fix: NCCBUG-175: BitReader/BitWriter Reading/writing more than 8 bits was producing the wrong result

* Standards + changelog

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2022-08-17 23:47:52 +00:00
Simon Lemay bc4f538017
fix: Don't set the maximum frame time of UTP (#2088) 2022-08-17 23:03:18 +00:00
Jeffrey Rainy 891bd677bc
fix: Fixed Owner-written NetworkVariable infinitely write themselves (#2128)
* fix: Fixed Owner-written NetworkVariable infinitely write themselves (#2109)
Fixed by doing the pre-write as a separate step

* nit PR review :-)

* Adding test
2022-08-17 22:34:11 +00:00
Noel Stephens 2d9f786198
fix: NetworkAnimator Synchronizing transition twice [MTT-3564] (#2084)
* fix

This fixes the issue where transitions were being both triggered and the change in animation state (i.e. transition state) was being synchronized and applied to clients already transitioning which would cause any StateMachineBehaviours to have their OnStateEnter method invoked twice.

* fix

Making adjustments to account for changes to the Transition state update vs trigger update fix.

* test

Adding the additional StateMachineBehaviour (CheckStateEnter) to validate this fix.
Adjusting two tests for this fix.
Includes the animation related assets needed for the test.

* style

adding additional comments for some changes that were not obvious to the fix.

* update

removing code used to debug

* style

MTT-3564
updating changelog.

* style

correcting grammar in comment

* style

slight adjustment to the comment

* style

* update

removing more debug related code.

* style

minor integration test variable rename.
2022-08-17 17:00:45 -05:00
Simon Lemay 045cac3ee4
chore: Update UTP dependency to 1.2.0 (#2129)
* chore: Update UTP dependency to 1.2.0

* Add PR number to CHANGELOG entry
2022-08-17 18:34:25 +00:00
Jeffrey Rainy fdb32f141a
perf: improved runtime performance, dirty objects (#2116)
* Performance fix for large number of NetworkObjects

* docs: style: changelog and coding convention

* fixes tests (but not NetworkList ones)

* Fixes NetworkList functionality

* disabling incompatible test

* test adjustment, following improvement in NetworkVariable sending

* Merging two loops to scan over objects one less time (performance). Re-enabling test, making it use SetDirty() properly

* improved naming, fixed tests

* addressing 'This seems like it should be handled by PostNetworkVariableWrite' PR review comment

* refactoring common part to duplicated code paths into a single instance

* limiting m_IsDirty visibility, to encourage using SetDirty()

Co-authored-by: starchitectus <acarija@gmail.com>
2022-08-16 14:27:32 -04:00
Noel Stephens 21fcaabfae
fix: MessageSendingTests causing memory leak during editor tests. (#2125)
* fix

Seeing if this fixes the issue with our memory leaks.

* fix

minor fix to my fix.  Need to reconnect the client after creating the new MessagingSystem.
adjusted a comment.

* Update com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageSendingTests.cs

Adding Fatih's LF/CR suggestion for readability

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

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-08-16 14:59:57 +00:00
Noel Stephens bc23a35a86
fix: Nested NetworkBehaviours don't de-register or Invoke OnNetworkDespawn if destroyed while the parent NetworkObject remains spawned [NCCBUG-137] (#2091)
* fix

NCCBUG-137

This resolves the issue where destroying a GameObject with one or more NetworkBehaviour components that is a child or any child generation of the NetworkObject/GameObject that theNetworkBehaviour(s) are assigned to would still try to access the destroyed NetworkBehaviour since it was still an entry within the NetworkObject.ChildNetworkBehaviours list.  It also resolves the issue where under this scenario the NetworkBehaviours would not have their OnNetworkDespawn method invoked.

* update

NCCBUG-137

updating the changelog

* fix

We need to check IsSpawned when logging a warning about a NetworkBehaviour not having an assigned NetworkObject (this is only valid if NetworkBehaviour.IsSpawned == true)

* fix

Needed to adjust to account for the condition when it is valid is when you have a NetworkBehaviour that is spawned but there is no assigned NetworkObject.

* test

NCCBUG-137
This is the integration validation test for this PR fix.

* update

Adding PR number to the changelog entry

* test

adding check for OnNetworkDespawn being invoked when a child NetworkBehaviour is destroyed. but the parent NetworkObject persists and remains spawned.

* style

MTT-4260
was created for this technical debt.
removing reminder to create a ticket.

* fix

fixing merge issue.

* fix

Removing the invocation of NetworkBehaviour's OnNetworkDespawn when a NetworkBehaviour is destroyed while a NetworkObject is still spawned.

* style

removing unused namespace.

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

Co-authored-by: Jesse Olmer <jesseo@unity3d.com>

Co-authored-by: Jesse Olmer <jesseo@unity3d.com>
2022-08-11 09:49:28 -05:00
Jeffrey Rainy afce30fd87
fix: disconnect event not being generated (#2113)
Co-authored-by: Simon Lemay <simon.lemay@unity3d.com>
2022-08-10 12:51:34 -04:00
Noel Stephens e138a9c561
fix: client owner with both owner read and write permissions on a NetworkVariable does not update the server when changed (#2097)
* fix

MTT-4266
This fixes the issue where a NetworkVariable that is set to owner read and write permissions and the owner is a client, then the server would not be updated with any changes to the NetworkVariable.

* test

This includes an additional test to check that a client owner with both Owner read and write permissions will only update changes to the NetworkVariable on the server.

* update

Adding the changelog entry for this fix.

* update

adding PR number.
2022-08-09 07:56:02 -05:00
Jeffrey Rainy 421a364986
feat: host tells client which IDs it uses for INetworkMessages (#2103)
Server sends client reordering messages when host and client have different sets to ensure proper handler mappings.
2022-08-08 12:43:39 -07:00
Jeffrey Rainy 8bac8aa15f
fix: NetworkList "insert at end" bug (#2099) 2022-08-04 00:01:50 +01:00
Fatih Mar a0525e6be6
chore: update `CODEOWNERS` 2022-08-03 22:08:47 +01:00
Noel Stephens 0c8161e950
fix: deactivated child NetworkBehaviour exceptions [NCCBUG-138] (#2096) 2022-08-02 14:44:41 +01:00
Noel Stephens 0e84dcd18b
fix: updating testproject NetworkAnimator test (#2075)
* fix

This resolves the issue with NetworkAnimator not de-registering itself from OnClientConnected.
This resolves some issues with the manual NetworkAnimator test.

* update

MTT-4080
(this branch includes fixes for the OnClientConnectedCallback issue)
Renamed NetworkAnimatorEnhancement scene to NetworkAnimatorServerOwnerTest.
Adding the manual NetworkAnimatorServerOwnerTest scene to the scenes in build list.

* style

fixing whitespace issue.

* update

Fixing how AnimatedCubeController determines the type of NetworkAnimator and whether it is server or owner authoritative.

* update

Simplifying the conditional check requirements down to IsSpawned and IsOwner for the AnimationUserInput component since the only input checked should always be by the owner.

* update

removing an artifact from cherry picking a previous branch's work that included the manual test fixes.

* style

removing unused property.
2022-07-29 22:07:18 +00:00
Noel Stephens 6d37247685
fix: NetworkObject.NetworkHide destroys client-side in-scene placed NetworkObjects [MTT-4211] (#2086)
* fix

MTT-4211
This fixes the issue where in-scene placed NetworkObjects were being destroyed when NetworkHide is invoked.

* test

MTT-4211
This adds an additional check for NetworkHide and NetworkShow towards the end of the in-scene placed NetworkObject synchronization test.

* style

whitespace fix

* style

Adjusting comments and adding additional API XML Documentation for readability and clarification purposes.

* update

MTT-4211
Updating the changelog.

* update

improving the logic used for readability purposes since we know IsSceneObject will be valid.

* style

migrating the majority of the comments into remarks.

* style

Adding space within all added <br/> tags so they look like this: <br />
This is to see if the version of docusaurus we are using will not crash when it runs across this markdown syntax.
2022-07-29 15:43:13 -04:00
zain-mecklai 11922a0bc1
fix: ILPP filter out tests (#2024)
* update timeout

* remote UNET

* fix: Stop populating ILPPMessageProvider with messages from outside the main runtime assembly

* reset the changes to the scene

* Initialiize the Rawgithash variable for the local execution case

* Add a little more logging and see if we can find why allactons hasn't been populated at the time the test runs

* Update the test to reduce the number of log messages as well as make the messages more informative

* Lot when initlializatioon is complete

* More logging clean up and adding information about registered test methods

* Move init all steps to Awake instead of Start, eventually need to figure out how to block initial connection until init all steps is done

* Move init to Awake

* Fix missing log message in TestCoordinator Start method

* Use GPU for Ubuntu image

* Remove the nographics requirement and see if we can stabilize 2022.2

* Use -nographics and don't request a GPU for Linux

* try to use ubuntu-20 and see if this is more stable

* Use GPU for Linux and use Ubuntu 18

* Remove nographics again as it clearly makes an improvement

* Adding a GPU and removing nographics just made things slower but still failing so no point making this change, reverse it

Co-authored-by: Kitty Draper <kitty.draper@unity3d.com>
Co-authored-by: ashwini <36935028+ashwinimurt@users.noreply.github.com>
2022-07-27 16:22:11 +00:00
Noel Stephens 105bbe2be6
fix: NetworkAnimator fails to synchronize end of animation loop for late joining clients [MTT-4060] (#2076)
This resolves the issue where animations at the end of their loop would not be synchronized with late joining clients.
2022-07-27 01:01:13 -07:00
Simon Lemay 233cbd761d
feat: Allow reliable sends to go over maximum payload size (#2081)
* feat: Allow reliable sends to go over maximum payload size
2022-07-26 10:22:06 -07:00
Sam Bellomo a3e3e5209b
docs: Quick fix for clearer instructions in integration tests [skip ci] (#2077) 2022-07-26 02:41:52 +01:00
Noel Stephens b91cf276f1
fix: NetworkAnimator does not unsubscribe to OnClientConnectedCallback [MTT-4080] (#2074) 2022-07-22 16:12:05 +01:00
Noel Stephens ebfd5f6e87
chore: Remove legacy NetworkAnimator tests from the sdk runtime tests folder [MTT-4024] (#2073) 2022-07-20 23:22:34 +00:00
ashwini 87e3041421
chore: Disable unstable test WhenAMessageIsDeferredForMoreThanTheConf… (#2070)
* chore: Disable unstable test WhenAMessageIsDeferredForMoreThanTheConfiguredTime_ItIsRemoved

* Update com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs

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

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-07-20 16:15:08 +00:00
Jeffrey Rainy eaac2e5d04
fix: correctly setting PreviousValue when changing the element of NetworkList (#2069) 2022-07-19 17:44:35 +00:00
Jeffrey Rainy 1584749e96
fix: m_ListAtLastReset and dynamically spawned objects (#2065) 2022-07-18 18:30:40 +00:00
zain-mecklai ba302860e6
test: Allow for the detection of whether to run locally or remotely. (#2054)
* Set up for launching remotely

* Set up for launching remotely

* Report on WorkerCount and LaunchRemotely state

* Store the Process as it will complete later

* add a little more logging

* Simplified name

* Update GetWorkerCount to no longer set internal state

* Update BaseMultiprocessTests.cs

respond to PR feedback

Co-authored-by: ashwini <36935028+ashwinimurt@users.noreply.github.com>
2022-07-12 00:49:09 +00:00
Frank Luong 399b8ab0c2
chore: pointing tools package to release 1.0.0 branch (#2057) 2022-07-11 11:24:02 -07:00
ashwini fddb7cd920
chore: Bump version to 1.0 (#2046)
* chore: Bump version to 1.0

* Add PR number to changelog
2022-06-27 21:58:29 +00:00
Noel Stephens 9aff85f4e7
fix: API Audit for missing XML documentation [MTT-3881] (#2026) 2022-06-27 21:49:59 +01:00
Fatih Mar 1cabb7dcd6 chore: update `testproject/packages-lock.json` 2022-06-24 15:02:30 +01:00
ashwini d1302ce0b9
chore: Update test-project-tools-integration to use pre.8 (#2033) 2022-06-22 14:20:49 -04:00
ashwini 07d8286813
chore: Add ability to run mobile tests on all supported unity versions (#2028) 2022-06-22 17:10:51 +00:00
ashwini f6f9ddd9d2
fix: Fix dry-run yaml file name (#2030) 2022-06-22 13:59:53 +00:00
ashwini 56ca268433
chore: Ignore instability DeferredMessagingTest.WhenMultipleMessagesForTheSameObjectAreDeferredForMoreThanTheConfiguredTime_TheyAreAllRemoved (#2029) 2022-06-22 14:21:58 +01:00
ashwini c9c0a4963f
chore: Bump version to pre.10 (#2027) 2022-06-21 23:14:34 +01:00