Skip to content

Commit f3ea82c

Browse files
committed
Fix OnVerifyCanReceive
1 parent f5671fa commit f3ea82c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

com.unity.netcode.gameobjects/Runtime/Messaging/NetworkManagerHooks.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
7676

7777
if (m_NetworkManager.ConnectedClients.TryGetValue(senderId, out NetworkClient connectedClient) && messageType == typeof(ConnectionRequestMessage))
7878
{
79+
7980
if (NetworkLog.CurrentLogLevel <= LogLevel.Normal)
8081
{
8182
var transportErrorMsg = GetTransportErrorMessage(messageContent, m_NetworkManager);
@@ -98,7 +99,7 @@ public bool OnVerifyCanReceive(ulong senderId, Type messageType, FastBufferReade
9899
return false;
99100
}
100101

101-
if (m_NetworkManager.IsConnectedClient && messageType == typeof(ConnectionApprovedMessage))
102+
if (m_NetworkManager.IsConnectedClient && messageType == typeof(ConnectionApprovedMessage) && !(m_NetworkManager.CMBServiceConnection && m_NetworkManager.LocalClient.IsSessionOwner))
102103
{
103104
if (NetworkLog.CurrentLogLevel <= LogLevel.Normal)
104105
{

0 commit comments

Comments
 (0)