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

2723 Коммитов

Автор SHA1 Сообщение Дата
Kitty Draper 529419b31f
fix: Fixed an issue where BatchedSendQueue was including the HeadIndex twice when copying data, which was causing stream corruption when the data exceeded a certain throughput. [NCCBUG-187] (#2332)
fix: Fixed an issue where BatchedSendQueue was including the HeadIndex twice when copying data, which was causing stream corruption when the data exceeded a certain throughput. [NCCBUG-187] (#2332)
2022-12-05 15:19:52 -06:00
Noel Stephens ade8ce53c4
refactor: NetworkTransform.SetState shouldGhostsInterpolate parameter [MTT-4462] (#2228)
* refactor
MTT-4462
Renaming shouldGhostsInterpolate to teleportDisabled for better clarity of what that parameter does.  While renaming it to isTeleporting would make more sense, that could potentially become a breaking change, and so the next best parameter name would be "teleportDisabled" which would not break users that use this parameter currently.
2022-12-02 19:44:57 +00:00
Noel Stephens 101bf34cae
fix: OnNetworkDespawn is not called on server side when a client disconnects [MTT-5120] (#2323)
* fix
This prevents the issue (when just destroying the GameObject) where any NetworkBehaviour component(s) destroyed before the NetworkObject would not have OnNetworkDespawn invoked.

* test
Adding the test to validate this fix.
2022-12-02 18:54:56 +00:00
Noel Stephens 8e348c1e0f
fix: IsSpawnedObjectsPendingInDontDestroyOnLoad should only be set when LoadSceneMode.Single (#2330)
* fix
MTT-4681
this fix assures that IsSpawnedObjectsPendingInDontDestroyOnLoad is only set to true when LoadSceneMode = LoadSceneMode.Singleonly.

* update
updating changelog.
2022-12-02 11:54:51 -06:00
Simon Lemay d9ab3a7ffb
fix: Allow Relay hosts/servers on WebGL (#2321)
* fix: Allow Relay hosts/servers on WebGL

* Add PR number to CHANGELOG entry
2022-11-24 16:57:33 +00:00
Noel Stephens 8ee79ab2a3
fix: This fixes the issue with recent 2023 update where FindObjectsOfType was renamed to FindObjectsByType (#2320)
* update
Adding the 2023.1.a21 FindObjectsByType fix for NGO using the UNITY_2023_1_OR_NEWER define.
Modified a few of the FindObjectsSortMode for areas that looked like they might require their results ordered by InstanceID.
2022-11-23 11:40:36 -06:00
Simon Lemay d48c373a0c
feat: Change default listen address to 0.0.0.0 (#2307)
Co-authored-by: Jesse Olmer <jesseo@unity3d.com>
2022-11-21 16:01:20 -05:00
ashwini 367ab64b92
chore: Bump NGO version to 1.2.0 (#2317)
* chore: Bump NGO version to 1.2.0

* Add unreleased section for develop
2022-11-18 12:26:38 -08:00
Gregory Kim 7144c52d6c
chore: updating metafile transport to 2.0.0-pre.2 (#2311)
updating metafile transport to 2.0.0-pre.2
2022-11-17 15:53:31 -05:00
Jeffrey Rainy b1e02e347a
fix: change ownership of owner-read network variables mtt-5009 #2286 (#2301) 2022-11-17 08:34:19 -05:00
Sam Bellomo 86afb0ac21
fix: some small fixes while testing webgl (#2291)
* better error handling.
Adding IsNullOrEmpty checks
Removing catching of the exception. With previous version, NGO still starts and IsClient is still set. With exception, StartHost fails now correctly when certificates are not set.

* adding const strings for relay connection types (instead of having to guess)

* adding test for null check

* Address review comments

Co-authored-by: Simon Lemay <simon.lemay@unity3d.com>
2022-11-16 17:39:47 +00:00
Noel Stephens 4487baa1d4
feat: Nested NetworkBehaviour Synchronization [MTT-5024] (#2298)
* feat 
This includes the changes to provide users with a way to synchronize NetworkBehaviours with custom data prior to their associated NetworkObject is spawned.

* fix and refactor
This updates NetworkTransform so that it will properly synchronize when placed on nested NetworkBehaviours (i.e. their GameObject has no NetworkObject component).
This also includes some fixes that allows for NetworkObjects to fail, NetworkVariables to fail, and NetworkBehaviour synchronization to fail without impacting the rest of the synchronization process.
Minor fix for in-scene placed parenting under a non-NetworkObject to prevent from being added to the orphaned child list.

* test
Renamed NetworkObjectSceneSerializationTests to NetworkObjectSynchronizationTests.
Added a more robust/wider range of tests, also added running host or server as well as added a basic OnSynchronize test.
Added integration test to validate nested network transforms synchronize properly with nested GameObjects' transforms.
Fixed an issue with late joined clients not registering all players in NetcodeIntegrationTest.

* test manual
This include a nested NetworkTransform manual test to visually validate the nested NetworkTransform update.
2022-11-16 04:48:32 +00:00
Kitty Draper e242f1b9aa
feat: message versioning [MTT-3048] (#2290)
Adds support for SDKs at different versions with different message formats to be able to talk to each other - the side with the higher version being responsible for both converting up when receiving and converting down when sending.
2022-11-15 16:17:10 -08:00
Fatih Mar f1870cd961
refactor: replace 3rd-party xxhash impl with in-house reimpl (#2310) 2022-11-15 13:22:09 -06:00
Jeffrey Rainy 0b0679d62d
feat: Show public NetworkVariables in editor with a nice name (#2308) 2022-11-14 17:15:39 -05:00
Jeffrey Rainy bbda510af2
fix: not using NativeArrayExtensions.IndexOf as this API changed in 21.0-pre.2 (#2303)
fix: not using NativeArrayExtensions.IndexOf as this API changed in 2.1.0-pre.2

Co-authored-by: ashwini <36935028+ashwinimurt@users.noreply.github.com>
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
2022-11-10 17:24:35 +00:00
Simon Lemay 3716e27656
perf: Jobify SendBatchedMessages in UnityTransport [MTT-4999] (#2304)
* Make ErrorUtilities usable from Burst

* Jobify SendBatchedMessages
2022-11-10 11:19:07 -05:00
Frank Luong 83096c8135
chore: updating tools to point to release 1.1.0 (#2302)
* updating tools to point to release 1.1.0

* Update manifest.json

* Updating tools 1.1.0
2022-11-09 16:03:41 -06:00
Kitty Draper 8fb7c612f8
fix: Enable custom messages to be sent to self when running as host. (#2296) 2022-11-09 17:56:03 +00:00
Jeffrey Rainy 9b3a07d05a
docs: xmldoc for DisconnectReason (#2300) 2022-11-09 16:44:54 +00:00
Kitty Draper bca25b9dbc
feat: QoL: Byte Packing of integers [MTT-4924] (#2276)
Adds byte packing for most integer fields in the SDK (a few, such as hashes, are left un-packed because they're likely to be large integers and not benefit - and may possibly actually be harmed - by variable-length encoding). Integers in `RPC`s and `NetworkVariable`s are also packed properly. No functionality has been added to allow a value to be sent unpacked in `RPC`s or `NetworkVariable`s in cases where packing may be detrimental, but this can be achieved as follows:

```csharp
public struct UnpackedInt32 : INetworkSerializeByMemcpy
{
    int Value;
}

public NetworkVariable<UnpackedInt32> MyVariable;
````

In addition to byte packing most integer fields, this commit updates `WriteValueBitPacked()` to be able to handle the full range of its type (now using an extra byte - and thus ending up making the representation larger instead of smaller - for values at the extreme ends of the size), at the cost of using one extra bit to encode the size of the type.
2022-11-08 16:57:42 +00:00
Jeffrey Rainy 23be561b62
feat: disconnect reason (#2280)
* disconnect reason
2022-11-07 09:09:21 -08:00
Simon Lemay f6db03f20c
fix: Error when using 'Use Encryption' with secure Relay (#2289)
* fix: Error when using 'Use Encryption' with secure Relay

* Add PR number to CHANGELOG entry
2022-11-04 00:08:04 +00:00
Jesse Olmer 083bb636ab
chore: Better NetworkBehaviour index out of range message (#2295)
Changes the error message to be more easily actionable for users

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2022-11-03 07:45:33 -07:00
Noel Stephens 8770f9d4d4
fix: SceneEventProgress was triggering twice when running a host and no clients were connected (#2292)
* fix
Exclude the host-client from being processed as one of the clients to test for when the scene event has completed.
GetClientsWithStatus needed to add the host-client to the list of clients that completed once the scene event was completed. Also fixed a bug in GetClientsWithStatus where, when checking for clients that did  not complete, it would include the clients that completed and the clients that did not complete in the list of client identifiers it returned.
Fixing issue where integration tests could lag by more than 1 network tick and the AsyncOperation could not yet be assigned.

* test
Added HostReceivesOneLoadEventCompletedNotification integration test to validate the fix for this PR.
Updated NetcodeIntegrationTest virtual methods to be able to gain access to a newly created client (via NetcodeIntegrationTest.CreateAndStartNewClient) when it is first created, started, and when it has been connected.

The updates to SceneEventProgress exposed an issue with ClientSynchronizationValidationTest. It was written before many NetcodeIntegrationTest helpers, so there are adjustments here to leverage from those which greatly simplifies the test.
Switched the scene that was not validated by the client-side to one that did not contain an in-scene placed NetworkObject.

Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
2022-11-02 20:26:21 -05:00
Jeffrey Rainy 59a973c211
fix: catching potential exceptions from user code during disconnect callback (#2288)
* fix: catching potential exceptions from user code during disconnect callback
2022-11-02 17:36:30 +00:00
Noel Stephens b4b3929140
refactor: Migrate menu settings to project settings [MTT-5001] (#2285)
* update
Migrated the multiplayer tools install reminder over to the new Netcode for GameObjects settings.
Deleted the UITestHelpers class completely as it is no longer needed.
2022-11-02 00:28:21 +00:00
Jeffrey Rainy 3492ba9212
style: removing unused code (#2287) 2022-11-01 18:17:13 -04:00
Noel Stephens f43e700228
fix: NetworkObjects do not honor when Auto Object Parent Sync is turned off (#2281)
* fix
This resolves the issue where NetworkObjects were not taking Auto Object Parent Sync into consideration.

* test
The test to validate that nested in-scene placed NetworkObjects that both have Auto Object Parent Synchronization enabled and disabled synchronize their transforms properly on the client side. The same test covers NetworkObjects nested under GameObjects with no NetworkObject components.  All nested instances have varying position, rotation, and scale values.
2022-10-28 22:48:58 +00:00
Noel Stephens b5f82eea15
fix: Migrate OnClientConnectedCallback invocation into StartHost [MTT-4972] (#2277)
* fix
Migrate InvokeOnClientConnectedCallback into StartHost (for host only).

* test
Updating the NetworkManagerTests to validate this PR, it also validates that this update does not impact anything when scene management is disabled.
2022-10-26 18:55:06 -05:00
Jeffrey Rainy fc6e7571e8
fix: flushing send and receive queues upon disconnection (#2274) 2022-10-25 11:17:41 -04:00
ashwini e4d0e7d214
chore: Add CI for WebGL builds [MTT-4656] (#2247)
chore: Add CI for WebGL
2022-10-20 18:51:13 +00:00
Jeffrey Rainy 02b8bbd905
docs: removing internal comment from summary (#2267) 2022-10-19 20:40:51 +00:00
Simon Lemay 443769e2c1
fix: Don't allocate extraneous memory in FastBufferReader (#2265)
* fix: Don't allocate extraneous memory in FastBufferReader

* Add PR number to CHANGELOG entry
2022-10-19 19:52:04 +00:00
Jeffrey Rainy 30d23bcc7a
fix: NetworkManager property more robust on NetworkBehaviour (#2257)
fix: more robust checks around NetworkObjects being null
2022-10-19 14:54:00 -04:00
ashwini 2c69184e5f
chore: update changelog for 1.1 (#2264) 2022-10-18 19:36:21 +01:00
Noel Stephens 73ac14155f
fix: NetworkManager ApprovalTimeout should not depend upon client synchronization (#2261)
* fix
This fix separates the IsConnectedClient from the approval process by adding an IsApproved flag.
This also has a fix to prevent the domain backup error during serialization.

* test
Added the ability to bypass the entire NetcodeIntegrationTest connection approval process after the server and clients have been started.  This allows us to now use NetcodeIntegrationTest for unique connection oriented tests without being bound to the asserts if not all clients connected properly.
Refactored for ConnectionApprovalTimeoutTests to use the added m_BypassConnectionTimeout to bypass the waiting for clients to connect. It still uses the message hook catch technique to simulate the timeout scenarios where either a server detects a transport connection but never receives a connection request or a client sends the connection request but never receives approval for the connection.
2022-10-17 21:19:45 -05:00
Jeffrey Rainy 01d7ed7d3d
fix: Letting NetworkVariables be serialized even if they're not going to be sent (#2263)
fix: Letting NetworkVariables be serialized even if they're not going to be sent. This prevents NetworkList synchronization issues
2022-10-17 11:14:27 -04:00
Kitty Draper 95f44196b7
chore: Added XMLDoc for HiddenScriptEditor.OnInspectorGUI() (#2259) 2022-10-14 20:31:04 +01:00
ashwini 0b0cc1b715
chore: Update changelog (#2258) 2022-10-14 17:45:33 +00:00
Kitty Draper 8d2218748a
fix: INetworkMessageILPP failing to output registration code for network messages (#2256)
* fix
Resolves the issue where NetworkMessageILPP was failing for users using different API Compatibility Settings.
2022-10-13 23:41:21 +00:00
Noel Stephens ad633b2b95
fix: SceneEventProgress does not handle NetworkManager shut down during scene event (#2254)
* fix
This resolves the issue where SceneEventProgress was not checking if the NetworkManager was no longer listening or a shutdown was in progress.

* update
Added additional NetworkLog warning when a client times out during connection approval.

* test
Added a mock test to verify SceneEventProgress can handle the NetworkManager shutting down during a scene event.
2022-10-13 16:10:41 -05:00
Frank Luong ac8ce246cb
fix: Removing extra bracket in UnityTransport (#2253)
* removing extra bracket

* adding tmp commit to pass the semantic pull request check

* Revert "adding tmp commit to pass the semantic pull request check"

This reverts commit d7f929688c.
2022-10-13 19:25:16 +00:00
Noel Stephens 6daf541e62
fix: NetworkSpawnManager.OnDespawnObject removing parent on client-side (#2252)
* fix
Fixes issue where despawning a parent NetworkObject would try to remove itself from the child on the client-side.

* test
Adding a test to verify this fix
2022-10-13 09:51:52 -05:00
Jeffrey Rainy 104986535b
fix: Not sending ChangeOwnership messages to clients that have an object hidden (#2251)
* fix: Not sending ChangeOwnership messages to clients that have an object hidden
2022-10-12 20:47:57 +00:00
Simon Lemay adc06f6c38
fix: Allow empty paths in SecretsLoaderHelper (#2250)
Co-authored-by: ashwini <36935028+ashwinimurt@users.noreply.github.com>
2022-10-11 22:15:30 -04:00
Kitty Draper 1a17102c33
fix: Refactored DeferredMessagingTests to not use coroutines and increased the slush value for the two timing-based tests... (#2248)
* fix: Refactored DeferredMessagingTests to not use coroutines and increased the slush value for the two timing-based tests... hopefully this will clear up the instability

* standards

* fixed failing tests

* Removed some commented-out code and left-in debug code.
2022-10-11 14:46:59 -07:00
Kitty Draper 0592550e2a
fix: Ensure network variable ILPP code picks up types used in NetworkList, too (#2245) 2022-10-10 21:51:09 +00:00
Noel Stephens e10c266dfd
fix: in-scene placed NetworkObject will not spawn client-side when disabled upon being despawned [MTT-4832] (#2239)
* fix
This resolves the issue with in-scene placed NetworkObjects that are disabled when despawned not being able to re-spawn again and handles synchronizing despawned in-scene placed NetworkObjects during a scene switch (LoadSceneMode.Single).

* test
Added integration test that validates disabling NetworkObjects when despawned works with currently connected clients, late joining clients, and when scene switching (LoadSceneMode.Single) while also having the server despawn the in-scene placed NetworkObject upon its first spawn (i.e. so it starts off not visible/active to the clients when they finish the scene switch).
2022-10-07 15:54:20 -05:00
Noel Stephens 4393621268
fix: Exclude test for rising animation state count during runtime builds (#2241)
* test update:
only include the animation state count check when running in the editor
2022-10-07 18:19:56 +00:00