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 @@ -21,6 +21,7 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Fixed

- Fixed issue where clients were not rebuilding the `NetworkConfig` hash value for each unique connection request. (#2226)
- Fixed the issue where player objects were not taking the `DontDestroyWithOwner` property into consideration when a client disconnected. (#2225)
- Fixed issue #1924 where `UnityTransport` would fail to restart after a first failure (even if what caused the initial failure was addressed). (#2220)
- Fixed issue where `NetworkTransform.SetStateServerRpc` and `NetworkTransform.SetStateClientRpc` were not honoring local vs world space settings when applying the position and rotation. (#2203)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,9 @@ private void SendConnectionRequest()
{
var message = new ConnectionRequestMessage
{
ConfigHash = NetworkConfig.GetConfig(),
// Since only a remote client will send a connection request,
// we should always force the rebuilding of the NetworkConfig hash value
ConfigHash = NetworkConfig.GetConfig(false),
ShouldSendConnectionData = NetworkConfig.ConnectionApproval,
ConnectionData = NetworkConfig.ConnectionData
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,27 @@ private void NetworkManagerObject_ConnectionApprovalCallback(NetworkManager.Conn
response.PlayerPrefabHash = null;
}


[Test]
public void VerifyUniqueNetworkConfigPerRequest()
{
var networkConfig = new NetworkConfig();
networkConfig.EnableSceneManagement = true;
networkConfig.TickRate = 30;
var currentHash = networkConfig.GetConfig();
networkConfig.EnableSceneManagement = false;
networkConfig.TickRate = 60;
var newHash = networkConfig.GetConfig(false);

Assert.True(currentHash != newHash, $"Hashed {nameof(NetworkConfig)} values {currentHash} and {newHash} should not be the same!");
}

[TearDown]
public void TearDown()
{
// Stop, shutdown, and destroy
NetworkManagerHelper.ShutdownNetworkManager();
}

}
}