Skip to content

Commit 9ec4724

Browse files
fix
This resolves an issue with the previous fix for the DA service disconnect issue where it should only early exit a disconnect event if there is not connected client and it is the server =or= it is a client connected to the CMB service backend and the clients locally stored transport ID is no longer valid.
1 parent 43a0cc0 commit 9ec4724

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,10 @@ internal void DisconnectEventHandler(ulong transportClientId)
597597
// do not remove it just yet.
598598
var (clientId, isConnectedClient) = TransportIdToClientId(transportClientId);
599599

600-
// If the client is not registered and we are the server
601-
if (!isConnectedClient)
600+
// If the client is not registered and we are the server or we are connecting to
601+
// the live CMB service and the client had a transport Id assigned then exit early
602+
/// <see cref="DisconnectReasonMessage"/> handles disconnecting the client
603+
if (!isConnectedClient && (NetworkManager.IsServer || (NetworkManager.CMBServiceConnection && m_LocalClientTransportId != 0)))
602604
{
603605
// Then exit early
604606
return;
@@ -641,8 +643,18 @@ internal void DisconnectEventHandler(ulong transportClientId)
641643
// Client's clean up their transport id separately from the server.
642644
TransportIdCleanUp(transportClientId);
643645

644-
// Notify local client of disconnection
645-
InvokeOnClientDisconnectCallback(clientId);
646+
try
647+
{
648+
// Notify local client of disconnection
649+
InvokeOnClientDisconnectCallback(clientId);
650+
}
651+
catch (Exception ex)
652+
{
653+
Debug.LogException(ex);
654+
}
655+
656+
// Reset the transport ID
657+
m_LocalClientTransportId = 0;
646658

647659
// As long as we are not in the middle of a shutdown
648660
if (!NetworkManager.ShutdownInProgress)

testproject/.vsconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Workload.ManagedGame"
5+
]
6+
}

testproject/Packages/packages-lock.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@
457457
"com.unity.modules.ui": "1.0.0",
458458
"com.unity.modules.imgui": "1.0.0",
459459
"com.unity.modules.jsonserialize": "1.0.0",
460-
"com.unity.modules.hierarchycore": "1.0.0"
460+
"com.unity.modules.hierarchycore": "1.0.0",
461+
"com.unity.modules.physics": "1.0.0"
461462
}
462463
},
463464
"com.unity.modules.umbra": {

testproject/ProjectSettings/ProjectSettings.asset

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ PlayerSettings:
7070
androidStartInFullscreen: 1
7171
androidRenderOutsideSafeArea: 1
7272
androidUseSwappy: 1
73+
androidDisplayOptions: 1
7374
androidBlitType: 0
7475
androidResizeableActivity: 0
7576
androidDefaultWindowWidth: 1920
@@ -86,6 +87,7 @@ PlayerSettings:
8687
muteOtherAudioSources: 0
8788
Prepare IOS For Recording: 0
8889
Force IOS Speakers When Recording: 0
90+
audioSpatialExperience: 0
8991
deferSystemGesturesMode: 0
9092
hideHomeButton: 0
9193
submitAnalytics: 1
@@ -132,6 +134,7 @@ PlayerSettings:
132134
switchNVNMaxPublicSamplerIDCount: 0
133135
switchMaxWorkerMultiple: 8
134136
switchNVNGraphicsFirmwareMemory: 32
137+
switchGraphicsJobsSyncAfterKick: 1
135138
vulkanNumSwapchainBuffers: 3
136139
vulkanEnableSetSRGBWrite: 0
137140
vulkanEnablePreTransform: 0
@@ -271,6 +274,9 @@ PlayerSettings:
271274
AndroidBuildApkPerCpuArchitecture: 0
272275
AndroidTVCompatibility: 0
273276
AndroidIsGame: 1
277+
androidAppCategory: 3
278+
useAndroidAppCategory: 1
279+
androidAppCategoryOther:
274280
AndroidEnableTango: 0
275281
androidEnableBanner: 1
276282
androidUseLowAccuracyLocation: 0
@@ -442,6 +448,9 @@ PlayerSettings:
442448
- m_BuildTarget: WebGLSupport
443449
m_APIs: 0b000000
444450
m_Automatic: 1
451+
- m_BuildTarget: WindowsStandaloneSupport
452+
m_APIs: 0200000012000000
453+
m_Automatic: 0
445454
m_BuildTargetVRSettings:
446455
- m_BuildTarget: Standalone
447456
m_Enabled: 0
@@ -723,12 +732,12 @@ PlayerSettings:
723732
webGLMemoryLinearGrowthStep: 16
724733
webGLMemoryGeometricGrowthStep: 0.2
725734
webGLMemoryGeometricGrowthCap: 96
726-
webGLEnableWebGPU: 0
727735
webGLPowerPreference: 2
728736
webGLWebAssemblyTable: 0
729737
webGLWebAssemblyBigInt: 0
730738
webGLCloseOnQuit: 0
731739
webWasm2023: 0
740+
webEnableSubmoduleStrippingCompatibility: 0
732741
scriptingDefineSymbols:
733742
Standalone: UNITY_NETCODE_NATIVE_COLLECTION_SUPPORT
734743
additionalCompilerArguments:
@@ -866,3 +875,5 @@ PlayerSettings:
866875
insecureHttpOption: 0
867876
androidVulkanDenyFilterList: []
868877
androidVulkanAllowFilterList: []
878+
androidVulkanDeviceFilterListAsset: {fileID: 0}
879+
d3d12DeviceFilterListAsset: {fileID: 0}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 6000.0.61f1
2-
m_EditorVersionWithRevision: 6000.0.61f1 (74a0adb02c31)
1+
m_EditorVersion: 6000.2.12f1
2+
m_EditorVersionWithRevision: 6000.2.12f1 (e89d5df0e333)

0 commit comments

Comments
 (0)