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

2730 Коммитов

Автор SHA1 Сообщение Дата
Sam Bellomo 47f9d65683
chore: release/1.6.0 merge back to develop (#2684) 2023-08-30 09:26:12 +01:00
Noel Stephens dd015bf43b
chore: test project updates 2023-Q3 (#2679)
* fix

This fixes an issue where ConnectionModeScript and/or StatsDisplay would throw an exception if certain optional properties were not defined.

* update

Minor adjustment to the Spawner class where if the frequency of spawning is set to zero it will only spawn 1 instance (i.e. a one shot spawner).
Updated several samples to use UnityTransport as opposed to UNet.
Limited number of objects spawned, adjusted the ray cast line renderer, updated the physics player to have a ray pointing towards its forward (to know the direction you are going) in physics example.
Adjusted the connect mode buttons so they will automatically re-appear when you disconnect.
Updated several projects to have their own network prefab list.
2023-08-28 13:43:16 -05:00
Noel Stephens d3791985f0
fix: GlobalObjectidHash serializing invalid values [MTT-77098] (#2662)
* fix
So far this user suggested fix looks promising. Creating a prefab from within a scene no longer requires one to delete the original (in-scene) object and then create a new instance from the newly created prefab.  It also is automatically detected and added to the default prefabs.
Fixing issue with namespace being outside of the UNIT_EDITOR conditional and removed an unused private property.
Fixing issue with PrefabStageUtility not existing in the same namespace based on Unity editor version.
Make sure the default network prefabs list is generated automatically by default.

* update
Minor rename of a variable.
Updated comments for further clarification as to what is happening.

* test
Adding method to expose GlobalObjectIdHash for manual testing purposes.
Attempting to fix the issue with TransformInterpolationTests stability.
Really, this test should be re-written.
2023-08-25 19:37:19 +00:00
Noel Stephens b5b8edae4a
fix: client not tracking changes to layer weights [MTT-7166] (#2674)
* fix

This resolves the issue with clients not keep track of changes to the layer weights.

* test

Validates the fix to assure clients receive weight updates and track them in order to be able to apply changes when needed.
2023-08-23 23:50:49 +00:00
Kitty Draper cea44869ba
fix: Fixes "writing past the end of the buffer" error when calling ResetDirty() on managed network variables that are larger than 256 bytes when serialized. (#2670) 2023-08-22 16:56:13 -05:00
Noel Stephens cbc2d72189
fix: 32bit-ARMv7 crashes on android (#2654)
* fix
Word alignment applied to batch message.
Adjusted MaximumTransmissionUnitSize setter to round down to nearest word aligned size
Adjusted DefaultNonFragmentedMessageMaxSize  to round down to nearest word aligned size

* Fixed tests
The tools bytes measured tests were slightly modified

---------

Co-authored-by: Kitty Draper <kitty.draper@unity3d.com>
2023-08-08 16:11:46 -05:00
Kitty Draper 7ae8296e96
fix: more CoreCLR ILPP fixes (#2656) 2023-08-07 15:37:17 -05:00
Noel Stephens 81fd4ef9d8
chore: merging 1.5.2 back into the develop branch (#2650)
* merging develop into release/1.5.2 (#2634)

* chore: tagging 1.5.2 in the changelog (#2640)

---------

Co-authored-by: Kitty Draper <284434+ShadauxCat@users.noreply.github.com>
2023-08-01 17:29:02 +00:00
Noel Stephens 422aa239ed
fix: NetworkTransform synchronization fixes and owner authoritative performance improvement on server-host [MTT-6971] (#2636)
* fix

This resolves an issue with half float precision not synchronizing properly when running in owner authoritative mode, the owner client sends an update to the host-server, the host-server then forwards the state update to the remaining clients at the end of the frame but during the initial processing of the state update the delta position value is collapsed into the full float position due to exceeding the maximum delta. The primary issue was the order of operations that occurred using NetworkVariables to update the transform state when in owner authority mode.

This also reduces the amount of serialization and processing a host has to perform when receiving owner authoritative updates and there are 2 or more remote clients connected (i.e. it has to forward the result to the other clients).  Now, it just forwards the message payload to the non-owner clients upon receiving the state update.

This also fixes:
- an on-going issue with scale where really the answer was to send both the lossy and local scale values when synchronizing and/or teleporting and letting the client-side determine which to use depending upon whether the NetworkObject was parented, was the parenting applied when applying the states, and whether the parenting used WorldPositionStays.

- some minor issues with the parenting test not checking if the NetworkObject was parented before testing the final values.

- updates named message handling slightly so it doesn't spam the log console during shutdown if there are incoming messages while shutting down.

- resolves an issue where you have an owner authoritative NetworkTransform and a host-server with two remote clients connected and the following sequence occurs:
  - Client A connects to the host first and takes ownership of a NetworkObject but does not change the transform state.
  - Client B connects and attempts to move the NetworkObject that Client A owns
  - Client B was able to move the NetworkObject

* test

Adding NetworkTransformStateFlags test to validate the NetworkTransformState flags.
Adding internal BitSet setter and getter for testing and a BitSet flag test.

This test adds a "sub-child" (NetworkObject parented under a child) to the parenting test to add the additional check and make sure that all nested children preserve their values when changed for connected clients and those changes are applied and preserved for late joining clients.

Adding a test to verify that when a late joining client is connected after ownership has been transferred from the host-server to an already connected client and the owner authoritative transform has not changed yet that the non-owner client cannot change the transform values.
2023-08-01 11:51:17 -05:00
Noel Stephens fae403af67
fix: NetworkBehaviourEditor exception when using the inspector view while in play mode (#2641)
* fix

This fixes an issue where CheckForNetworkObject would perform its check when in playmode. This only needs to perform the check when not in play mode.

* style

Updated comments to be a bit clearer on what was updated.
2023-07-25 13:26:17 -05:00
Noel Stephens 6d461bfd24
fix: ilpp stripping and coreclr compatibility [NCCBUG-209] (#2614)
* update

excluding getTypeName,

* update

Make sure internal classes can access NetworkBehaviour.NetworkVariableFields in runtime builds.

* update

to get RPCS working temporarily.

* style

Adding comments about the RPC stuff since it is a bit more complicated than the previous two issues.

* style

updating and adding comments to regions of code changed in order to easily distinguish the changes made for each issue type.

* update

Missed two files.

* Updated the ILPP code to work correctly with CoreCLR:
- delegates are no longer fields, but types
- internal virtual functions can't be overridden in child classes anymore, so they have to be changed from `IsAssembly` to `IsFamilyOrAssembly` in ILPP
- Internal fields changed to `IsFamily` can no longer be accessed within the assembly, and need to be `IsFamilyOrAssembly` instead.

With those changes, previous workarounds are no longer needed, so I reverted them.

* update

removing commented out code.
wrapping the rpc table generation log info so it only logs to the console when log mode is set to developer.

* style

Fixing whitespace issue.

* revert __RpcParams to internal

* update

adding change log entry

* update

Moving the version number back down to v1.5.1

* Fixed validator failures.

* Update package.json

Reverting back to v1.5.2 to validate compatibility testing

* Add Validation exceptions for 1.5.2

* Apparently the meta file is also needed.

---------

Co-authored-by: Kitty Draper <kitty.draper@unity3d.com>
2023-07-21 15:45:35 +00:00
Noel Stephens dfe7138015
fix: NetworkClient.OwnedObjects always returning a count of zero (#2631)
* fix

This fixes the issue with NetworkClient.OwnedObjects always returning a zero count.

* style

removing TODO 2023-Q2 comments

* test

This validates the fixes for the owned objects list.

* update

removing an unrequired change.

* update

Adding the change log entry for this PR.

* test fix

Only test host for spawned objects locally, ignore that one portion when testing server only pass.
2023-07-20 09:32:24 -05:00
Kitty Draper 7e4efe14b2
fix: Add null check in TrySetParent (#2625)
* fix: Add null check in TrySetParent

fixes #2621

* Added tests

* Changelog

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2023-07-20 00:49:08 +00:00
Kitty Draper 72d6102ba3
fix: compile error with generic NetworkBehaviour singletons (#2603)
* fix: compile error with generic NetworkBehaviour singletons

* changelog

* Added another fix for a similar issue.

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2023-07-18 16:25:05 +00:00
Noel Stephens 208d1c901c
fix: RemoveOwnership not locally notifying server that it gained ownership [MTT-6377] [MTT-6937][MTT-6936] (#2618)
* fix

This resolves a few ownership related issues specifically noticed when using an owner authoritative NetworkTransform and ownership is removed.
This also assures NetworkVariables will be updated if ownership is removed just like they are when ownership is changed.
This also fixes an issue where NetworkManager's ShutdownInProgress was not true upon the application quitting which was causing an exception to occur within NetworkVariableBase under specific conditions.

* test

Removing a warning expect check that is no longer needed.
Adding additional checks to validate RemoveOwnership generates an OnOwnershipChanged notification.
2023-07-14 21:03:39 +00:00
Noel Stephens 9af9280d45
fix: NetworkTransform full precision state updates being lost when interpolating [MTT-6799] (#2624)
* fix

This fixes the issue where full precision transform synchronization was losing state while interpolating.

* update

initial change log entry

* update

Adding PR number to change log entry

* fix

Missed including half float precision scale with interpolation enabled since scale only updates the axis that changed (i.e. a target axis value could get stomped otherwise when half precision was enabled...the coming test discovered this).

* test

Modified NetworkTransformMultipleChangesOverTime to use interpolation when 3 axis are being tested as well as added the additional logic required to catch the issue not caught by this test where a state update could stomp a single axial value if the target value had not yet been reached.
2023-07-14 11:18:00 -05:00
Noel Stephens 9ca4efb0e9
fix: shutdown causes exception if invoked twice [MTT-6752] (#2622)
* fix

This fixes the issue with shutdown throwing an exception when being invoked again within the shutdown callback.

* test

Added test to validate the fix
2023-07-12 22:12:33 +00:00
Noel Stephens b8eed6849e
fix: NetworkObject.SpawnWithObservers was not being honored for late joining clients [MTT-6934] (#2623)
* fix

This resolves the issue where NetworkObjects with SpawnWithObservers set to false was not being honored for late joining clients.
This also resolves an issue when scene management is disabled the NetworkObjects' observers were not being updated for newly connected clients.

* test

This validates the fix for the late joining client observer issue.
2023-07-12 16:44:23 -05:00
Frank Luong 6ae793a651
fix: UTP test that was failing when you install Unity Transport package 2.0.0 or newer (#2616)
* removing unused log assert

* Update CHANGELOG.md

* bumping package version to 1.5.2

* adding the unreleased header in changelog
2023-07-12 12:23:43 -04:00
Kitty Draper 54666c3454
chore: Release/1.5.1 merge back to develop (#2594) 2023-06-21 14:38:23 -05:00
Kitty Draper 1c741299e5
feat: Native container serialization (#2375) 2023-05-24 22:05:45 +00:00
Kitty Draper 96def2caad
feat: Allow configuring the location of the default network prefabs list. [MTT-6209] (#2544) 2023-05-24 19:42:16 +00:00
Noel Stephens 7db429f24d
fix: OnClientDisconnected client identifier is incorrect when pending client connection is denied [MTT-6376] (#2569)
* fix

When connection approval is enabled and a client is not approved, the OnClientDisconnected callback handler was not being invoked.
(It was when a client terminates the connection but not when the server does)

* test

The test to validate the fix for the server-host not receiving the correct client identifier when denied approval for its pending connection.
Added additional functionality to NetcodeIntegrationTest that allows you to ignore waiting for a newly created client (i.e. not the default defined NumberOfClients) to connect.
Adding additional validation to assure we don't get multiple disconnect notifications on the server-host side when a client is disconnected.


* Update CHANGELOG.md

* style

renaming NetcodeIntegrationTest.WaitForNewClientToConnect to NetcodeIntegrationTest.ShouldWaitForNewClientToConnect
2023-05-24 19:04:11 +00:00
Kitty Draper 99a1b94913
feat: Add methods for setting max message size limits (i.e., MTU negotiation) [MTT-6214] (#2530) 2023-05-24 18:29:29 +00:00
Noel Stephens 706c6b43e6
fix: Provide SpawnWithObservers property alternative to CheckObjectVisibility [MTT-6353] (#2568)
* fix

Providing a way for users to specify that a NetworkObject should not spawn with any observers without having to use CheckObjectVisbility as a "global" way to handle this as it conflicts with NetworkShow if the CheckObjectVisbility handler always returns false.

* test

Test that validates the changes.

* update

adding changelog entry.
2023-05-23 16:31:19 -05:00
Tyler McDowall 347f3c09a6
Update CODEOWNERS 2023-05-22 13:48:35 -07:00
Kitty Draper e11cf0acf7
fix: Fixes warning logged on double-initialize of prefabs lists. (#2565)
* fix: Fixes warning logged on double-initialize of prefabs lists.

Also, makes adding prefabs before initializing the list no longer an error case - those prefabs are stored in a separate list so that during initialization, they can be re-added to the prefabs list after pulling in data from the NetworkPrefabsList ScriptableObjects.

* Changelog

* Update CHANGELOG.md

Re-ordering the changelog entries

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2023-05-20 01:23:21 +00:00
Noel Stephens 0ba68378cd
fix: server scene exclusion during synchronization for runtime generated scenes (#2550)
* fix

Breaking apart the ValidateSceneBeforeLoading so synchronization can exclude runtime generated scenes.

* style

Added comment

* test

Test to validate the fix for the server being able to use NetworkSceneManager.VerifySceneBeforeLoading in order to exclude scenes created at runtime.

* update

Updating the changelog file to reflect the fix
2023-05-19 13:51:30 +00:00
Noel Stephens 2b92028b5e
fix: Nested NetworkTransform synchronization fails when parent has non-Vector3.one scale [MTT-6304] (#2538)
* fix

This fixes an issue with interpolation causing nonauthoritative NetworkTransform instances to not properly reflect the final axis values when parenting changes.

* test

Updating the parenting test to validate the fix for parenting a nested NetworkTransform and assuring that values are the same.

* fix

Handle the condition that no new states have been pushed for a late joining client.
(i.e. it just synchronized a nested NetworkTransform and that is it)

* test

Did an overhaul on the parented NetworkTransformTest (formerly NetworkTransformParentedLocalSpaceTest), renamed it to ParentedNetworkTransformTest, and now it tests both world and local space values depending upon how the NetworkObject is parented.

* style

removing commented out code.

* update

Adding entry to changelog

* fix

Migrating SetStateInternal into the Initialization method so it handles change of ownership.
2023-05-18 17:26:34 -05:00
Noel Stephens cd50a00fe7
fix: NetworksSenemanager order of operations and scene migration preprocess (#2532)
* fix

Change the order of operations where clients match the server's currently active scene and then spawn and synchronize NetworkObjects locally on the server.

Preprocess the scenes containing NetworkObjects to send scene migration notifications for in the event the NetworkObjects were despawned in the same frame.

* fix

Change the logic to detect if setting the synchronization mode is occurring when clients are already connected so that it is checking against whether it is a host vs server.

* Style

fixing white space issues.

* test

Added test to verify that late joining clients synchronize properly when a NetworkObject is migrated into a new scene and then despawn and destroyed during a late joining client's initial synchronization.

* update

Updating changelog
2023-05-18 14:56:12 -05:00
Noel Stephens 9246d94bf6
fix: Remove in-editor NetworkVariable console log messages (#2562)
* Update NetworkBehaviourEditor.cs

Removing additional debug output that does not need to be spamming the console

* Update CHANGELOG.md

* Style
2023-05-16 09:54:42 -05:00
Noel Stephens 688640c485
fix: missing value on NetworkListEvent for EventType.RemoveAt events [MTT-6354] (#2559)
* fix: missing value on NetworkListEvent for EventType.RemoveAt events server side (#2542)

* Update CHANGELOG.md

* test

Updated the NetworkList remove tests to be combined into one test and to validate that the list changed event is returning the value of the element removed.

Cleaned up the tests a bit and removed some legacy tests that were being ignored and no longer serve a purpose.

---------

Co-authored-by: PitouGames <pitou.games@gmail.com>
2023-05-12 17:16:09 +00:00
Kitty Draper 31e5e1dc7f
fix: Generate Default Network Prefabs List setting not loading correctly (#2545)
* fix: Generate Default Network Prefabs List setting not loading correctly

* Changelog

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2023-05-10 20:49:27 +00:00
Sara [Unity] b9850875d4
fix: update links (#2557)
* Update index.md

Fixed Installation and First Steps links for package

* Update index.md

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2023-05-10 20:21:05 +00:00
Simon Lemay 36bb660c91
fix: Misleading error messages when not setting up Relay correctly (#2555) 2023-05-08 21:14:53 +00:00
Kitty Draper 26d75b26c0
fix: Add ILPP error-handling to catch managed INetworkSerializables that don't meet the `new()` constraint so they won't crash the editor [MTT-6211] (#2528) 2023-05-02 18:36:04 +00:00
Kitty Draper 1c58326074
fix: NetworkVariables of enum types breaking the inspector [MTT-6212] (#2529) 2023-05-02 17:55:30 +00:00
Jeffrey Rainy c0d9087dae
fix: fixing an exception and error logging when two different objects are shown and hidden on the same frame [MTT-6303] (#2535)
* fix: fixing an exception and error logging when two different objects are shown and hidden on the same frame (#2524)

* changelog entry
2023-05-02 11:27:00 -04:00
Simon Lemay dfd08d84e5
chore: Update UTP dependency to 1.3.4 (#2533) 2023-04-27 21:17:19 +01:00
Kitty Draper 8707582a82
perf: Remove reflection from NetworkBehaviour code to improve performance. [MTT-1968] (#2522)
* perf: Remove reflection from NetworkBehaviour code to improve performance.

* changelog

* - Added some comments to clarify some ILPP code
- Added an extra error handler to catch an edge case I missed before
- Added a bit more info to the changelog
- Fixed testproject-tools-integration tests

* Apply suggestions from code review

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

---------

Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2023-04-25 20:49:37 +00:00
Kitty Draper 8df4e988ed
chore: Merge release/1.4.0 back to develop (#2527) 2023-04-25 21:09:37 +01:00
Fatih Mar 9e45386d7c
fix: update MP Tools package link on the NetworkManager popup (#2526) 2023-04-25 14:49:43 +01:00
Simon Lemay e6514387b0
fix: Memory leak in UnityTransport after StartClient failure (#2518) 2023-04-19 16:29:01 +00:00
Jeffrey Rainy 689268ab1a
fix: g-2501 Connection disapproval results in spam logging 10 seconds later (#2514)
* fix: g-2501 Connection disapproval results in spam logging 10 seconds later

* fix

Minor adjustments to get this PR passing the connection approval timeout tests.

* update

Reverting accidental change in ProcessPendingApprovals that shouldn't have been changed.

---------

Co-authored-by: NoelStephensUnity <73188597+NoelStephensUnity@users.noreply.github.com>
2023-04-19 09:44:32 -04:00
Noel Stephens 27176860f9
fix: client throws a not server exception when destroying a NetworkObject while shutting down [MTT-6210] (#2510) 2023-04-15 12:06:13 +01:00
Fatih Mar 41d071f25b
chore: add a minor develop log for transport shutdown on connection manager shutdown when islistening 2023-04-14 13:40:57 +01:00
Fatih Mar cddc82a29f
refactor: minor re-org/updates to network systems (#2509) 2023-04-13 17:58:59 -05:00
Fatih Mar 850c7b60f6
refactor: `NetworkMessageSystem` (formerly `MessagingSystem`) (#2505) 2023-04-12 23:42:49 +01:00
Jeffrey Rainy 449bf94436
fix: removing spam logging every frame, when using developer log level (#2500) 2023-04-11 19:15:42 +00:00
Noel Stephens 4abf5a1311
fix: NGO UnityTransport not detecting invalid endpoint [MTT-3937] (#2496)
* fix

detect and return early if trying to bind to an invalid endpoint.

* test

Adding a unit test to validate the fix.
Minor tweaks to NetcodeLogAssert.
Updating test to detect invalid endpoint.
Fixing the editor test expecting a error log that no longer will happen with an invalid endpoint address.
2023-04-10 16:48:29 -05:00