Skip to content

Commit e3643cf

Browse files
chore: merge 1.9.1 into develop (#2899)
* chore: tag change log (#2866) * chore: merge develop into 1.9.0 release (#2873) * test Increasing timeout for 2 URPC tests that commonly timeout. * style adding comments * update-temp Running tests on only 2022.3 * style and test Adjusting URPC tests. Fixing naming convention violation. * test increase number of bytes to adjust under CorruptBytes pass. * style missing white space * Revert "update-temp" This reverts commit 0958d04. * chore: bumping to v1.9.1 initial package release version (#2887) * chore bump initial package version. * update bumping version in changelog * style adding white space * Update CHANGELOG.md Removing this as it was not accurate.
1 parent b008929 commit e3643cf

File tree

5 files changed

+42
-21
lines changed

5 files changed

+42
-21
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

77
Additional documentation and release notes are available at [Multiplayer Documentation](https://docs-multiplayer.unity3d.com).
88

9-
## [Unreleased]
9+
## [1.9.1] - 2024-04-18
1010

1111
### Added
12-
-Added AnticipatedNetworkVariable<T>, which adds support for client anticipation of NetworkVariable values, allowing for more responsive gameplay (#2820)
12+
- Added AnticipatedNetworkVariable<T>, which adds support for client anticipation of NetworkVariable values, allowing for more responsive gameplay (#2820)
1313
- Added AnticipatedNetworkTransform, which adds support for client anticipation of NetworkTransforms (#2820)
1414
- Added NetworkVariableBase.ExceedsDirtinessThreshold to allow network variables to throttle updates by only sending updates when the difference between the current and previous values exceeds a threshold. (This is exposed in NetworkVariable<T> with the callback NetworkVariable<T>.CheckExceedsDirtinessThreshold) (#2820)
1515
- Added NetworkVariableUpdateTraits, which add additional throttling support: MinSecondsBetweenUpdates will prevent the NetworkVariable from sending updates more often than the specified time period (even if it exceeds the dirtiness threshold), while MaxSecondsBetweenUpdates will force a dirty NetworkVariable to send an update after the specified time period even if it has not yet exceeded the dirtiness threshold. (#2820)
1616
- Added virtual method NetworkVariableBase.OnInitialize() which can be used by NetworkVariable subclasses to add initialization code (#2820)
1717
- Added virtual method NetworkVariableBase.Update(), which is called once per frame to support behaviors such as interpolation between an anticipated value and an authoritative one. (#2820)
1818
- Added NetworkTime.TickWithPartial, which represents the current tick as a double that includes the fractional/partial tick value. (#2820)
19-
- Added NetworkTickSystem.AnticipationTick, which can be helpful with implementation of client anticipation. This value represents the tick the current local client was at at the beginning of the most recent network round trip, which enables it to correlate server update ticks with the client tick that may have triggered them. (#2820)
2019
- `NetworkVariable` now includes built-in support for `NativeHashSet`, `NativeHashMap`, `List`, `HashSet`, and `Dictionary` (#2813)
2120
- `NetworkVariable` now includes delta compression for collection values (`NativeList`, `NativeArray`, `NativeHashSet`, `NativeHashMap`, `List`, `HashSet`, `Dictionary`, and `FixedString` types) to save bandwidth by only sending the values that changed. (Note: For `NativeList`, `NativeArray`, and `List`, this algorithm works differently than that used in `NetworkList`. This algorithm will use less bandwidth for "set" and "add" operations, but `NetworkList` is more bandwidth-efficient if you are performing frequent "insert" operations.) (#2813)
2221
- `UserNetworkVariableSerialization` now has optional callbacks for `WriteDelta` and `ReadDelta`. If both are provided, they will be used for all serialization operations on NetworkVariables of that type except for the first one for each client. If either is missing, the existing `Write` and `Read` will always be used. (#2813)

com.unity.netcode.gameobjects/Editor/NetworkManagerEditor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private void DrawAllPropertyFields()
222222
private void DrawTransportField()
223223
{
224224
#if RELAY_INTEGRATION_AVAILABLE
225-
var useRelay = EditorPrefs.GetBool(k_UseEasyRelayIntegrationKey, false);
225+
var useRelay = EditorPrefs.GetBool(m_UseEasyRelayIntegrationKey, false);
226226
#else
227227
var useRelay = false;
228228
#endif
@@ -257,7 +257,7 @@ private void DrawTransportField()
257257
}
258258

259259
#if RELAY_INTEGRATION_AVAILABLE
260-
private readonly string k_UseEasyRelayIntegrationKey = "NetworkManagerUI_UseRelay_" + Application.dataPath.GetHashCode();
260+
private readonly string m_UseEasyRelayIntegrationKey = "NetworkManagerUI_UseRelay_" + Application.dataPath.GetHashCode();
261261
private string m_JoinCode = "";
262262
private string m_StartConnectionError = null;
263263
private string m_Region = "";
@@ -272,7 +272,7 @@ private void ShowStartConnectionButtons()
272272

273273
#if RELAY_INTEGRATION_AVAILABLE
274274
// use editor prefs to persist the setting when entering / leaving play mode / exiting Unity
275-
var useRelay = EditorPrefs.GetBool(k_UseEasyRelayIntegrationKey, false);
275+
var useRelay = EditorPrefs.GetBool(m_UseEasyRelayIntegrationKey, false);
276276
GUILayout.BeginHorizontal();
277277
useRelay = GUILayout.Toggle(useRelay, "Try Relay in the Editor");
278278

@@ -284,7 +284,7 @@ private void ShowStartConnectionButtons()
284284
}
285285
GUILayout.EndHorizontal();
286286

287-
EditorPrefs.SetBool(k_UseEasyRelayIntegrationKey, useRelay);
287+
EditorPrefs.SetBool(m_UseEasyRelayIntegrationKey, useRelay);
288288
if (useRelay && !Application.isPlaying && !CloudProjectSettings.projectBound)
289289
{
290290
EditorGUILayout.HelpBox("To use relay, you need to setup your project in the Project Settings in the Services section.", MessageType.Warning);

com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageCorruptionTests.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,16 @@ public unsafe void Send(ulong clientId, NetworkDelivery delivery, FastBufferWrit
9090
break;
9191
}
9292
case TypeOfCorruption.CorruptBytes:
93-
batchData.Seek(batchData.Length - 2);
94-
var currentByte = batchData.GetUnsafePtr()[0];
95-
batchData.WriteByteSafe((byte)(currentByte == 0 ? 1 : 0));
96-
MessageQueue.Add(batchData.ToArray());
97-
break;
93+
{
94+
batchData.Seek(batchData.Length - 4);
95+
for (int i = 0; i < 4; i++)
96+
{
97+
var currentByte = batchData.GetUnsafePtr()[i];
98+
batchData.WriteByteSafe((byte)(currentByte == 0 ? 1 : 0));
99+
MessageQueue.Add(batchData.ToArray());
100+
}
101+
break;
102+
}
98103
case TypeOfCorruption.Truncated:
99104
batchData.Truncate(batchData.Length - 1);
100105
MessageQueue.Add(batchData.ToArray());

com.unity.netcode.gameobjects/Tests/Runtime/UniversalRpcTests.cs

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,23 +1285,31 @@ public enum AllocationType
12851285
List
12861286
}
12871287

1288+
// Extending timeout since the added yield return causes this test to commonly timeout
1289+
[Timeout(600000)]
12881290
[UnityTest]
12891291
public IEnumerator TestSendingWithGroupOverride()
12901292
{
1293+
var waitFor = new WaitForFixedUpdate();
12911294
foreach (var defaultSendTo in Enum.GetValues(typeof(SendTo)))
12921295
{
1296+
m_EnableVerboseDebug = true;
1297+
VerboseDebug($"Processing: {defaultSendTo}");
1298+
m_EnableVerboseDebug = false;
1299+
12931300
foreach (var recipient in RecipientGroups)
12941301
{
12951302
for (ulong objectOwner = 0u; objectOwner <= 2u; ++objectOwner)
12961303
{
12971304
for (ulong sender = 0u; sender <= 2u; ++sender)
12981305
{
1306+
yield return waitFor;
12991307
foreach (var allocationType in Enum.GetValues(typeof(AllocationType)))
13001308
{
1301-
if (++YieldCheck % YieldCycleCount == 0)
1302-
{
1303-
yield return null;
1304-
}
1309+
//if (++YieldCheck % YieldCycleCount == 0)
1310+
//{
1311+
// yield return null;
1312+
//}
13051313
OnInlineSetup();
13061314
var sendMethodName = $"DefaultTo{defaultSendTo}AllowOverrideRpc";
13071315

@@ -1378,23 +1386,32 @@ public enum AllocationType
13781386
List
13791387
}
13801388

1389+
// Extending timeout since the added yield return causes this test to commonly timeout
1390+
[Timeout(600000)]
13811391
[UnityTest]
13821392
public IEnumerator TestSendingWithGroupNotOverride()
13831393
{
1394+
var waitFor = new WaitForFixedUpdate();
13841395
foreach (var defaultSendTo in Enum.GetValues(typeof(SendTo)))
13851396
{
1397+
m_EnableVerboseDebug = true;
1398+
VerboseDebug($"Processing: {defaultSendTo}");
1399+
m_EnableVerboseDebug = false;
13861400
foreach (var recipient in RecipientGroups)
13871401
{
13881402
for (ulong objectOwner = 0u; objectOwner <= 2u; ++objectOwner)
13891403
{
13901404
for (ulong sender = 0u; sender <= 2u; ++sender)
13911405
{
1406+
yield return waitFor;
1407+
13921408
foreach (var allocationType in Enum.GetValues(typeof(AllocationType)))
13931409
{
1394-
if (++YieldCheck % YieldCycleCount == 0)
1395-
{
1396-
yield return null;
1397-
}
1410+
//if (++YieldCheck % YieldCycleCount == 0)
1411+
//{
1412+
// yield return waitFor;
1413+
//}
1414+
13981415
OnInlineSetup();
13991416
var sendMethodName = $"DefaultTo{defaultSendTo}AllowOverrideRpc";
14001417

com.unity.netcode.gameobjects/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.unity.netcode.gameobjects",
33
"displayName": "Netcode for GameObjects",
44
"description": "Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.",
5-
"version": "1.9.0",
5+
"version": "1.9.1",
66
"unity": "2021.3",
77
"dependencies": {
88
"com.unity.nuget.mono-cecil": "1.10.1",

0 commit comments

Comments
 (0)