Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
- Fixed NetworkObjects not being despawned before they are destroyed during shutdown for client, host, and server instances. (#1390)
- Fixed KeyNotFound exception when removing ownership of a newly spawned NetworkObject that is already owned by the server. (#1500)
- Fixed issue where pooled NetworkObjects using NetworkTransform would interpolate from their last de-spawned position to the newly spawned position (#1505)
- Fixed NetworkManager.LocalClient not being set when starting as a host. (#1511)

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,7 @@ internal void HandleApproval(ulong ownerClientId, bool createPlayerObject, uint?
}
else // Server just adds itself as an observer to all spawned NetworkObjects
{
LocalClient = client;
SpawnManager.UpdateObservedNetworkObjects(ownerClientId);
InvokeOnClientConnectedCallback(ownerClientId);
}
Expand Down
16 changes: 16 additions & 0 deletions testproject/Assets/Tests/Runtime/NetworkManagerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using NUnit.Framework;
using Unity.Netcode.RuntimeTests;

namespace TestProject.RuntimeTests
{
public class NetworkManagerTests : BaseMultiInstanceTest
{
protected override int NbClients => 1;

[Test]
public void ValidateHostLocalClient()
{
Assert.IsTrue(m_ServerNetworkManager.LocalClient != null);
}
}
}
11 changes: 11 additions & 0 deletions testproject/Assets/Tests/Runtime/NetworkManagerTests.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.